Archipel Federation Testing

August 14, 2020 ยท View on GitHub

Requirements

Step 1: Bootstrap a federation of 4 nodes

What will be launched:

  • 4 Archipel nodes (Archipel Substrate Validator Node + Orchestrator)

  • 4 Polkadot KUSAMA Nodes

    • 1 Validator Node
    • 2 Passive Nodes
    • 1 Sentry node
  • Archipel UI instance

Connection between Archipel nodes and Polkadot KUSAMA nodes are secured by WireGuard VPN!

1.1 Clone Archipel Repository

git clone https://github.com/luguslabs/archipel.git

1.2 Launch federation

cd archipel/deployer/test
./launch.sh

Step 2: Check if federation was launched

2.1 Check Archipel UI

The execution of launch.sh script will generate the URL for Archipel UI.

Archipel UI will be available at http://172.28.42.6/ on container and http://localhost:3000 on host.

Archipel UI will show you the full state of the Archipel Federation.

It also gives you ability to manipulate orchestrator:

  • disable/enable orchestration
  • disable/enable heartbeats send
  • stop/start service container

If you don't see any heartbeats or master elected, please wait a little bit!

By default the Archipel UI uses Archipel Node 1 API endpoint. You can change API endpoint in order to see other nodes state.

NodeAPI Endpoint ContainerAPI Endpoint on host
Node 1http://172.28.42.2:3000http://localhost:3001
Node 2http://172.28.42.3:3000http://localhost:3002
Node 3http://172.28.42.4:3000http://localhost:3003
Node 3http://172.28.42.5:3000http://localhost:3004

Example

2.2 Check containers launched

docker ps

You must see multiple containers launched:

  • 4 Archipel nodes: archipel1, archipel2, archipel3, archipel4
  • Archipel UI: archipel-ui
  • 4 Polkadot KUSAMA nodes
    • 1 Validator Node: node1-polkadot-validator
    • 2 Passives Nodes: node2-polkadot-sync, node3-polkadot-sync
    • 1 Sentry Nodes: node4-polkadot-sentry

2.3 Check Polkadot Kusama Telemetry

https://telemetry.polkadot.io/#/Kusama

  • You must see 4 archipel nodes running
    • test-archipel-node-active
    • test-archipel-node-2-passive
    • test-archipel-node-3-passive
    • test-archipel-node-4-sentry
  • Active node = Validator Node
  • Passive node = Full node ready to backup the validator Node in clase of failure

  • Here node 1 was elected as leader, so it is active = launched as Validator
  • Nodes 2 and 3 are in passive mode

Step 3: Simulating active node failure

3.1 Stop active node

./stop-archipel.sh {node_number}
  • Here you must choose the active node number

Example

If Node 1 is active:

./stop-archipel.sh 1
  • Stop node script will stop the Archipel Node.

3.2 Check if the active node was stopped

docker ps

3.3 Wait for Archipel Orchestration

Wait 15 blocks for Archipel Orchestration (Generally takes about 2 minutes)

3.4 Track orchestration

Archipel UI

Archipel UI http://172.28.42.6/ available at: http://localhost:3000/

The Node 1 API endpoint is not available cause we stopped it. So you must change the API endpoint. You can use Node 2 API : http://172.28.42.3:3000 at http://localhost:3002

Telemetry

You must still see test-archipel-node-active ( but only 3 nodes test-archipel-node* instead of 4).

https://telemetry.polkadot.io/#/Kusama

docker ps

  • Node 1 was stopped in step 3.1
  • After orchestration, the new leader was elected (Node 2)
  • The node 2 was relaunched in active mode (Validator)

Step 4: Relaunch node

4.1 Relaunch old active node

./restart-archipel.sh {node_number}
  • Here you must choose the node number

Example

Node 1 was active and was stopped so restarting it

./restart-archipel.sh 1

4.2 Track old active node state

Docker

docker ps

Telemetry

The old active node was restarted in passive mode.

Step 5: Remove all launched containers and created folders

./remove.sh
  • removes all containers launched by test scripts and all directories created by containers

Play: Feel free to play with Archipel!