Running a local Network using Docker

Video of the afternoon session: https://youtu.be/yhkGWWO_I7k

Participants

 

  • @Medha Parlikar

  • @Ashok Ranadive (Unlicensed)

  • @Rita Allen (Unlicensed)

  • @Former user (Deleted)

  • @Former user (Deleted)

  • @Former user (Deleted)

  • @Maciej Zielinski (Deactivated)

  • Thomas (LedgerLeap)

  • Charles (LedgerLeap)

 

Goals

  • Using the Docker ‘hack’ - create a local network.

  • Install the client on their local machine

  • Compile the contracts - we will deploy counter-define and then counter-call

  • Deploy to your local network

  • Observe effects

  • 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. Ensure that your Docker Compose is up to date

6. Set up your Casperlabs network

8. Bring the bootstrap up

9. Now you can make more nodes.

10. To create a Clarity instance run

Install the CasperLabs Client:


Update: due to version mismatches please either build the client or use the tarball.

6. Compile the contracts

Navigate to the execution-engine folder to build the example smart contracts.

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

Using the Docker hack, set up a local network

To remove old networks use:

Deploy counter-define

Propose a block

Deploy counter-call

Propose a block

Here we will deploy a contract to the local network to install it. Then we will call the contract using a separate transaction.

Counter Define deployment & Proposal

 

Counter Call deployment

 

  • Keep track of the number of times counter-call is executed so we can verify the output of the query later.

 

Propose a block

Call the client to propose a block

Same as above.

Obtain the block hash

Obtain the block hash for use in the state query

Call the client to get the block hash (can also tail the logs and see the block in the network)

Perform a state query

Using the gRPC

Outcome:

  • The export needs to happen again if a new terminal is opened.

  • Make sure that you don’t have any old Docker containers floating around from old nodes.

  • Do not make a mistake when creating node-0 (Medha did node-o and it was problematic)

  • To add CLarity and GraphQL to the Docker network run:

It won’t be possible to fund accounts using CLarity, but it is possible to observe what the deploy errors are.

  • We ran into problems with payment. Root cause - there IS a version difference with the client that matters. This will be resolved when Node 0.10 releases. In the meantime, grab the tarball or build the client from dev.

Action items

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

Decisions

  •