Support the Network

If you use Nano, you should consider running a full node to support the network. A full node possesses a copy of the distributed ledger that contains the transactions made on the Nano network. Other Nano users can connect to your node to download new blocks, but more importantly, if a conflicting block (fork) is ever introduced into the blockchain such as when a malicious user attempts to double-spend, your node will vote on the authentic copy of the blockchain based on which transaction it saw first.

The average user can already help by leaving the desktop wallet open on their computer whenever possible, but when their computer is shut down, a representative of their choice needs to be authorized to vote on their behalf. By default, the representative is set to one of the eight Official Representatives maintained by the Nano developers – which does not affect how you use Nano. However, to strengthen the network and make it more decentralized, it’s better to set your account’s representative to a node that belongs to you or somebody you trust.

You can be your own representative, by setting up a full node in the cloud that is always online. Once set up, simply set the representative of your desktop wallet to the Nano address of the representative account. The representative account can have a zero balance; its voting power devolves from the addresses (i.e. delegators) that have set it as representative. This means you can safely keep the key for the wallet which contains your precious Nano  on your own computer, not in the cloud.

Unlike other Proof of Stake coins, delegating a representative does not prevent you from spending your Nano. The representative has no access to your funds; it is only allowed to vote in case a discrepancy in the blockchain arises when your desktop wallet is offline.


Translations

Esta página, disponible en español.


Recommended Hosting for Nano Node

We suggest using DigitalOcean for your Nano node, as their plans are relatively inexpensive with plenty of bandwidth included. $5/month gets you 1 vCPU, 1 GB RAM, 25 GB Storage and 1 TB Transfer. Sign up using this link for a $10 credit. In case you want to opt for a different cloud provider such as one on LowEndTalk, here are the minimum specifications we recommend. Running a Nano node requires:

  • RAM – 512 MB or greater
  • Monthly Transfer – 1 TB/month or greater
  • Storage – Presently, the node takes up less than 5 GB of space but we suggest 20 GB as a minimum. SSD-based storage is highly recommended, as new blocks are being written to the storage medium constantly. When the blockchain becomes more lengthy in the future, it may be necessary to attach block storage.
  • Networking: IPv6 support

Other cloud providers you can consider to further decentralize the network include Linode (US based) or VPS.net (UK based).

Video Walkthrough of this Guide by /u/dagfar69

Setting up a Nano Node in a Docker Container

