Skip to content

luguslabs/DAppNodePackage-habs

Repository files navigation

DAppNode Package HABS

stability-wip License Website luguslabs.com Documentation Readme Twitter Follow

Dappnode package responsible for providing the HABS service.

It is an AragonApp whose repo is deployed at this address: 0x9f85ae5aefe4a3eff39d9a44212aae21dd15079a and whose ENS address is: archipel.public.dappnode.eth . Not Updated because gaz price too high. To deploy the DAppNode Package, when connected to the DAppNode Wifi or VPN to a DAppNode instance launch :

$ dappnodesdk build

Then click on the DAppNode IPFS link to install it.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

  • git

    Install git commandline tool.

  • docker

    Install docker. The community edition (docker-ce) will work. In Linux make sure you grant permissions to the current user to use docker by adding current user to docker group, sudo usermod -aG docker $USER. Once you update the users group, exit from the current terminal and open a new one to make effect.

  • docker-compose

    Install docker-compose

Note: Make sure you can run git, docker ps, docker-compose without any issue and without sudo command.

Building

$ git clone https://github.com/luguslabs/DAppNodePackage-HABS
$ docker-compose build
or
$ docker build --rm -f build/Dockerfile -t dnp_archipel:dev build

Configuration env parameters needed

Environment Variables

With config file

The ZIP config file can be generate with HABS CLI

Variable Description Values
CONFIG_FILE Try to load configuration from configuration archive or not. boolean
CONFIG_FILE_PASSWORD Configuration archive can be protected by a password. string
NODE_ID Every configuration archive contains configuration of multiple nodes.
You must select node number.
integer

Without config file

