Now that the blockchain has been started, you might want to install your own instance of uCoin to either:
- Participate to the writing of the blockchain
- Just have a local passive node for mirroring
Doing so is super easy, given the fact you have:
- A Linux distribution with node.js + npm installed
- Access to your Internet box & are able to open a TCP port + redirect it to your PC/server
1. Installing uCoin
$ sudo npm install -g ucoin
You can check installed version by using:
$ ucoind --version 0.9.1
2. Configure your node
As a first installation, you only need to make a
basic configuration. Here is how:
$ ucoind wizard basic
This command is an helper to configure your node without making too much errors. My configuration looks like:
[?] Key's salt: *********** [?] Key's password: ********* [?] IPv4 interface: eth0 192.168.1.18 [?] IPv6 interface: None [?] Port: 9101 [?] Remote IPv4 220.127.116.11 [?] Remote IPv6 None [?] Remote port: 9101 [2014-11-21 19:08:55.694] [DEBUG] ucoind - Configuration saved.
Where salt & password are the values I use for my personal key of member. If what you want is to write into the blockchain, you should do this too. Otherwise, you can put whatever values for salt & password.
On above config, you can see 3 special parameters:
[?] Remote IPv4 18.104.22.168 [?] Remote IPv6 None [?] Remote port: 9101
These are the network configuration for others to reach your node outside your private network, for example from the Internet.
This data will be publicly available, since your node will send it to ucoin network so your node can be forwarded new data (blocks, peers, …).
This is where you might need to access your Internet box and open a port, and redirect it to your local ucoin instance whose parameters are (for example):
[?] IPv4 interface: eth0 192.168.1.18 [?] IPv6 interface: None [?] Port: 9101
You will also need to configure Proof-of-Work parameters:
$ ucoind wizard pow [?] Participate writing the blockchain (when member) Yes [?] Start computation of a new block if none received since (seconds) 1200 [2014-11-21 19:15:53.635] [DEBUG] ucoind - Configuration saved.
Here, if you do not want to participate to the writing of the blockchain, just answer “No” to the first question. Otherwise, you will be asked for a delay to wait before computing next block. I suggest value
1200 here. You can put whatever value you want, this is for computation (CPU) saving purposes. This value is in seconds.
3. Synchronize with an existing node
$ ucoind sync twiced.fr 9101 [2014-11-21 19:26:14.367] [INFO] sync - Connecting remote host... [2014-11-21 19:26:14.370] [INFO] sync - Sync started. [2014-11-21 19:26:14.370] [INFO] sync - Downloading Blockchain... [2014-11-21 19:26:14.699] [INFO] blockchain - Block #0 added to the blockchain [2014-11-21 19:26:14.898] [INFO] blockchain - Block #1 added to the blockchain [2014-11-21 19:26:15.016] [INFO] blockchain - Block #2 added to the blockchain [2014-11-21 19:26:15.134] [INFO] blockchain - Block #3 added to the blockchain [2014-11-21 19:26:15.311] [INFO] sync - Sync finished.
Good! We have downloaded & applied an existing blockchain on our node.
4. Start your node
There we are! You should have your node either computing next block, or just waiting for new data.