How to set up a single Nano dev network node

Json (Joohansson)
4 min readJun 10, 2021

--

If you want to start developing on Nano and don’t want to use any of the Main, Beta or Test networks that are provided; there is a fourth hidden option. That is to run a single node development network that you can use just like any other Nano network with RPC and Websocket experiments. Your node will be the only representative and you will have access to the full 340,282,365.920938 fictive Nano.

Step 1: Start the network

You can download the latest Nano node or use a docker container. The only thing you need is to be able to configure a launch cli command and that is easiest done with a node executable (however also possible with docker and docker-compose).

./nano_node.exe --daemon --network dev --data_path=”F:/NanoTest/Nano”

This is a windows example that will start the node with the dev flag and store the node data in F:/NanoTest/Nano. Make sure this folder exist and don’t overwrite any existing node data you may be running!

You also need some basic config files. You can add them after the first run.

The config-rpc.toml should contain at least

enable_control = true

The config-node.toml should contain at least

enable_voting = true

If you changed the config, restart the node.

Step 2: Define a principle representative

Before you can send any blocks on the network it needs votes. For that, you can use your single node as the representative. In this simple demo case, you can use the Genesis account as a rep account by simply importing that into your local wallet as an ad-hoc account. For the following RPC commands, you can use curl or any POST method. In windows, I use Postman connected to 127.0.0.1:45000 where 45000 is the default RPC port. The block_count command should report count:1 as the network only contains the genesis block at this point.

Example of Postman command
  1. Create a new wallet (note the wallet ID that is returned)

{“action”:”wallet_create”}

2. Add the genesis account (replace xxx with the wallet ID). The key is the private key for the dev network genesis account found here.

{“action”:”wallet_add”,”wallet”:”xxx”,”key”:”34F0A37AAD20F4A260F0A5B3CB3D7FB50673212263E58A380BC10474BB039CE4"}

Your PR is now ready! It should respond with the genesis account.

Step 3: Connect Nault to the dev network

The easiest way to test the new network and send funds from the genesis account is to use Nault. Go to https://nault.cc (use an incognito tab to keep it separate if you already have a Nault wallet).

  1. Connect Nault to the network. Go to app settings -> server settings and enter the local network.

Press update and it should show “Block Count 1” and “Network dev”

You may also want to choose client-side GPU as pow source under the “Wallet Settings”. Depends on if your node allows local PoW or not.

2. Import the genesis account. Go to “configure new wallet” and “import private key”. Add this key:

34F0A37AAD20F4A260F0A5B3CB3D7FB50673212263E58A380BC10474BB039CE4

Set a password and you should now see the funds of 340M Nano.

3. Test a transaction. Go to the send screen and send 1 Nano to the genesis account. You will just send it to yourself. If successful it will look like this under account details.

Step 4: Start developing!

Congratulations! You now have your very own Nano network to do whatever you want with. You can generate new seeds and accounts and send funds to them from the genesis account. You can use RPC commands, hook up a websocket, develop a wallet, a tool, spam transactions like crazy or whatever. How to connect more reps to the network I don’t know.

Donation

Found this helpful? Consider a small donation or sponsor me on Github😉

nano_1gur37mt5cawjg5844bmpg8upo4hbgnbbuwcerdobqoeny4ewoqshowfakfo

--

--