Once the watcher nodes started, it would first try to register in NuProxy pallet. It will fall into the following three situation:
- If the node is illegal for registration, it will report a warning and exit.
- If the node is legal for registration and already registered, it will jump to the next step.
- Otherwise it would successfully register into the NuProxy pallet.
After the initial step, the watcher nodes would monitor the Ethereum network. If the staker information stored in NuCypher contract changes, it would synchronize the updated status by sending the updating extrinsic in Polkadto Parachain periodically.
You can edit the default configuration file here accordingly.
The structure of the configuration file is as:
{
// stake info sync frequency, 100 means sync every 100 blocks
"epochSize": 100,
"ethereumConfig": {
// the url of the ethereum RPC node
"url": "https://mainnet.infura.io/v3/your_project_id",
// whether the url of the ethereum RPC node is http protocol,
// currently only the http protocol is supported, so this parameter must be true
"http": true,
// the address of the nucypher deposit contract
"depositContractAddr": "0xbbD3C0C794F40c4f993B03F65343aCC6fcfCb2e2"
},
"nuLinkChainConfig": {
// the url of the NuLink RPC node
"url": "ws://127.0.0.1:9944"
}
}
cd cmd/watcher
go build -o watcher main.go
Going watcher -h can get help infos.
./watcher --config ../../config.json --mock
You can use the default configuration or specify related configurations. The parameters you can specify are mainly the following.
config
: This flag can be used to specify a json configuration file.
mock
: Start the project in mock mode.