Running a Monero node from source under Ubuntu 16 LTS

This howto is made to show you how to run a Monero node. To run a Monero node we need the official monero daemon software:

monerod

This program will start and wait for the network synchronization – our Monero node will receive all the blockchains of the network!
Installing (or compiling it) the Monero software of the official site will ensure you have the right software for generating and sending/receiving transactions securely and privately! Always use your node software for generating the Monero wallet address, DO NOT TRUST any sites, which offer you a creation of Monero wallet. In crypto world the one how controls the private key of the wallet (which is generated with the creation of the wallet) controls the Monero wallet address so controls your funds! Just Install or compile a Monero node software – Building from source a Monero node under Ubuntu 16 LTS and you’ll everything you need to manage your Monero funds!
It’s worth mentioning again this section of Monero node howto:
And also be warned DO NOT use insecure sources when:

  1. installing Ubuntu, install it from a cd/dvd/usb downloaded from the official Ubuntu site here.
  2. installing all the needed dependencies from official sources only, not recommended the PPA reposigories, neither!
  3. install yourself the “monerod” program (the official Monero software), which will create a Monero node and after network synchronization could be used to create a Monero node.

Three simple rules could almost eliminate leaking your private key to hackers, which in blockchain world means losing your money…
And before start the installation a performance advice do not attempt to run a Monero node in a hard disk –

USE SSD

If you use a hard disk even in RAID configuration it could take several days for network synchronization and probably your machine will be useless during the synchronization.

STEP 1) Install Ubuntu 16 – our howto will be available soon here.

STEP 2) Building from source a Monero node

Check out our howto “Building from source a Monero node under Ubuntu 16 LTS“.

STEP 3) Start the Monero node

if you have followed the howto in STEP 2) you probably have “monerod” installed in “~/monero/build/release/bin”, so run it with:

ubuntu@srv.local:~/monero/build/release/bin$ ./monerod &> ./monerod.log

It is a good practice to run it with screen and in an infinite loop – if the program crashes it will start automatically and you’ll always have a synchronized node, of course, if you do not need a Monero node running all the time the infinite loop is not needed. The user could just start the node, wait for synchronization and then make your transactions and stop the node, after several days you can start it up the catching up the synchronization won’t take much time:

ubuntu@srv.local:~$ screen -R monero
ubuntu@srv.local:~$ cd monero/build/release/bin
ubuntu@srv.local:~/monero/build/release/bin$ while true; do ./monerod &> ./monerod.log;done

STEP 3) Wait for the blockchain network synchronization

This step could take significant amount of time, server resources and network bandwidth! USE SSD(s) for your home directory, because the blockchain database will be saved at your

home directory/.bitmonero/

If you want to move it on another server or directory (or device) you must copy this directory to the new location.
The generated IO is so extensive that a traditional hard drive probably will not be able to catch up with the synchronization.
When you run “monerod” it will check the current state of the network and the current state of your Monero node, so no matter it is started for the first time or not a network synchronization is needed, your node need to be synchronized with the Monero network to be used for all kind of actions in the network (create a wallet, transfer funds and more).
Here is the output of just started Monero node:

