Skip to content

Import a context from a node into another one

Abram Symons edited this page Jan 12, 2021 · 7 revisions

To import a context from a node that currently hosts contextIds linked under that context into another node:

1) Set one time passcode

The admin of the node that currently hosts context should use brightid cli to set a one time passcode on the context to authorize the new node request for getting context info, and share this passcode with the admin of the new node.

$ sudo pip3 install brightidcli
$ brightid admin set-passcode --context <context> --passcode <passcode>
Done

2) Stop the node

To ensure that the new node will not miss contextIds that are linked while importing context, its admin should stop the node before importing the context.

$ cd BrightID-Node-docker
$ docker-compose stop
Stopping brightid-node_consensus_receiver_1 ... done
Stopping brightid-node_consensus_sender_1   ... done
Stopping brightid-node_scorer_1             ... done
Stopping brightid-node_ws_1                 ... done
Stopping brightid-node_updater_1            ... done
Stopping brightid-node_db_1                 ... done
Stopping brightid-node_web_1                ... done

3) Import context

The admin of new node should use brightid cli to import the context into the node.

$ sudo pip3 install brightidcli
$ brightid admin import-context --context <context> --remote-node <remote-node-address> --passcode <passcode>
Checking if the consensus receiver is stopped ...
Getting data ...
Importing context ...
Done

4) Start the node

The node should be started after importing context using:

$ cd BrightID-Node-docker
$ docker-compose up -d
Starting brightid-node_web_1     ... done
Starting brightid-node_db_1  ... done
Starting brightid-node_updater_1 ... done
Starting brightid-node_ws_1      ... done
Starting brightid-node_scorer_1             ... done
Starting brightid-node_consensus_sender_1   ... done
Starting brightid-node_consensus_receiver_1 ... done

Clone this wiki locally