This tutorial shows how to set up a private Viction Testnet on a local machine. The purpose is to help developers to familiarise themselves with Viction's source code and initial setup.
As in this example, all nodes are running in the same machine, so the enode IP can be set to 127.0.0.1. From the above example: enode://7e59324b1e54f8c282719465eb96786fb3a04a0265deee2cdb0f62e912337ca6f118d0c91f7ebfae6f5c17825205279249cf7ff65ae54d0a1a8908ef16f80f63@127.0.0.1:30301
--networkid: our testnet network ID.
--identity: your full-node's name.
--rpc, --rpcaddr, --rpcport, --rpccorsdomain, --rpcvhosts: your full-node will accept RPC requests at 8545 TCP.
--ws, --wsaddr, --wsport, --wsorigins: your full-node will accept Websocket requests at 8546 TCP.
--synmode: blockchain sync mode ("fast", "full", or "light". More detail: https://github.com/BuildOnViction/Viction/blob/master/eth/downloader/modes.go#L24)
--gcmode: blockchain garbage collection mode ("full", "archive")
--port: your full-node's listening port (default to 30303)
--bootnode: bootnode information to help to discover other nodes in the network
--mine: your full-node wants to register to be a candidate for masternode selection.
--password: your account's password.
--datadir: path to your data directory created above.
--verbosity: log level from 1 to 5. Here we're using 4 for debug messages
To see all flags usage
tomo --help
Connect to other node manually
We'll try to let node2 to connect to node1.
Get node info
Connect to node1 ipc
tomo attach $HOME/node1/tomo.ipc
In the newly open prompt, run the following command:
admin.nodeInfo
As in the example, we can see enode information of node1. Copy this information for later use.
For example enode://89a5e91d30461641c4ede519c065b2f1e6d23a36d45e2d953e0ec9fa75e516517a0d4964489e07b73a7fa48e67d42fb2498ba46fe1a814c42ec0ad3257ced47a@[::]:10303
As in this example, all nodes are running in the same machine, so the enode IP can be set to 127.0.0.1. From the above example: enode://89a5e91d30461641c4ede519c065b2f1e6d23a36d45e2d953e0ec9fa75e516517a0d4964489e07b73a7fa48e67d42fb2498ba46fe1a814c42ec0ad3257ced47a@127.0.0.1:10303
Exit node1 ipc prompt by this command:
quit
Add peer for your node
Connect to node2 ipc
tomo attach $HOME/node2/tomo.ipc
In the newly open prompt, connect to other node by their enode (which we get from the previous step) using the following command: