Skip to content
Deployment of POA network in one click and e2e tests of Ceremony/Governance DApps
Branch: master
Clone or download
Pull request Compare This branch is 60 commits behind poanetwork:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
keys
nodes
pages
scripts
spec
submodules
utils
.gitignore
.gitmodules
LICENSE
MetaMaskWallet.js
MetaMask_v3.14.1.crx
README.md
e2eCeremonyTest.js
e2eGovernanceTest.js
e2eValidatorsTest.js
getPrivateInitialKeys.js
package-lock.json
package.json
prepareCeremonyDapp.js
prepareGovernanceDapp.js
prepareMoCNode.js
prepareMoCScripts.js
prepareValidatorNode.js
prepareValidatorsDapp.js

README.md

POA Network test setup

How it works:

  • gets content of master branch of poa-network-consensus-contracts repo
  • compiles all POA Network contracts
  • gets binary code of POA Network Consensus contract
  • gets spec.json from sokol branch of chain-spec repo
  • generates custom private, public key and password of MoC and save them to ./keys/moc folder
  • updates spec.json with new MoC and binary code of POA Network Consensus contracts
  • starts MoC Parity node
  • deploys secondary POA Network contracts
  • gets content of master branch of poa-scripts-moc repo
  • generates 1 initial key with password and copy it to ./keys/initial_keys folder
  • gets content of sokol branch of poa-dapps-keys-generation repo
  • launches Ceremony DApp is locally builded from repo
  • runs e2e tests on Ceremony DApp
  • saves generated production keys with Ceremony DApp to ./keys folder
  • runs validator node
  • gets content of sokol branch of poa-dapps-validators repo
  • launches Validators DApp is locally builded from repo
  • runs e2e tests on Validators DApp
  • gets content of sokol branch of poa-dapps-voting repo
  • launches Voting DApp is locally builded from repo
  • runs e2e tests on Governance DApp

Requirements

  1. Linux, Mac OS
  2. Parity 1.9.2+
  3. Google Chrome

Basic scenarios

There are some options to start POA Network test setup depending on your needs:

Start MoC node

  1. npm i
  2. npm run start-moc-setup

At the successful end of POA test setup start you'll see this message ### POA test setup is configured ###

Expected results:

  • RPC of Parity node with unlocked MoC account will be on http://localhost:8545
  • Spec of the network is generated to ./spec folder
  • MoC keystore file, password, private key is generated to ./keys/moc folder
  • Parity config of MoC node is generated to ./nodes/parity-moc/moc.toml file
  • Addresses of governance smart contracts are generated to ./submodules/poa-network-consensus-contracts/contracts.json
  • ABI of smart contracts are generated to ./submodules/poa-network-consensus-contracts/build/contracts

Launch DApps

Note: can be started after previous step is completed

npm run launch-dapps

Expected results:

  • Ceremony Dapp is started on http://localhost:3000
  • Validators Dapp is started on http://localhost:3001
  • Governance Dapp is started on http://localhost:3002

Launch Ceremony

Note: can be started after previous step is completed

For Ubuntu users: you should first install and use X virtual framebuffer if you want to move all graphical operations to the virtual memory without showing any screen output.

sudo apt-get -y install xvfb
export DISPLAY=:99.0
sudo start-stop-daemon --start --quiet --pidfile /var/run/xvfb.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1024x768x24 -ac +extension GLX +render -noreset

npm run launch-ceremony

Expected results:

  • 3 initital key are generated
  • Initial key passwords, private keys are generated to .keys/initial_keys folder
  • e2e test of Ceremony DApp is executed
  • Mining addresses, passwords and private keys are copied to ./keys/mining_keys folder
  • Payout addresses, passwords and private keys are copied to ./keys/payout_keys folder
  • Voting addresses, passwords and private keys are copied to ./keys/voting_keys folder
  • Initital keys are removed
  • Most ETH from initial keys are transfered to voting keys
  • Validator nodes are started at RPC ports 8550, 8551, 8552

Set Validators' personal data

Note: can be started after previous step is completed

npm run set-validators-data

Expected results:

  • 3 validators filled with mock personal data in Validator Dapp

Add validator from Governance

Note: can be started after previous step is completed

npm run add-validator

Expected results:

  • New validator is added to validators' set through Governance DApp

Launch added validator node

Note: can be started after previous step is completed

npm run start-new-validator-node

Expected results:

  • New validator node is started at RPC port 8553

Finish test POA setup

npm run stop-test-setup

For Ubuntu users: you should also stop virtual framebuffer if you started it before.
sudo start-stop-daemon --stop --quiet --pidfile /var/run/xvfb.pid --remove-pidfile

You can’t perform that action at this time.