Variable Description Values
NODE_ROLE can be operator , sentry or externalSentry String
NODE_GROUP Several groups with one leader on each group can be created. Here to configure the group name for the UI String
NODE_GROUP_ID Several groups with one leader on each group can be created. Here to affect the group id for launched the node Integer
WIREGUARD_PRIVATE_KEY Wireguard private key. More details in HABS Wireguard Keys Initialization String
WIREGUARD_PEERS_PUB_ADDR Wireguard public key. More details in HABS Wireguard Keys Initialization String
WIREGUARD_ADDRESS Wireguard address in the wireguard private network. More details in HABS Wireguard Keys Initialization 10.0.1.n/32
WIREGUARD_LISTEN_PORT Port UDP of the private network. More details in HABS Wireguard Keys Initialization 51820
WIREGUARD_PEERS_ALLOWED_IP all peers address in the private network separate by ,. More details in HABS Wireguard Keys Initialization 10.0.1.1/32,10.0.1.2/32,10.0.1.3/32
WIREGUARD_PEERS_EXTERNAL_ADDR all public IP address of peers separate by ,. More details in HABS Wireguard Keys Initialization PUBLIC_IP_1,PUBLIC_IP_2,PUBLIC_IP_3
ARCHIPEL_NODE_ALIAS Node name for the HABS Substrate node within the federation.
Example
Archipel-yourFederationName-NodeNameHere
String
ARCHIPEL_LISTEN_PORT HABS Substrate listen port 30334
ARCHIPEL_NODE_KEY_FILE Binary node key file name that must be present in container volume /config/ARCHIPEL_NODE_KEY_FILE. Value is used then with Substrate option --node-key-file.
Note that bin file is generate with subkey generate-node-key
String
ARCHIPEL_KEY_SEED mnemonic
ARCHIPEL_RESERVED_PEERS valorize --reserved-nodes substrate option. Note that HABS substrate is also launch with --reserved-only option.
Example :
/ip4/WIREGUARD_ADDRESS_1/tcp/ARCHIPEL_LISTEN_PORT/p2p/NODE_PEER_ID_1,/ip4/WIREGUARD_ADDRESS_2/tcp/ARCHIPEL_LISTEN_PORT/p2p/NODE_PEER_ID_2,/ip4/WIREGUARD_ADDRESS_3/tcp/ARCHIPEL_LISTEN_PORT/p2p/NODE_PEER_ID_3
String
ARCHIPEL_AUTHORITIES_SR25519_LIST Valorize the Genesis Spec file for Archipel chain with the list of Authorities Public Keys in SR25519 format separated by "," char.
<SR25519 Public Key Node 1>,<SR25519 Public Key Node 2>,<SR25519 Public Key Node 3>
Public Key, Public Key, Public Key
ARCHIPEL_AUTHORITIES_ED25519_LIST Valorize the Genesis Spec file for Archipel chain with the list of Authorities Public Keys in ED25519 format separated by "," char.
<ED25519 Public Key Node 1>,<ED25519 Public Key Node 2>,<ED25519 Public Key Node 3>
Public Key, Public Key, Public Key
ARCHIPEL_TELEMETRY_URL Optional TELEMETRY_URL for HABS substrate node. Example : ws://BACKEND_PUBLIC_IP:8000/submit. No Log level number must be set after URL. Cannot be an url list.` empty or 'URL' or--no-telemetry
ARCHIPEL_TELEMETRY_LOGLEVEL Optional HABS_TELEMETRY_LOGLEVEL for HABS substrate node. Example 0 or 1 integer
ARCHIPEL_SERVICE_MODE orchestrator mode will decide automatically to start in active or passive mode ( default mode ). You can also force mode active passive or sentry but be aware that if others node are in orchestrator mode. It may leads to 2 activate nodes... Be carfull when you force state. First force all your node to passive node is safer. `orchestrator
ARCHIPEL_ORCHESTRATION_ENABLE activate or desactivate orchestrator deamon boolean
ARCHIPEL_HEARTBEATS_ENABLE activate or desactivate heartbeat transaction propagation deamon boolean
SMS_STONITH_ACTIVE SMS STONITH option active or not boolean
SMS_STONITH_CALLBACK_MANDATORY Callback mandatory or not to become leader boolean
NEXMO_API_KEY Needed for nexmo api String
NEXMO_API_SECRET can be operator , sentry or externalSentry String
NEXMO_API_SIGNATURE_METHOD Needed if signature check active String
NEXMO_API_SIGNATURE_SECRET Needed if signature check active String
NEXMO_API_CHECK_MSG_SIGNATURE if true check the signature from nexmo servip in webook response boolean
NEXMO_PHONE_NUMBER Virtual number from nexmo service to send sms and received callback sms. List separated by , String
OUTLET_PHONE_NUMBER_LIST outlet sim carde phone number to stop, start restart the outlet. List separated by , String
SERVICES External service you want to launch. Only support polkadot at the moment. polkadot
POLKADOT_NAME Node name for the polkadot node. Will be visible in Polkadot telemetry URL. This Node Name will a a -passive or -active suffix according to the current mode.
Example
Archipel-yourFederationName-NodeNameHere
String
POLKADOT_IMAGE Polkadot docker image version to use. parity/polkadot:latest
POLKADOT_PREFIX This prefix is used to mount the docker volume for blockchain state on the server. String
POLKADOT_KEY_GRAN 12 words mnemonic.
Polkadot Sessions keys needed to operate as validator.
Gran keyType, Granpa ed25519.
Use for consensus.
More details for sessions keys
mnemonic
POLKADOT_KEY_BABE 12 words mnemonic.
Polkadot Sessions keys needed to operate as validator.
Babe keyType, Babe sr25519.
Use for consensus/block production.
More details for sessions keys
mnemonic
POLKADOT_KEY_IMON 12 words mnemonic.
Polkadot Sessions keys needed to operate as validator.
IMON keyType, IamOnline key.
Use for heartbeat/block production.
More details for sessions keys
mnemonic
POLKADOT_KEY_PARA 12 words mnemonic.
Polkadot Sessions keys needed to operate as validator.
PARA keyType. sr25519.
Use for parachain production.
More details for sessions keys
mnemonic
POLKADOT_KEY_AUDI 12 words mnemonic.
Polkadot Sessions keys needed to operate as validator.
AUDI keyType. sr25519.
Use for Audit.
More details for sessions keys
mnemonic
POLKADOT_NODE_KEY_FILE Binary node key file name that must be present in container volume /config/POLKADOT_NODE_KEY_FILE.
Will be then present in polkdaot container in folder /polkadot/keys/.
Value is used then with Polkadot option --node-key-file.
Note that bin file is generate with subkey generate-node-key
String
POLKADOT_RESERVED_NODES valorize --reserved-nodes substrate option.
Note that polkadot is also launch with --reserved-only for validator ( active ) mode.
Example :
/ip4/WIREGUARD_ADDRESS_1/tcp/30333/p2p/POLKADOT_NODE_PEER_ID_1,/ip4/WIREGUARD_ADDRESS_2/tcp/30333/p2p/POLKADOT_NODE_PEER_ID_2,/ip4/WIREGUARD_ADDRESS_3/tcp/30333/p2p/POLKADOT_NODE_PEER_ID_3
String
POLKADOT_TELEMETRY_URL Optional TELEMETRY_URL for Polkadot Node. Example : ws://BACKEND_PUBLIC_IP:8000/submit 0. Log level number must be set after URL. Can be an url list separated by , empty or 'URL1 0,URL2 0' or --no-telemetry
POLKADOT_LAUNCH_IN_VPN Use wireguard network for Polkadot true
POLKADOT_SIMULATE_SYNCH Use for testing purpuse to not wait Kusama to be synch to test active/passive switches false
POLKADOT_ADDITIONAL_OPTIONS all others polkadot commands can be set in this env varibale separated with a space --option1 value1 --options2 value2

Running

Start

$ docker-compose up -d

Stop

$ docker-compose down

Status

$ docker-compose ps

Logs

$ docker-compose logs -f

Note: There is a time drift issue on Docker for Mac, to solve it try running Fixing Time drift issue on Docker for Mac:

$ docker run --rm --privileged alpine hwclock -s

Generating a tar.xz image

xz is required

$ docker save dnp_archipel:dev | xz -e9vT0 > dnp_archipel_dev.tar.xz

You can download the latest tar.xz version from here releases.

Loading a Docker image

$docker load -i dnp_archipel_dev.tar.xz

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

  • Vladimir Ostapenco - Initial work - vladostp
  • Francois Branciard - Initial work - branciard

See also the list of contributors who participated in this project.

License

This project is licensed under Apache 2 - see the LICENSE file for details

References

git

docker

docker-compose

DappNode

Acknowledgements