DAppNode Package HABS

November 24, 2022 ยท View on GitHub

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

VariableDescriptionValues
CONFIG_FILETry to load configuration from configuration archive or not.boolean
CONFIG_FILE_PASSWORDConfiguration archive can be protected by a password.string
NODE_IDEvery configuration archive contains configuration of multiple nodes.
You must select node number.
integer

Without config file

VariableDescriptionValues
NODE_ROLEcan be operator , sentry or externalSentryString
NODE_GROUPSeveral groups with one leader on each group can be created. Here to configure the group name for the UIString
NODE_GROUP_IDSeveral groups with one leader on each group can be created. Here to affect the group id for launched the nodeInteger
WIREGUARD_PRIVATE_KEYWireguard private key. More details in HABS Wireguard Keys InitializationString
WIREGUARD_PEERS_PUB_ADDRWireguard public key. More details in HABS Wireguard Keys InitializationString
WIREGUARD_ADDRESSWireguard address in the wireguard private network. More details in HABS Wireguard Keys Initialization10.0.1.n/32
WIREGUARD_LISTEN_PORTPort UDP of the private network. More details in HABS Wireguard Keys Initialization51820
WIREGUARD_PEERS_ALLOWED_IPall peers address in the private network separate by ,. More details in HABS Wireguard Keys Initialization10.0.1.1/32,10.0.1.2/32,10.0.1.3/32
WIREGUARD_PEERS_EXTERNAL_ADDRall public IP address of peers separate by ,. More details in HABS Wireguard Keys InitializationPUBLIC_IP_1,PUBLIC_IP_2,PUBLIC_IP_3
ARCHIPEL_NODE_ALIASNode name for the HABS Substrate node within the federation.
Example
Archipel-yourFederationName-NodeNameHere
String
ARCHIPEL_LISTEN_PORTHABS Substrate listen port30334
ARCHIPEL_NODE_KEY_FILEBinary 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_SEEDmnemonic
ARCHIPEL_RESERVED_PEERSvalorize --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_LISTValorize 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_LISTValorize 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_URLOptional 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_LOGLEVELOptional HABS_TELEMETRY_LOGLEVEL for HABS substrate node. Example 0 or 1integer
ARCHIPEL_SERVICE_MODEorchestrator 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_ENABLEactivate or desactivate orchestrator deamonboolean
ARCHIPEL_HEARTBEATS_ENABLEactivate or desactivate heartbeat transaction propagation deamonboolean
SMS_STONITH_ACTIVESMS STONITH option active or notboolean
SMS_STONITH_CALLBACK_MANDATORYCallback mandatory or not to become leaderboolean
NEXMO_API_KEYNeeded for nexmo apiString
NEXMO_API_SECRETcan be operator , sentry or externalSentryString
NEXMO_API_SIGNATURE_METHODNeeded if signature check activeString
NEXMO_API_SIGNATURE_SECRETNeeded if signature check activeString
NEXMO_API_CHECK_MSG_SIGNATUREif true check the signature from nexmo servip in webook responseboolean
NEXMO_PHONE_NUMBERVirtual number from nexmo service to send sms and received callback sms. List separated by ,String
OUTLET_PHONE_NUMBER_LISToutlet sim carde phone number to stop, start restart the outlet. List separated by ,String
SERVICESExternal service you want to launch. Only support polkadot at the moment.polkadot
POLKADOT_NAMENode 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_IMAGEPolkadot docker image version to use.parity/polkadot:latest
POLKADOT_PREFIXThis prefix is used to mount the docker volume for blockchain state on the server.String
POLKADOT_KEY_GRAN12 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_BABE12 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_IMON12 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_PARA12 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_AUDI12 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_FILEBinary 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_NODESvalorize --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_URLOptional 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_VPNUse wireguard network for Polkadottrue
POLKADOT_SIMULATE_SYNCHUse for testing purpuse to not wait Kusama to be synch to test active/passive switchesfalse
POLKADOT_ADDITIONAL_OPTIONSall 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