Skip to content

branciard/archipel

 
 

Repository files navigation

Archipel

stability-wip Website archipel.id License Twitter Follow

Welcome to Archipel monorepository!

What is Archipel ?

Archipel is a high availability solution for blockchain services.

Services Supported

  • Polkadot Validator Node

Why Archipel ?

Nowadays, many blockchain services are centralized on cloud infrastructure. For instance, around 70% of Ethereum nodes are in VPC and 63% of Ethereum Dapps use Infura Provider as this survey shows. We can imagine that in a few years some of blockchain services can be banned from public cloud providers.

The solution is to have a decentralized infrastructure at home. The problem is that it is challenging to maintain a good quality of service at home. You can have internet connection or power cuts. As a result, it is very unsafe to install a Proof-of-Stake validator at home. Your validator must be always up (24/7) and ready to execute its duty. If not, you will be slashed by the network and lose your money. To solve this problem, we are creating a solution to provide high availability for blockchain services. The first service that we target is Polkadot PoS Validator.

How it works ?

The idea behind Archipel is federating some nodes between friends and family. We are using DAppNode as the infrastructure layer for our solution. With DAppNode, you can launch a blockchain node (Bitcoin, Ethereum ...) or any P2P software. We would like to thank DAppNode Team for their amazing work. To achieve the high availability of services at a DAppNode, we are adding Archipel on top of it.

Archipel Components

Component Description
Chain Chain component is responsible for Archipel state synchronization between participants
Orchestrator Orchestrator is the decision-making component in Archipel federation
CLI CLI is a component that generates configuration and bootstraps an Archipel federation
UI UI is the Archipel chain state visualization component
Deployer Archipel End-To-End tests, build scripts and deploy tools
DAppNodePackage DAppNode package wrapping Archipel

Please refer to the README instructions in the sub-repositories for more information on building, using, and testing each software component.

To federate several nodes and have a shared state to elect a leader, we created a specific blockchain using the Substrate framework.

Substrate is a Parity framework that allows creating application-specific blockchains.

We created a Substrate runtime that collects all nodes metrics and sets federation leadership. This helps Archipel orchestrator to select the best leader appropriately in the federation. We call this specific blockchain the Archipel Substrate Chain or Archipel Chain.

All nodes inside a federation, run Archipel Chain. In the current implementation, an Archipel must be composed of at least 3 nodes. That means that to operate, you have to set up at least 3 nodes. Try to set up nodes in different locations.

The idea is that in the Archipel federation, all participants are trusted. They can be friends or family or other trusted social links. That allows us to have a fast chain consensus.

More information on chain/README.md

Orchestrator is the component that is responsible for decision making in an Archipel Federation.

External services modes

Archipel federation support only 3 nodes or 6 nodes.

  • Operator Role - the service will be launched in active mode if the node is elected or in passive mode in the others cases.
  • Sentry Role - the service will be launched in sentry mode and protect active and passive nodes from public exposition. In 3 nodes federation, all 3 nodes are operator. Passive nodes act as sentry nodes for the current validator on a 3 nodes federation. That means that at some point a validator node can be exposed if passive (sentry). To have a more secure setup use the 6 nodes federation config. In 6 nodes federation, sentry nodes never because passive and active nodes. And passive and active nods never become sentry nodes during the HA orchestration.

3 nodes federation roles

All 3 nodes are operator.

Node Role
archipel-node-1-{active or passive} operator
archipel-node-2-{active or passive} operator
archipel-node-3-{active or passive} operator

You must have the 3 operator nodes running to operate.

6 nodes federation roles

3 nodes (1,2,3) are operator. 3 nodes ( 4,5,6) are sentry.

Node Role
archipel-node-1-{active or passive} operator
archipel-node-2-{active or passive} operator
archipel-node-3-{active or passive} operator
archipel-node-4 sentry
archipel-node-5 sentry
archipel-node-6 sentry

You must have the 3 operator nodes running to operate and at least one sentry node up. 2 sentry nodes up is better. 3 sentry nodes up is safer.

Archipel Orchestrator Workflow

  • Launch external service in passive mode or sentry node according to node role
  • Send node metrics to Archipel Chain
  • Retrieve other nodes metrics from Archipel Chain
  • Retrieve current leader from Archipel Chain and determine its availability
  • If the current leader is alive, do nothing and ensure that the service was launched in passive mode
  • If the current leader is not alive, try to take its place by making a transaction to Archipel Chain
  • If the transaction succeeded, the current node becomes the current leader of the federation
  • Do supplementary checks (anyone other is alive, Archipel Chain Node has any peers...)
  • If supplementary checks pass launch external service in active mode

Archipel Orchestrator for HA Polkadot Validator Setup

The first service targeted by Archipel is Polkadot Validator.

The Polkadot node can be launched :

3 nodes federation

  • Active mode - Polkadot node in with validator option
  • Sentry-Passive mode - Polkadot node in the sentry mode for the current validator

6 nodes federation

  • Active mode - Polkadot node in with validator option
  • Passive mode - Polkadot node in the sync-only mode and with reserved peers only
  • Sentry mode - Polkadot node in the sentry mode for passive and active others nodes.

We are also planning to support other services.

More information on orchestrator/README.md

Archipel CLI is a component that generates configuration and bootstraps an Archipel federation.

More information on cli/README.md

The Archipel UI to administrate and visualize the federation state :

More information on ui/README.md

Archipel End-To-End tests, build scripts and deploy tools.

More information on deployer/README.md

DAppNode package wrapping Archipel stack.

It allows installing Archipel from the DAppNode interface in one click.

More information on DAppNodePackage-archipel/README.md

Keys Initialization doc

Testing doc

Deployment doc

Acknowledgements

The bootstrap development of Archipel is financed by WEB3 Foundation's grant program Wave4. Thanks a lot for support.

About

High availability for blockchain services

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 58.4%
  • Shell 20.6%
  • Rust 18.1%
  • Dockerfile 2.7%
  • HTML 0.2%