Dockerized Nano NodeIn this guide, we’ll set up a Nano node using the official Docker image. Docker is an app containerization technology which gathers all the dependencies of an application, making it easier to deploy new applications, and update existing ones.

  1. Provision a 1 GB DigitalOcean instance with the following options. For security, it’s preferable to generate a SSH key and provide the public key to DigitalOcean for authentication. Otherwise, a randomly generated root password will be sent to your email address on file.
    • OS: Ubuntu 16.04 x64
    • Options: IPv6
    • Datacenter: Any
  2. SSH into the instance as root@IP_address using the built-in terminal on Mac or Linux, or PuTTY for Windows. 
  3. Install Docker. Follow the “Install using the repository” steps on this Docker Docs page or use the quick install script at https://get.docker.com. Make sure Docker is configured to start on boot with the sudo systemctl enable docker command.
  4. Pull the Nano Node Docker image. sudo docker pull nanocurrency/nano:V15.2
  5. Start the Docker container with sudo docker run -d --restart unless-stopped -p 7075:7075/udp -p 7075:7075 -p [::1]:7076:7076 -v ~:/root nanocurrency/nano:V15.2
  6. Obtain the ID of the running Nano Node container using the sudo docker ps command. It should be something like 1983d5a95ee9. Substitute it where the following commands state <CONTAINER_ID>.
  7. Using a text editor, modify the "rpc_enable", "address", "enable_control" keys in the  ~/RaiBlocks/config.json file.
    • Launch the text editor: sudo nano ~/RaiBlocks/config.json
    • {
      "version": "2",
      "rpc_enable": "true",
      "rpc": {
      "address": "::ffff:0.0.0.0",
      "port": "7076",
      "enable_control": "true",
      "frontier_request_limit": "16384",
      "chain_request_limit": "16384"
      },
    • Important: For security reasons, do NOT use the configuration above outside of this guide if you are not running the Nano node within a Docker container. The -p [::1]:7076:7076 flag in the docker run command above keeps the RPC access forwarded only to the local host.
  8. Restart the Nano Node container.
    • sudo docker restart <CONTAINER_ID>
  9. Create the Nano representative wallet. 
    • sudo docker exec <CONTAINER_ID> rai_node --wallet_create
    • Output should look like AC2F9CE3F40D0E199E2F5A783101411F3583DE001C0E17E049BA2472C393D7C1 Substitute this in for <WALLET_ID> in the next step.
  10. Create the Nano node representative account (i.e. address).
    • sudo docker exec <CONTAINER_ID> rai_node --account_create --wallet=<WALLET_ID>
    • Output should look like xrb_1hhbtx34xo38tr489atju7h519ngra48s64ja8uznd51zp986j3h00000000 This will be the address you input when you “Change Representative” in the desktop client.
  11. Change the Nano representative in your desktop client (where you hold your coins).
    • Unlock the Nano wallet installed on your computer, and go to SettingsChange Representative. Input the address obtained in the previous step. The wallet will briefly calculate a Proof of Work, then you’ll see a Change block reflected in your account history.
  12. Check the progress of the initial sync of the node.
    • Once set up, your Nano node will immediately begin downloading a copy of the block lattice from other nodes on the network. You can check the current block height at https://nano.meltingice.net/explorer/ and compare it to the progress on your node using the following command:

      curl -g -d '{ "action": "block_count" }' '[::1]:7076'

    • Once synced, the "count" should be approximately equal to the overall block height of the network, with a minimal number (less than 500) of "unchecked" blocks. If you are experiencing problems getting the initial sync to complete, refer to the fast sync method for Linux nodes below. With node version 10.0 and above, using the fast sync method to manually sync should be rarely, if ever needed.

Viola! You’ve just set up your own representative for your Nano wallet, in the cloud. You can check that your brand-spanking-new node is doing its part to support Nano after one hour, on the Nanode representatives list. Please note that beginning with version 11, your uptime may not be reflected correctly on Nanode’s list if your representative possesses < 0.1% of voting weight globally. The reason for this is because Nano nodes version 11.0 or greater with < 0.1% of total supply delegated to them do not rebroadcast votes from other nodes, in order to reduce overall bandwidth usage. However, all votes including from small nodes are still counted when resolving forks on the Nano network. A more accurate way to track your uptime is by setting up Nano Node Monitor and Nano Node Ninja to monitor your representative node.

Thank you for helping decentralize the network!

If you found this guide useful, you can donate by sending Nano to: xrb_1afneznu193ae3pepa8aqkiuwfb4eyq7pe98z758c5j8w7wi897px853wifi


Stuck Syncing? Fast Sync Method for Linux Nodes

Backing Up and Restoring the Seed

A typical sync should take about 12 hours on a node with a datacenter connection backed by SSD storage. If your node is “stuck”, that is remained unsynced for an extended period of time, you should bootstrap it using the daily snapshots from Google Drive or Yandex.Disk.

  1. Download the latest snapshot named RaiBlocks_64_YYYY_MM_DD_HH.7z to your local desktop.
  2. On Mac OS X or Linux systems, use scp in the Terminal to transfer it to your remote Linux node. Windows users may use WinSCP, a graphical tool similar to an FTP client.
    • scp RaiBlocks_64_YYYY_MM_DD_HH.7z root@IP_address:~/RaiBlocks
  3. SSH back into your remote node. The steps onward will be performed on the remote node, not your local system.
    • ssh root@IP_address
  4. Important: Backup the seed for your Nano account. You will need this to restore your representative address.
    • sudo docker exec <CONTAINER_ID> rai_node --wallet_list
    • This is your current wallet ID. Substitute it where the following command states <WALLET_ID>.
    • sudo docker exec <CONTAINER_ID> rai_node --wallet_decrypt_unsafe --wallet=<WALLET_ID>
    • Record the seed shown, it will herein after be referred to as <SEED> in these instructions.
  5. Stop the Docker container for the Nano node.
    • sudo docker stop <CONTAINER_ID>
  6. Install the p7zip package for unzipping 7zip archives.
    • sudo apt-get install p7zip
  7. Extract the daily snapshot file to the Nano directory.
    • cd ~/RaiBlocks
    • p7zip -d ~/RaiBlocks/RaiBlocks_64_YYYY_MM_DD_HH.7z
    • When asked whether you’d like to replace the existing data.ldb file, type Y for ‘Yes’.
  8. When complete, start the Docker container back up.
    • sudo docker start <CONTAINER_ID>
  9. Now, restore your Nano account address using the seed you backed up earlier.
    • sudo docker exec <CONTAINER_ID> rai_node --wallet_create
    • This will generate a new wallet ID, different than before. Substitute it where the following commands state <NEW_WALLET_ID>.
    • sudo docker exec <CONTAINER_ID> rai_node --wallet_change_seed --wallet=<NEW_WALLET_ID> --key=<SEED>
    • sudo docker exec <CONTAINER_ID> rai_node --account_create --wallet=<NEW_WALLET_ID>
  10. If you see the representative address you had previously starting with “xrb” displayed on-screen, you’ve successfully recovered your representative node account using the seed.

Remember, your wallet ID will change but your public address (account) and seed should never change when you restore it. Try checking if your node is synced up again, paying attention to the number of blocks downloaded and unchecked blocks. You can also use this method to restore your representative account if you move your node to a different server.


Updating the Node

From time to time, new versions of the Nano node will be released necessitating an update. To determine the version you are currently running, type the following at the command line: curl -g -d '{ "action": "version" }' '[::1]:7076'. Then, ensure you have your seed backed up before attempting an update.

Each time a new, stable version of Nano is released, it will be pushed to Docker Hub with a tag in the format of “V??.?” where ??.? is the version number. First, check the latest version of Nano at nano.org, then find the corresponding Docker image at this page. To update an existing node, you first need to stop the running container sudo docker stop <OLD_CONTAINER_ID>, pull the new image, then recreate it using the same docker run command as when you first installed the node.

docker pull nanocurrency/nano:V??.?

sudo docker run -d --restart unless-stopped -p 7075:7075/udp -p 7075:7075 -p [::1]:7076:7076 -v ~:/root nanocurrency/nano:V??.?

If everything went smoothly, the node should start right back up with your existing keys and blockchain synced up. Verify using the sudo docker exec <NEW_CONTAINER_ID> rai_node --wallet_list command that the representative address is correct and curl -g -d '{ "action": "block_count" }' '[::1]:7076' that you are still up to date with the current block height.

Finally, you can delete the old container using sudo docker rm <OLD_CONTAINER_ID> to recoup some disk space. Remember, you can always get a complete list of running and stopped containers using the sudo docker ps -a command. Following this process, you can successfully update your Nano node to the latest version to ensure it remains compatible with the network.