2018-03-14 14:05:03.470     7fa0d08cb780        INFO    global  src/daemon/main.cpp:280 Monero 'Helium Hydra' (v0.11.1.0-master-a03d34f)
2018-03-14 14:05:03.470     7fa0d08cb780        INFO    global  src/daemon/protocol.h:53        Initializing cryptonote protocol...
2018-03-14 14:05:03.470     7fa0d08cb780        INFO    global  src/daemon/protocol.h:58        Cryptonote protocol initialized OK
2018-03-14 14:05:03.470     7fa0d08cb780        INFO    global  src/daemon/p2p.h:63     Initializing p2p server...
2018-03-14 14:05:07.725     7fa0d08cb780        INFO    global  src/daemon/p2p.h:68     P2p server initialized OK
2018-03-14 14:05:07.725     7fa0d08cb780        INFO    global  src/daemon/rpc.h:63     Initializing core RPC server...
2018-03-14 14:05:07.725     7fa0d08cb780        INFO    global  contrib/epee/include/net/http_server_impl_base.h:76     Binding on 127.0.0.1:18081
2018-03-14 14:05:07.725     7fa0d08cb780        INFO    global  src/daemon/rpc.h:69     core RPC server initialized OK on port: 18081
2018-03-14 14:05:07.725     7fa0d08cb780        INFO    global  src/daemon/core.h:86    Initializing core...
2018-03-14 14:05:07.725     7fa0d08cb780        INFO    global  src/cryptonote_core/cryptonote_core.cpp:426     Loading blockchain from folder /home/ubuntu/.bitmonero/lmdb ...
2018-03-14 14:05:07.726     7fa0d08cb780        WARN    blockchain.db.lmdb      src/blockchain_db/lmdb/db_lmdb.cpp:75   Error attempting to retrieve a hard fork version at height 0 from the db: MDB_NOTFOUND: No matching key/data pair found
2018-03-14 14:05:07.782     7fa0d08cb780        INFO    global  src/cryptonote_core/cryptonote_core.cpp:524     Loading checkpoints
2018-03-14 14:05:07.853     7fa0d08cb780        WARN    net.dns src/common/dns_utils.cpp:508    WARNING: no two valid MoneroPulse DNS checkpoint records were received
2018-03-14 14:05:07.853     7fa0d08cb780        INFO    global  src/daemon/core.h:92    Core initialized OK
2018-03-14 14:05:07.853     7fa0d08cb780        INFO    global  src/daemon/rpc.h:74     Starting core RPC server...
2018-03-14 14:05:07.853 [SRV_MAIN]      INFO    global  src/daemon/rpc.h:79     core RPC server started ok
2018-03-14 14:05:07.854 [SRV_MAIN]      INFO    global  src/daemon/p2p.h:78     Starting p2p net loop...
2018-03-14 14:05:08.854 [P2P1]  INFO    global  src/cryptonote_core/cryptonote_core.cpp:1380
**********************************************************************
The daemon will start synchronizing with the network. This may take a long time to complete.

You can set the level of process detailization through "set_log <level|categories>" command,
where <level> is between 0 (no details) and 4 (very verbose), or custom category based levels (eg, *:WARNING).

Use the "help" command to see the list of available commands.
Use "help <command>" to see a command's documentation.
**********************************************************************

