# Installing your own node

**URL:** https://forum.duniter.org/t/installing-your-own-node/72
**Category:** ZetaB
**Created:** [21 November 2014 18:38 UTC](https://forum.duniter.org/t/installing-your-own-node/72 "2014-11-21T18:38:07Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![cgeek](https://forum.duniter.org/user_avatar/forum.duniter.org/cgeek/32/279_2.png) [@cgeek](https://forum.duniter.org/u/cgeek)
#### Post date: [21 November 2014 18:38 UTC](https://forum.duniter.org/t/installing-your-own-node/72/1 "2014-11-21T18:38:07Z")

</div>

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

Let’s go!

### 1. Installing uCoin

Simply run:

```bash
$ sudo npm install -g ucoin

```

You can check installed version by using:

```bash
$ ucoind --version
0.9.1

```

### 2. Configure your node

As a first installation, you only need to make a `basic` configuration. Here is how:

```bash
$ ucoind wizard basic

```

This command is an helper to configure your node without making too much errors. My configuration looks like:

```bash
[?] Key's salt: ***********
[?] Key's password: *********
[?] IPv4 interface: eth0 192.168.1.18
[?] IPv6 interface: None
[?] Port: 9101
[?] Remote IPv4 88.163.127.43
[?] 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.

#### Remote parameters

On above config, you can see 3 special parameters:

```bash
[?] Remote IPv4 88.163.127.43
[?] 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):

```bash
[?] IPv4 interface: eth0 192.168.1.18
[?] IPv6 interface: None
[?] Port: 9101

```

#### Proof-of-Work parameters

You will also need to configure Proof-of-Work parameters:

```bash
$ 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

Just run:

```bash
$ 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

```bash
ucoind start

```

### 5. Enjoy!

There we are! You should have your node either computing next block, or just waiting for new data.

---

<div class="post-metadata">

### Author: ![Inso](https://forum.duniter.org/user_avatar/forum.duniter.org/inso/32/1229_2.png) [@Inso](https://forum.duniter.org/u/Inso)
#### Post date: [22 November 2014 13:21 UTC](https://forum.duniter.org/t/installing-your-own-node/72/2 "2014-11-22T13:21:10Z")

</div>

I installed mine and its working perfectly 🙂

If there any clean way to demonize it ?

---

<div class="post-metadata">

### Author: ![cgeek](https://forum.duniter.org/user_avatar/forum.duniter.org/cgeek/32/279_2.png) [@cgeek](https://forum.duniter.org/u/cgeek)
#### Post date: [23 November 2014 08:21 UTC](https://forum.duniter.org/t/installing-your-own-node/72/3 "2014-11-23T08:21:01Z")

</div>

Yep! Using `forever`.

```
$ sudo npm install -g forever

```

And daemonization:

```
$ forever start /usr/bin/ucoind start

```

You can see your processes using:

```
$ forever list

```

And check ucoin’s logs with (given ucoin is your first forever process):

```
$ forever logs 0 -f
```

---

<div class="post-metadata">

### Author: ![Inso](https://forum.duniter.org/user_avatar/forum.duniter.org/inso/32/1229_2.png) [@Inso](https://forum.duniter.org/u/Inso)
#### Post date: [23 November 2014 08:28 UTC](https://forum.duniter.org/t/installing-your-own-node/72/4 "2014-11-23T08:28:58Z")

</div>

Perfect, thanks 🙂

My node is running on inso.ovh:8033

---

<div class="post-metadata">

### Author: ![cgeek](https://forum.duniter.org/user_avatar/forum.duniter.org/cgeek/32/279_2.png) [@cgeek](https://forum.duniter.org/u/cgeek)
#### Post date: [23 November 2014 11:00 UTC](https://forum.duniter.org/t/installing-your-own-node/72/5 "2014-11-23T11:00:51Z")

</div>

I’m sorry, but you will have to reset your node 😕 since I’ve found 2 bugs that:

- stuck the blockchain on B#11 (it is waiting for a UD that will never come)
- avoid peer’s discovering, so both you & I are currently not notified if one or the other find a new valid block

Shortly, you need to update ucoin:

```
$ forever stop 0
$ sudo npm install -g ucoin

```

Check version:

```
$ ucoind --version
0.9.2

```

Reset data (not config):

```
$ ucoind reset data

```

Resync:

```
$ ucoind sync twiced.fr 9101

```

And restart your node:

```
$ forever start /usr/bin/ucoind start

```

That said, your node is indeed working, I’ve just checked [http://inso.ovh:8033/blockchain/current](http://inso.ovh:8033/blockchain/current) 😉 Great!

---

<div class="post-metadata">

### Author: ![Inso](https://forum.duniter.org/user_avatar/forum.duniter.org/inso/32/1229_2.png) [@Inso](https://forum.duniter.org/u/Inso)
#### Post date: [23 November 2014 11:19 UTC](https://forum.duniter.org/t/installing-your-own-node/72/6 "2014-11-23T11:19:52Z")

</div>

I was indeed thinking that the errors in my logs were not intended… :smile:

I upgraded my node, no more errors !

---

<div class="post-metadata">

### Author: ![cgeek](https://forum.duniter.org/user_avatar/forum.duniter.org/cgeek/32/279_2.png) [@cgeek](https://forum.duniter.org/u/cgeek)
#### Post date: [23 November 2014 12:18 UTC](https://forum.duniter.org/t/installing-your-own-node/72/7 "2014-11-23T12:18:14Z")

</div>

Congratulations! Block#15 was written by your node 😉

[http://inso.ovh:8033/blockchain/block/15](http://inso.ovh:8033/blockchain/block/15)  
[http://twiced.fr:9101/blockchain/block/15](http://twiced.fr:9101/blockchain/block/15)

Hope folks will add their own node, so we can start the uBlockchain symphony! 🙂

---

<div class="post-metadata">

### Author: ![cgeek](https://forum.duniter.org/user_avatar/forum.duniter.org/cgeek/32/279_2.png) [@cgeek](https://forum.duniter.org/u/cgeek)
#### Post date: [23 November 2014 18:18 UTC](https://forum.duniter.org/t/installing-your-own-node/72/8 "2014-11-23T18:18:13Z")

</div>

Could you update to v0.9. **4**? I’ve changed proof-of-work difficulty rule, which was unfair.

If your current block is still B#20, you do not need to reset data.

Thanks 😁

---

<div class="post-metadata">

### Author: ![Inso](https://forum.duniter.org/user_avatar/forum.duniter.org/inso/32/1229_2.png) [@Inso](https://forum.duniter.org/u/Inso)
#### Post date: [23 November 2014 18:33 UTC](https://forum.duniter.org/t/installing-your-own-node/72/9 "2014-11-23T18:33:11Z")

</div>

No problem…

Done 😉

---

<div class="post-metadata">

### Author: ![mhugo](https://forum.duniter.org/user_avatar/forum.duniter.org/mhugo/32/30_2.png) [@mhugo](https://forum.duniter.org/u/mhugo)
#### Post date: [9 December 2014 21:29 UTC](https://forum.duniter.org/t/installing-your-own-node/72/10 "2014-12-09T21:29:29Z")

</div>

I tried to setup a server, but failed.

After launching ‘ucoind wizard basic’, nothing happens and it seems to be waiting for something (a network connection somewhere ?).  
I then tried ‘uciond reset all’, and had the following message :  
ucoind reset all

```
[2014-12-09 22:26:48.051] [ERROR] ucoin_default - connection error: [Error: failed to connect to [localhost:27017]]
Error: failed to connect to [localhost:27017]
    at null. (/usr/local/lib/node_modules/ucoin/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:553:74)
    at EventEmitter.emit (events.js:106:17)
    at null. (/usr/local/lib/node_modules/ucoin/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:140:15)
    at EventEmitter.emit (events.js:98:17)
    at Socket. (/usr/local/lib/node_modules/ucoin/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection.js:512:10)
    at Socket.EventEmitter.emit (events.js:95:17)
    at net.js:441:14
    at process._tickCallback (node.js:415:13)
```

Any idea ? (sorry I don’t know nodejs)

---

<div class="post-metadata">

### Author: ![mhugo](https://forum.duniter.org/user_avatar/forum.duniter.org/mhugo/32/30_2.png) [@mhugo](https://forum.duniter.org/u/mhugo)
#### Post date: [9 December 2014 21:30 UTC](https://forum.duniter.org/t/installing-your-own-node/72/11 "2014-12-09T21:30:19Z")

</div>

btw, I am using ucoind 0.9.5 (downloaded ~10 minutes ago)

---

<div class="post-metadata">

### Author: ![cgeek](https://forum.duniter.org/user_avatar/forum.duniter.org/cgeek/32/279_2.png) [@cgeek](https://forum.duniter.org/u/cgeek)
#### Post date: [9 December 2014 22:24 UTC](https://forum.duniter.org/t/installing-your-own-node/72/12 "2014-12-09T22:24:58Z")

</div>

You need to install mongodb:

```
sudo apt-get install mongodb

```

Then, all your commands should work as expected.

---

<div class="post-metadata">

### Author: ![Benoit\_Lavenier](https://forum.duniter.org/letter_avatar/benoit_lavenier/32/5_5575768a8748004e209b776fc1b2916d.png) [@Benoit\_Lavenier](https://forum.duniter.org/u/Benoit_Lavenier)
#### Post date: [16 December 2014 09:33 UTC](https://forum.duniter.org/t/installing-your-own-node/72/13 "2014-12-16T09:33:26Z")

</div>

I installed a node in our server : [http://server.e-is.pro:9101](http://server.e-is.pro:9101)

To known this node, your node need to sync once (this is pending bug - known by @cgeek) :

```
ucoin sync server.e-is.pro 9101
```

---

<div class="post-metadata">

### Author: ![mhugo](https://forum.duniter.org/user_avatar/forum.duniter.org/mhugo/32/30_2.png) [@mhugo](https://forum.duniter.org/u/mhugo)
#### Post date: [19 December 2014 11:00 UTC](https://forum.duniter.org/t/installing-your-own-node/72/14 "2014-12-19T11:00:23Z")

</div>

@cgeek : thanks, it was only a matter of ubuntu packages.

Now, I am not sure if I have the server in a proper state, after running ‘sync’, I get this

```
ucoind sync twiced.fr 9101
[2014-12-19 09:22:49.944] [INFO] sync - Connecting remote host...
[2014-12-19 09:22:49.948] [INFO] sync - Sync started.
[2014-12-19 09:22:49.948] [INFO] sync - Downloading Blockchain...
[2014-12-19 09:22:50.403] [INFO] sync - Sync finished.
[2014-12-19 09:22:50.404] [ERROR] ucoind - Error during sync: Block must have a UniversalDividend field
```

An old block encountered with an old format I guess ?

I tried to launch the server anyway. I may have generated a block (bot not sure yet). Should my node be reachable from the outside to be able to publish a block ?  
Could I be part of the blockchain generation with a dynamic IP ? (not a sync server but a blockchain participant)

---

<div class="post-metadata">

### Author: ![cgeek](https://forum.duniter.org/user_avatar/forum.duniter.org/cgeek/32/279_2.png) [@cgeek](https://forum.duniter.org/u/cgeek)
#### Post date: [19 December 2014 11:10 UTC](https://forum.duniter.org/t/installing-your-own-node/72/15 "2014-12-19T11:10:50Z")

</div>

> [@mhugo](#):
>
> An old block encountered with an old format I guess ?

Yes. Update ucoin, this error is due to a protocol change about UD (it was not exactly symmetric).

```
$ ucoind --version
0.9.9

```

You will have to:

```
$ ucoind reset data
$ ucoind sync inso.ovh 8033

```

And restart your node.

> [@mhugo](#):
>
> I may have generated a block (bot not sure yet). Should my node be reachable from the outside to be able to publish a block ?

No, but to receive blocks from outside it has to. I’ve not handled dynamic IP yet, but in theory there is no real difficulty: your peer can change of IP and broadcast this information.

edit: congrats! you have successfully written a [block#1996](http://twiced.fr:9101/blockchain/block/1996)!

---

<div class="post-metadata">

### Author: ![mhugo](https://forum.duniter.org/user_avatar/forum.duniter.org/mhugo/32/30_2.png) [@mhugo](https://forum.duniter.org/u/mhugo)
#### Post date: [19 December 2014 13:44 UTC](https://forum.duniter.org/t/installing-your-own-node/72/16 "2014-12-19T13:44:45Z")

</div>

Arf, I forgot the “reset” step.  
My node is running and I’ve been contributing to some blocks (not yet sure to have my node online very often)  
Cool, thanks for the hard work !

---

<div class="post-metadata">

### Author: ![OAuber](https://forum.duniter.org/user_avatar/forum.duniter.org/oauber/32/36_2.png) [@OAuber](https://forum.duniter.org/u/OAuber)
#### Post date: [20 December 2014 22:43 UTC](https://forum.duniter.org/t/installing-your-own-node/72/17 "2014-12-20T22:43:58Z")

</div>

On a brand new ubuntu 14.4  
I installed node.js + npm apparently with no problem like this  
sudo apt-get install nodejs npm  
Then  
sudo npm install -g ucoin  
gives…  
gyp ERR! build error  
gyp ERR! stack Error: `make` failed with exit code: 2  
gyp ERR! stack at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:267:23)  
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)  
gyp ERR! stack at Process.ChildProcess.\_handle.onexit (child\_process.js:797:12)  
gyp ERR! System Linux 3.13.0-43-generic  
gyp ERR! command “nodejs” “/usr/bin/node-gyp” “rebuild”  
gyp ERR! cwd /usr/local/lib/node\_modules/ucoin/node\_modules/scrypt  
gyp ERR! node -v v0.10.25  
gyp ERR! node-gyp -v v0.10.10  
gyp ERR! not ok  
npm WARN This failure might be due to the use of legacy binary “node”  
npm WARN For further explanations, please read  
/usr/share/doc/nodejs/README.Debian

npm ERR! weird error 1  
npm ERR! tar pack Error reading /root/tmp/npm-6553-cNzN9rVj/1419113651895-0.6043168399482965/package  
npm ERR! addLocalDirectory Could not pack “/root/tmp/npm-6553-cNzN9rVj/1419113651895-0.6043168399482965/package” to “/root/.npm/multiparty/2.2.0/package.tgz”

> kerberos@0.0.3 install /usr/local/lib/node\_modules/ucoin/node\_modules/mongoose/node\_modules/mongodb/node\_modules/kerberos  
> (node-gyp rebuild 2\> builderror.log) || (exit 0)

npm ERR! Error: ENOENT, lstat ‘/root/tmp/npm-6553-cNzN9rVj/1419113657047-0.12364506418816745/package/build/Release/bson.pdb’  
npm ERR! System Linux 3.13.0-43-generic  
npm ERR! command “/usr/bin/nodejs” “/usr/bin/npm” “install” “-g” “ucoin”  
npm ERR! cwd /home/olivier  
npm ERR! node -v v0.10.25  
npm ERR! npm -v 1.3.10  
npm ERR! path /root/tmp/npm-6553-cNzN9rVj/1419113657047-0.12364506418816745/package/build/Release/bson.pdb  
npm ERR! fstream\_path /root/tmp/npm-6553-cNzN9rVj/1419113657047-0.12364506418816745/package/build/Release/bson.pdb  
npm ERR! fstream\_type File  
npm ERR! fstream\_class FileWriter  
npm ERR! code ENOENT  
npm ERR! errno 34  
npm ERR! fstream\_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26  
npm ERR! fstream\_stack Object.oncomplete (fs.js:107:15)  
make: entrant dans le répertoire « /usr/local/lib/node\_modules/ucoin/node\_modules/mongoose/node\_modules/mongodb/node\_modules/kerberos/build »  
SOLINK\_MODULE(target) Release/obj.target/kerberos.node  
SOLINK\_MODULE(target) Release/obj.target/kerberos.node: Finished  
COPY Release/kerberos.node  
make: quittant le répertoire « /usr/local/lib/node\_modules/ucoin/node\_modules/mongoose/node\_modules/mongodb/node\_modules/kerberos/build »

> bson@0.2.5 install /usr/local/lib/node\_modules/ucoin/node\_modules/mongoose/node\_modules/mongodb/node\_modules/bson  
> (node-gyp rebuild 2\> builderror.log) || (exit 0)

npm http GET [https://registry.npmjs.org/next-tick](https://registry.npmjs.org/next-tick)  
make: entrant dans le répertoire « /usr/local/lib/node\_modules/ucoin/node\_modules/mongoose/node\_modules/mongodb/node\_modules/bson/build »  
CXX(target) Release/obj.target/bson/ext/bson.o  
…  
SOLINK\_MODULE(target) Release/obj.target/bson.node  
SOLINK\_MODULE(target) Release/obj.target/bson.node: Finished  
COPY Release/bson.node  
make: quittant le répertoire « /usr/local/lib/node\_modules/ucoin/node\_modules/mongoose/node\_modules/mongodb/node\_modules/bson/build »  
…  
npm WARN engine node-localstorage@0.3.4: wanted: {“node”:“0.8.x”} (current: {“node”:“v0.10.25”,“npm”:“1.3.10”})

> vucoin@0.22.1 postuninstall /usr/local/lib/node\_modules/ucoin/node\_modules/vucoin  
> ./postuninstall.sh  
> sh: 1: ./postuninstall.sh: not found  
> npm WARN continuing anyway undefined  
> npm WARN This failure might be due to the use of legacy binary “node”  
> npm WARN For further explanations, please read  
> /usr/share/doc/nodejs/README.Debian  
> npm ERR!  
> npm ERR! Additional logging details can be found in:  
> npm ERR! /home/olivier/npm-debug.log  
> npm ERR! not ok code 0

---

<div class="post-metadata">

### Author: ![cgeek](https://forum.duniter.org/user_avatar/forum.duniter.org/cgeek/32/279_2.png) [@cgeek](https://forum.duniter.org/u/cgeek)
#### Post date: [21 December 2014 09:24 UTC](https://forum.duniter.org/t/installing-your-own-node/72/18 "2014-12-21T09:24:03Z")

</div>

You probably need to:

```
$ sudo apt-get install nodejs-legacy

```

And then reinstall ucoin.

---

<div class="post-metadata">

### Author: ![OAuber](https://forum.duniter.org/user_avatar/forum.duniter.org/oauber/32/36_2.png) [@OAuber](https://forum.duniter.org/u/OAuber)
#### Post date: [21 December 2014 11:23 UTC](https://forum.duniter.org/t/installing-your-own-node/72/19 "2014-12-21T11:23:35Z")

</div>

Thanks, it works better, but I still get:  
gyp ERR! build error  
gyp ERR! stack Error: `make` failed with exit code: 2  
gyp ERR! stack at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:267:23)  
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)  
gyp ERR! stack at Process.ChildProcess.\_handle.onexit (child\_process.js:797:12)  
gyp ERR! System Linux 3.13.0-43-generic  
gyp ERR! command “nodejs” “/usr/bin/node-gyp” "rebuild"  
gyp ERR! cwd /usr/local/lib/node\_modules/ucoin/node\_modules/scrypt  
gyp ERR! node -v v0.10.25  
gyp ERR! node-gyp -v v0.10.10  
gyp ERR! not ok  
npm WARN This failure might be due to the use of legacy binary "node"  
npm WARN For further explanations, please read  
/usr/share/doc/nodejs/README.Debian  
npm ERR! weird error 1  
npm ERR! not ok code 0

---

<div class="post-metadata">

### Author: ![cgeek](https://forum.duniter.org/user_avatar/forum.duniter.org/cgeek/32/279_2.png) [@cgeek](https://forum.duniter.org/u/cgeek)
#### Post date: [21 December 2014 11:30 UTC](https://forum.duniter.org/t/installing-your-own-node/72/20 "2014-12-21T11:30:28Z")

</div>

You should have something like:

```
$ node-gyp --version
v1.0.2

```

Could you try the following command?

```
$ sudo apt-get install node-gyp

```

And if you still do not have `v1.0.2` version for node-gyp:

```
$ sudo npm install -g node-gyp
```

[Next page](https://forum.duniter.org/t/installing-your-own-node/72.md?page=2)
