Multi Node
Pre-requisite Readings
Automated Localnet with Starport
Once you have installed starport, just run the localnet by using
starport chain serve --reset-once -v -c ./starport.ymlAutomated Localnet with Docker
Build & Start
To build start a 4 node testnet run:
make localnet-startThis command creates a 4-node network using the uptickdnode Docker image. The ports for each node are found in this table:
upticknode0
26656
26657
8545
8546
upticknode1
26659
26660
8547
8548
upticknode2
26661
26662
8549
8550
upticknode3
26663
26664
8551
8552
To update the binary, just rebuild it and restart the nodes
The command above command will run containers in the background using Docker compose. You will see the network being created:
Stop Localnet
Once you are done, execute:
Configuration
The make localnet-start creates files for a 4-node testnet in ./build by calling the uptickd testnet command. This outputs a handful of files in the ./build directory:
Each ./build/nodeN directory is mounted to the /uptickd directory in each container.
Logging
In order to see the logs of a particular node you can use the following command:
The logs for the daemon will look like:
Whereas the logs for the REST & RPC server would look like:
Follow Logs
You can also watch logs as they are produced via Docker with the --follow (-f) flag, for example:
Interact with the Localnet
Ethereum JSON-RPC & Websocket Ports
To interact with the testnet via WebSockets or RPC/API, you will send your request to the corresponding ports:
8545
8546
You can send a curl command such as:
Additional instructions on how to interact with the WebSocket can be found on the events documentation.
Keys & Accounts
To interact with uptickd and start querying state or creating txs, you use the uptickd directory of any given node as your home, for example:
Now that accounts exists, you may create new accounts and send those accounts funds!
Special Binaries
If you have multiple binaries with different names, you can specify which one to run with the BINARY environment variable. The path of the binary is relative to the attached volume. For example:
Last updated