2018-03-14 14:05:09.033 [P2P1]  WARN    net.dns src/common/dns_utils.cpp:508    WARNING: no two valid MoneroPulse DNS checkpoint records were received
2018-03-14 14:05:31.467 [P2P7]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:310     [201.243.239.81:18080 OUT] Sync data returned a new top block candidate: 1 -> 88194 [Your node is 88193 blocks (61 days) behind] 
SYNCHRONIZATION started
2018-03-14 14:05:31.603 [P2P2]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:310     [198.27.83.210:18080 OUT] Sync data returned a new top block candidate: 1 -> 1529571 [Your node is 1529570 blocks (1422 days) behind] 
SYNCHRONIZATION started
2018-03-14 14:05:31.945 [P2P9]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1167    [198.27.83.210:18080 OUT]  Synced 101/1529571
2018-03-14 14:05:32.099 [P2P1]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1167    [198.27.83.210:18080 OUT]  Synced 201/1529571
2018-03-14 14:05:32.235 [P2P2]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1167    [198.27.83.210:18080 OUT]  Synced 301/1529571
2018-03-14 14:05:32.373 [P2P1]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1167    [198.27.83.210:18080 OUT]  Synced 401/1529571
....
2018-03-14 17:29:28.313 [P2P6]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1167    [138.201.60.198:8180 OUT]  Synced 1373712/1529677
2018-03-14 17:29:30.436 [P2P7]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1167    [159.65.180.162:18080 OUT]  Synced 1373732/1529677
2018-03-14 17:29:30.476 [P2P7]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1167    [159.65.180.162:18080 OUT]  Synced 1373752/1529677
2018-03-14 17:29:30.521 [P2P7]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1167    [159.65.180.162:18080 OUT]  Synced 1373772/1529677
2018-03-14 17:29:30.568 [P2P7]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1167    [159.65.180.162:18080 OUT]  Synced 1373792/1529677
2018-03-14 17:29:31.172 [P2P4]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1167    [46.4.115.244:18080 OUT]  Synced 1373812/1529678
2018-03-14 17:29:31.230 [P2P4]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1167    [46.4.115.244:18080 OUT]  Synced 1373832/1529678
2018-03-14 17:29:31.294 [P2P4]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1167    [46.4.115.244:18080 OUT]  Synced 1373852/1529678
2018-03-14 17:29:33.491 [P2P1]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1167    [176.9.53.68:18080 OUT]  Synced 1373872/1529678
2018-03-14 17:29:33.528 [P2P1]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1167    [176.9.53.68:18080 OUT]  Synced 1373892/1529678
2018-03-14 17:29:33.610 [P2P1]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1167    [176.9.53.68:18080 OUT]  Synced 1373912/1529678
2018-03-14 17:29:35.340 [P2P3]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1167    [175.100.229.201:18080 OUT]  Synced 1373932/1529678
2018-03-14 17:29:35.470 [P2P3]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1167    [175.100.229.201:18080 OUT]  Synced 1373952/1529678
2018-03-14 17:29:35.510 [P2P3]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1167    [175.100.229.201:18080 OUT]  Synced 1373972/1529678
2018-03-14 17:29:35.545 [P2P3]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1167    [175.100.229.201:18080 OUT]  Synced 1373992/1529678
2018-03-14 17:29:35.597 [P2P3]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1167    [175.100.229.201:18080 OUT]  Synced 1374012/1529678
....
2018-03-15 01:39:27.558 [P2P7]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1167    [176.9.53.68:18080 OUT]  Synced 1529705/1529905
2018-03-15 01:39:30.650 [P2P7]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1167    [176.9.53.68:18080 OUT]  Synced 1529725/1529905
2018-03-15 01:39:35.917 [P2P7]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1167    [176.9.53.68:18080 OUT]  Synced 1529745/1529905
2018-03-15 01:39:38.774 [P2P7]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1167    [176.9.53.68:18080 OUT]  Synced 1529765/1529905
2018-03-15 01:39:41.596 [P2P7]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1167    [176.9.53.68:18080 OUT]  Synced 1529785/1529905
2018-03-15 01:39:45.872 [P2P7]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1167    [176.9.53.68:18080 OUT]  Synced 1529805/1529905
2018-03-15 01:39:49.150 [P2P7]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1167    [176.9.53.68:18080 OUT]  Synced 1529825/1529905
2018-03-15 01:39:52.294 [P2P7]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1167    [176.9.53.68:18080 OUT]  Synced 1529845/1529905
2018-03-15 01:39:54.072 [P2P7]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1167    [176.9.53.68:18080 OUT]  Synced 1529865/1529905
2018-03-15 01:39:58.084 [P2P7]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1167    [176.9.53.68:18080 OUT]  Synced 1529885/1529905
2018-03-15 01:39:59.552 [P2P7]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1167    [176.9.53.68:18080 OUT]  Synced 1529898/1529905
2018-03-15 01:40:01.494 [P2P7]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1167    [176.9.53.68:18080 OUT]  Synced 1529905/1529905
2018-03-15 01:40:03.368 [P2P2]  INFO    global  src/cryptonote_protocol/cryptonote_protocol_handler.inl:1579
**********************************************************************
You are now synchronized with the network. You may now start monero-wallet-cli.

Use the "help" command to see the list of available commands.
**********************************************************************

As you can see we redirected the output of the program in a file in the same directory as “monerod”. The default output is informative here is what we can see about the blockchain syncronization:

  • how many blockchains we are behind the Monero network – “Synced 101/1529571”
  • how many days we are behind the Monero network – “Your node is 1529570 blocks (1422 days) behind”

At present with SSD and 16G RAM on a intel i7 processor and a fast Internet connection 100Mbps the full synchronization took about 12 hours and 47G of storage space.
After a successful full synchronization, in the log you’ll have:

You are now synchronized with the network.

and you are ready to use “monero-wallet-cli” or the others program to manage your funds – for example send, receive, check balance of your funds.
If you stop and start the program it will start the synchronization from the point you stopped.

Leave a Reply

Your email address will not be published. Required fields are marked *