Running Highway on a local Network using Docker

Video of the afternoon session:

Participants

  • @Medha Parlikar

  • @Ashok Ranadive (Unlicensed)

  • @Tom Vasile (Deactivated)

  • @Maciej Zielinski (Deactivated)

  • Thomas (LedgerLeap)

Goals

  • Use the Docker ‘hack’ to create a local network

  • Enable Highway Option and set Node parameters.

  • Start nodes. Stop nodes. Observe node catching up.

  • Restart with different round exponents. See the effect on DAG.

  • Observe effects - CLarity and Grafana.

  • Shutdown the network.

  • We will record the session.

Pre-Requisites

  1. Clone the repository on your machine

git clone https://github.com/CasperLabs/CasperLabs.git

2. Install docker and docker compose

docker: https://docs.docker.com/v17.09/engine/installation/
docker-compose: https://docs.docker.com/compose/install/

3. Pull the dev images from docker

docker pull casperlabs/node:dev docker pull casperlabs/execution-engine:dev

4. Export CL_VERSION to dev

export CL_VERSION=dev

5. Set up your Casperlabs network and Set Highway Environment variable

9. The default values for era length can be found in highway-env.sh

10. If for any reason you need to recreate all nodes, with none of them left to restore the state of the others, then the original era will likely have gone out of scope and the nodes will not produce blocks. Start them like so, to recreate the necessary genesis era epoch:

11. To create a Clarity instance run

Running make up will also start a local instance of Clarity at https://localhost:8443 where you can use the Faucet, visualize the DAG with the Explorer. The UI will connect to node-0, so that container needs to be running already.

12. To cleanup the network stopping and removing all containers run the command make clean.

Software Version (GitHash)

Docker tag: dev

What you need to know:

  • To simplify the process, we are deploying from the faucet account (we can skip funding an account to pay for the deployment)

 

Step by Step Plan

Title

Description

Notes

Title

Description

Notes

Verify pre-requisites

Check that everyone has managed to get through the setup.

See above

Set up a local 3 node network with ROUND_EXPONENT=14

Using the Docker hack, set up a local network

Start CLarity and Grafana

To remove old networks use:

Stop and restart one of the nodes with same ROUND_EXPONENT=14

Observe that the node catches on CLarity and Grafana

 

Stop and restart one of the nodes with same ROUND_EXPONENT=13

 

Orphaned blocks observed in the beginning but later the restarted node caught up and was in sync with other nodes.

Outcome:

  • Highway network of 3 nodes with CL_HIGHWAY_INIT_ROUND_EXPONENT=14 was successfully set up and run.

  • One of the nodes was shut down and started again without changing the ROUND_EXPONENT. The node caught up and successfully joined the network.

  • One of the nodes was shut down and started again by changing the ROUND_EXPONENT=13. The node caught up and successfully joined the network. We observed orphaned blocks early on when the node joined and was catching up. These orphaned blocks were not observed later.

Action items

For Help - go to Discord: https://discord.gg/mpZ9AYD

Decisions

  • File a bug for the orphaned block behavior observed on node restarting.