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

ssh -i ubuntu@moc-ec2-user.DNS/Address
ubuntu@ip-moc-ec2-user:~ cd ../moc

2) Replace the existing spec.json file, changing parameters as required:

  1. 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)

sudo nano node.toml
  • 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

sudo systemctl restart poa-parity && sleep 10 && sudo systemctl restart poa-netstats

Prepare Register & Certifier Contracts

1) Clone https://github.com/parity-contracts/name-registry repository

sudo git clone https://github.com/parity-contracts/name-registry
cd name-registry
  • Set gasPrice to 0 in truffle-config.js. Replace port 7545 with Port 8545.

diff --git a/truffle-config.js b/truffle-config.js
index ee5a576..62681ac 100644
--- a/truffle-config.js
+++ b/truffle-config.js
@@ -4,8 +4,9 @@ module.exports = {
networks: {
development: {
host: "127.0.0.1",
- port: 7545,
+ port: 8545,
network_id: "*",
+ gasPrice: "0"
},
},
};
  • 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

cd name-registry
sudo npm i
sudo node_modules/.bin/truffle migrate --reset --network development

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

curl --data '{"method":"parity_enode","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545

2) Copy the json result

3) sudo nano bootnodes.txt

4) Replace the default enodes with the current enode and save.

enode://your-enode-here:30303

Copy Items before exiting

  • spec.json file - you will replace the Bootnode instance with this file. Example:

scp -i ~/.ssh/your-private-key ubuntu@moc-ec2-user.DNS/Address:/home/moc/spec.json your-local-folder/
  • Addresses of the newly deployed Certifier and Registry contracts. Go to the name-registry subdirectory and execute:

grep -Rn \"address\": build/contracts/{SimpleCertifier.json,SimpleRegistry.json}
  • bootnodes.txt file - you will replace the Bootnode instance with this file.