-
Notifications
You must be signed in to change notification settings - Fork 21
Installation Guide
The purpose of this guide is to help BrightID users install and run a new BrightID-Node.
- 1 processor core
- 2GB RAM
- 10GB free storage space for pulling docker images and creating database volume
wget https://github.com/BrightID/BrightID-Node/archive/docker.tar.gztar -xvf docker.tar.gz
cd BrightID-Node-dockernano config.envBN_WS_IP is the node's public IP and will be automatically retrieved from an online service if left blank.
When running a local node for testing purpose, BN_WS_IP should be set to local ip address which can be found by running $ hostname -I | awk '{print $1}' in console.
BN_CONSENSUS_PRIVATE_KEY is the private key for an ethereum address. An easy way to create an ethereum address and retrieve its private key is through the Vanity-ETH web interface. Make sure the address has enough Eidi (IDChain native token) for gas to write operations to IDChain. Eidi tokens can be freely claimed from this faucet.
When running a local node for testing purpose, you need the address to have Eidi only if you want to connect a mobile client to your test node and send operations to test network.
BN_WS_PUBLIC_KEY and BN_WS_PRIVATE_KEY are an EdDSA keypair used to sign verifications. There are several ways to generate an EdDSA key pair. An easy way is to use the random button on the TweetNaCl.js sign test interface.
BN_WS_ETH_PRIVATE_KEY is the private key for an Ethereum address that is used to sign verifications for ethereum smart contracts. An easy way to create an ethereum address and retrieve its private key is through the Vanity-ETH web interface.
BN_UPDATER_SP_INFURA_URL is an infura API url and should be set to wss://mainnet.infura.io/ws/v3/{INFURA_PROJECT_ID} where INFURA_PROJECT_ID is an Infura ethereum project id. If you create an Infura account, and an Ethereum project under that account, you can find the project id under settings tab of the project.
When running a local node for testing purpose, you should also update BN_CONSENSUS_TO_ADDRESS to 0xb1d04A87FdcdB3aAe3dBc846948F25Bd34411e6a which is the BrightID test network address.
To be able to use docker pull you should have an account on docker.com. After creating account and logging in, go to here and create a new access token. Then use the docker login --username <username> and enter your access token as password. If you got Error saving credentials error, you may be able to solve that by sudo apt install gnupg2 pass. You can start pulling BrightID containers after logging in.
docker-compose pullAfter pulling images, the node can be started using:
docker-compose up -dThe node logs can be checked using:
docker-compose logs -fBrightID node consists of db, ws, consensus_receiver, consensus_sender, updater and web services. Each service logs can also be independently checked using:
docker-compose logs -f <service-name>/state endpoint from the API can also be be queried to get some key variables like lastProcessedBlock as the number of the last block that consensus_receiver processed its operations or verificationsBlock as the number of the last block that scorer processed and calculated verifications based on.
This endpoint can be queried using:
curl http://<your-server-address>/brightid/v5/stateWhen the node is synced, lastProcessedBlock should be equal to the total number of IDChain blocked that can be checked from here. verificationsBlock should also be updated in 240 blocks intervals if scorer is active.
If BrightID-Node-docker is not updated, nodes can be upgraded by pulling and running new images.
docker-compose pull
docker-compose up -dIf new BrightID-Node-docker is released, you should download, extract and configure node again before pulling and running new images. Same configurations that used to configure previous version of config.env can be used to configure the new one.
The node database is initialized by fetching the latest hourly backup of official BrightID node when you run the node for the first time. Pulling new images and running them in upgrade process will not re-initialize the node. The node database can be re-initialized using the following command when your node was down for a long time or there are other problems.
INIT_BRIGHTID_DB=1 docker-compose up -dPort 80 needs to be exposed for clients. Ports 8529 and 3000 are used internally by BrightID-Node, but should not be exposed.
Consider running
sudo sysctl -w vm.max_map_count=4096000
on a Linux host system. ArangoDB makes extensive use of memory mapped files. More tuning settings for ArangoDB on Linux.
BrightID data can be explored and settings can be configured through ArangoDB's web interface.
If you installed the node locally, you can access the web interface from localhost:8529, and if you installed on a server, you can create an SSH tunnel as described bellow to access it.
Create a tunnel to any port you like. This example uses port 3333.
On your local machine that has SSH access to the server, run
ssh -nNTL 3333:localhost:8529 <your-server-address> &
Now open a browser with the following address:
http://localhost:3333/
- "Collections" - shows all of the collections in the db
- "Queries" - explore the graph and other collections with queries and visualizations
- "Services"
- API - shows the API endpoints for the BrightID web service
- Settings - configure settings for the BrightID web service (Can also be edited as constants in config.env)
- Logs - view warnings and errors