This is a full guide to setting up a Ledgerium node on a fresh Linux machine. The blockchain ecosystem is a combination of multiple technologies that come together. The tech stacks range from (not limited to this list) GoLang, NodeJS, Ledgerium Wallet, Solidity and supporting Web3.js.
ledgerium_setup.sh
is a Unix bash file that downloads and deploys one Ledgerium node (consists of Geth, Tessera, and Governance docker containers) in a single click.
Run the following commands in the console.
//recommended steps\n mkdir ledgeriumcd ledgeriumgit clone https://github.com/ledgerium-io/ledgeriumsetup.gitcd ledgeriumsetup./install_dependencies.sh
This script does the following:
Install prerequisite software (Docker and NodeJS) to run ledgerium tools
Add $USER to the docker group, to avoid using sudo
before docker commands
Creates a docker network 'test_net'
sudo docker network create -d bridge --subnet 172.19.240.0/24 --gateway 172.19.240.1 test_net
Once the dependencies are installed, run the setup script.
./ledgerium_setup.sh
The setup script will pull ledgeriumtools GitHub repository, will execute npm install
and starts the setup process further.
Enter '0' for block producer
Enter '0' for 'toorak' or '1' for 'flinders' testnet block producer
Testnet specific ledgeriumnetwork
setup will be pulled from GitHub.
The script will look up for external IP Address, will ask for IP Address input. Enter if same IP Address is applicable
If the block producer node is to run under a domain name, enter next.
[block:code]
{
"codes": [
{
|***************** Running ledgerium tools application *****************|+----------------------------------------------------------------------+Select the type of node setup - full/blockproducer ('0' for 'blockproducer' and '1' for 'full')MODE:0+--------------------------------------------------------------------+|***************** Executing script for blockproducer mode ****************|Enter the testnet - toorak/flinders ('0' for 'toorak' and '1' for 'flinders')TESTNET:0|**************** Ledgerium network deosn't exist *******************||************ Cloning Ledgerium network from github *****************|+--------------------------------------------------------------------+Cloning into 'ledgeriumnetwork'...remote: Enumerating objects: 66, done.remote: Counting objects: 100% (66/66), done.remote: Compressing objects: 100% (53/53), done.remote: Total 87 (delta 20), reused 57 (delta 13), pack-reused 21Unpacking objects: 100% (87/87), done./home/ledgerappuser/ledgerium/ledgeriumtoolsYML file with blockproducer modeThere will only be one blockproducer per setup.Your public IP address is 20.188.233.239, if you want to change, provide it else ignore and hit Enter.Enter the IP address :If you have the domain name ready, provide it else ignore and hit Enter.Enter domain name :
Next, the script will ask for the block producer node name.
Enter validator name : validator-test
This script prompts the user for mnemonics seed for the Ledgerium node. The script creates a docker-compose file and brings up the containers.
A mnemonic phrase or mnemonic seed is a set of typically either 12 or 24 words taken from BIP 32 English Wordlist, which can be used to derive an infinite number of wallets. In the Ethereum ecosystem, mnemonic phrases are generally generated following the BIP 32 spec. The private key and the public key combination will be generated using the mnemonic seed. You can generate a new mnemonic seed if you install Ledgerium Wallet or even most of the other Ethereum based wallets.
The mnemonic seed needs to be saved safely. In case the private key is lost, it can be regenerated using mnemonic seed. Once the mnemonic seed is lost, it can't be regenerated or retrieved. Likewise, the private key needs to be saved safely and should not be shared with anyone.
Enter the mnemonic seed and password. To know the significance of password follow
Enter mnemonic : **************Enter password : **************
We can see if the setup ran correctly by going to Block Explorer. The newly added validator should be showing up in the list of active validators/block producers. Initially, the validator will synch with the network and download the entire public state of the blockchain and once ready, you can see the last block will be in synch with the rest of the network.
Please note that the newly added node will only be added as a peer or validator initially. If you want to join the Block Producer consortium, follow Ledgerium Governance
The Ledgerium node setup comes along with Governance application and you can access it at https:///governance.
A few Docker commands are useful for managing Ledgerium Docker container on your machine.
Once, you are inside file path ledgerium/ledgeriumtools/output
, run the below commands.
docker container ps -a //List all existing containers (running and not running).-- output below ---CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES47df5e135bbb ledgeriumengineering/governance_app_ui_img:v1.0 "/bin/sh -c 'set -u\n…" 42 seconds ago Up 31 seconds 0.0.0.0:3545->3003/tcp output_governance-ui-ubuntu-s-4vcpu-8gb-sgp1-test-01_1af992f1b6eae ledgeriumengineering/ledgeriumcore:blockrewards "/bin/sh -c 'while […" 43 seconds ago Up 41 seconds 0.0.0.0:8545->8545/tcp, 0.0.0.0:9000->9000/tcp, 0.0.0.0:30303->30303/tcp, 30303/udp output_validator-ubuntu-s-4vcpu-8gb-sgp1-test-01_11083ed5ececb ledgeriumengineering/tessera:v1.1 "/bin/sh -c 'DATE=`d…" 45 seconds ago Up 42 seconds 0.0.0.0:10000->10000/tcp, 0.0.0.0:10100->10100/tcp output_tessera-ubuntu-s-4vcpu-8gb-sgp1-test-01_1
docker-compose down //Stops containers and removes containers, networks, volumes-- output below ---ledgerappuser@ubuntu-s-4vcpu-8gb-sgp1-test-01:~/ledgerium/ledgeriumtools/output$ ddStopping output_governance-ui-ubuntu-s-4vcpu-8gb-sgp1-test-01_1 ... doneStopping output_validator-ubuntu-s-4vcpu-8gb-sgp1-test-01_1 ... doneStopping output_tessera-ubuntu-s-4vcpu-8gb-sgp1-test-01_1 ... doneRemoving output_governance-ui-ubuntu-s-4vcpu-8gb-sgp1-test-01_1 ... doneRemoving output_validator-ubuntu-s-4vcpu-8gb-sgp1-test-01_1 ... doneRemoving output_tessera-ubuntu-s-4vcpu-8gb-sgp1-test-01_1 ... doneNetwork test_net is external, skipping
$ cd \~/ledgerium/ledgeriumtools/output$ docker-compose up -dCreating output_tessera-ubuntu-s-4vcpu-8gb-sgp1-test-01_1 ... doneCreating output_validator-ubuntu-s-4vcpu-8gb-sgp1-test-01_1 ... doneCreating output_governance-ui-ubuntu-s-4vcpu-8gb-sgp1-test-01_1 ... done
A generated docker-compose file will consist of 3 image containers per Ledgerium node. These are as follows:
Ledgerium Core
Purpose: This is the actual Ledgerium node, implementing Ledgerium Protocol
Following open ports are required to synch with its peers of Blockchain network:
30303 Network listening port
8545 HTTP-RPC server listening port
9000 WS-RPC server listening port
Each node of Ledgerium Blockchain is configured with following commands in its setup file docker-compose.yml
.
Geth Commands
geth --datadir '/eth' --networkid 2019 --identity "validator-0" --rpc --rpcaddr '0.0.0.0' --rpcport 8545 --rpccorsdomain '*' --rpcapi 'db,eth,net,web3,istanbul,personal,admin,debug,txpool' --rpcvhosts=localhost --ws --wsorigins '' --wsapi 'db,eth,net,web3,personal,admin,debug,txpool' --wsaddr '0.0.0.0' --wsport 9000 --mine --minerthreads 1 --syncmode 'full' --targetgaslimit 9007199254740000 --port "30303" --debug --metrics --txpool.nolocals --txpool.accountslots 128 --txpool.globalslots 32768 --txpool.accountqueue 512 --txpool.globalqueue 8192 --nodekeyhex "83a5803e698a3642d5309f119643f6a729c7c51fac00fdffac31983cb5275bb5" --etherbase "f232a4bf183cf17d09bea23e19ceff58ad9dbfed" --ethstats "validator-0:bb98a0b6442334d0cdf8a31b267892c1@toorak.ledgerium.io/stats" --verbosity 6 *--emitcheckpoints //If enabled, emit specially formatted logging checkpoints e.g. QUORUM-CHECKPOINT
Tessera
Purpose: Quorum Transaction Manager - implementation of peer-to-peer encrypted message exchange for transaction privacy
Following open ports are to accet private transactions:
10000
10100
Governance
Purpose: Governance App contains smart contracts to manage admin and individual validators to come on the platform
Ports required:
3545
Refer Ledgerium Governance.