5) Reconfigure MoC Instance
Update json.spec files and launch Register & Certifier contracts

Master of Ceremonies (MoC) Instance Initial Steps

1) Login to MoC instance and go to the moc directory
1
ssh -i [email protected]/Address
Copied!
1
[email protected]:~ cd ../moc
Copied!
2) Replace the existing spec.json file, changing parameters as required:
  1. 2.
    sudo nano spec.json paste and make changes as needed:
  • name must be {{ network_name }}
  • engine.authorityRound.params.blockReward must be 0x0
  • engine.authorityRound.params.validators.multi.0.list must contain the Master of Ceremony address
  • params.networkID must be a unique ID for your network. <See a list of current ids>
  • genesis.gasLimit - change if needed
3) Adjust the node.toml file on MoC with the following settings: (we use nano in this demonstration, feel free to use vim or another editor of your choice)
1
sudo nano node.toml
Copied!
  • parity.chain must be a path to spec.json
  • account.unlock must contain the Master of Ceremony address. (do not uncomment yet)
  • mining.min_gas_price is a min gas price in Wei
  • mining.engine_signer must contain the Master of Ceremony address
  • mining.gas_floor_target is a max block size in gas
4) Launch the Master of Ceremony node
1
sudo systemctl restart poa-parity && sleep 10 && sudo systemctl restart poa-netstats
Copied!

Prepare Register & Certifier Contracts

1
sudo git clone https://github.com/openethereum/name-registry
2
cd name-registry
Copied!
  • Set gasPrice to 0 in truffle-config.js. Replace port 7545 with Port 8545.
1
diff --git a/truffle-config.js b/truffle-config.js
2
index ee5a576..62681ac 100644
3
--- a/truffle-config.js
4
+++ b/truffle-config.js
5
@@ -4,8 +4,9 @@ module.exports = {
6
networks: {
7
development: {
8
host: "127.0.0.1",
9
- port: 7545,
10
+ port: 8545,
11
network_id: "*",
12
+ gasPrice: "0"
13
},
14
},
15
};
Copied!
  • Unlock Master of Ceremony in node.toml.
    • cd.. to moc directory
    • sudo nano node.toml
    • Uncomment #unlock=[...]
    • Restart Parity: sudo systemctl restart poa-parity && sleep 10 && sudo systemctl restart poa-netstats
2) Deploy Contracts
1
cd name-registry
2
sudo npm i
3
sudo node_modules/.bin/truffle migrate --reset --network development
Copied!
Deployment artifacts will be stored in the build subfolder.
If you experience issues with npm install, you can use yarn. Instructions here: https://yarnpkg.com/lang/en/docs/install/#debian-stable

Update bootnodes.txt

You need to write the current MoC's enode to the bootnodes.txt file.
1) Run this command on the MoC node to retrieve the current enode
1
curl --data '{"method":"parity_enode","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545
Copied!
2) Copy the json result
3) sudo nano bootnodes.txt
4) Replace the default enodes with the current enode and save.
1
enode://your-enode-here:30303
Copied!

Copy Items before exiting

  • spec.json file - you will replace the Bootnode instance with this file. Example:
1
scp -i ~/.ssh/your-private-key [email protected]/Address:/home/moc/spec.json your-local-folder/
Copied!
  • Addresses of the newly deployed Certifier and Registry contracts. Go to the name-registry subdirectory and execute:
1
grep -Rn \"address\": build/contracts/{SimpleCertifier.json,SimpleRegistry.json}
Copied!
  • bootnodes.txt file - you will replace the Bootnode instance with this file.
Last modified 1yr ago