Deployment: Start a Multinode Network
PBFT Multinode Network
With a PBFT multinode network, you will need to pass the NODE_HOST and BOOT_NODE_IP variables to the
./strato command, but you will need to also pass additional variables and a flag to designate the PBFT consensus mechanism ("blockstanbul"). A sample copy of this script can be seen by running
./strato --scriptgen, which will output something like this:
#!/usr/bin/env sh # Address: <address> # IP: <ip_address> NODE_HOST="<host-name>" \ BOOT_NODE_IP="<boot-node-ip-address>" \ blockstanbulPrivateKey="<this-nodes-private-key>" \ validators='["<validator-for-node-1>","validator-for-node-2",....]'\ ./strato --blockstanbul
Each node on a PBFT network will have it's own private key and address that will be used in the script (in blockstanbulPrivateKey and the validators list, respectively). The blockstanbulPrivateKey variable will only be the value for the node you are running the script on. The list of validators will be an array with values for each participating node on the network. For STRATO 4.4 and above, an additional list of BlockstanbulAdmins will be needed in the script, but will contain the same array of values as the validators list contains. Finally, you'll notice the
--blockstanbul flag after the
strato command, which is used to designate the PBFT network.
Generate Private Validators and Scripts for Nodes
In some cases, you may want to create multinode scripts in a dynamic or programmatic way. In order to do this, you can follow the following steps:
Clone or copy the Strato repository onto each of the machines you are using for your multinode network.
On the first machine, create a JSON file with the list of your node addresses and information. The file should be in the following format:
Generate node scripts for your nodes by running
./strato --keygen=Nwhere "N' represents the number of nodes in your network. In our example, we'd use
Copy your node scripts for your nodes onto their various machines. You can do this manually, but we find that using the secure copy (
scp) command in Linux/Unix environments is more convenient. You can search the web for more formatting examples, but the general format for your
scpcommand will be:
scp [options] <your_current_username>@<current_host_address>:<current_script_file_path> <your_username_on_other_machine>@<target_destination_host_address>:<target_destination_file_path>
Connect Your Nodes
SSH into the machine you are using as your boot_node (for a hub) or you starting_node (for a chain formation). Run your startup script on that node using
sh run.sh. Then SSH into each subsequent machine and run the startup script on each machine the same way, using
If you are using a PBFT algorithm, you can confirm your nodes are connected by navigating to the dashboard, creating an account and fauceting the account. This will create a transaction that will be sent through the network and engage the consensus mechanism. On the STRATO dashboard, you should notice that there are the correct number of peers identified. Additionally, you should be able to navigate to the dashboards for each node and verify that the block number is the same for the nodes in the chain.
If you are connecting your multinode network with existing scripts, you may want to ensure that the appropriate script is located on each machine that will be connected in the network. You can do this by validating that the IP address of the NODE_HOST variable in the script matches the IP address of the machine you are using. If you have access to the private key/address information for each node, you may also want to confirm that the private keys are each unique to the node, that the validator for that node is listed in the array of validators, and that all the validators in the list are associated with one of the nodes on the network.
Once you have verified the variables needed, you should follow the instructions for
Connecting Your Nodes in the Generated Network Section Above.
Modifying Blockstanbul Variables