networkid 39
VM Spec | Descriptions |
---|---|
OS | Ubuntu 20.04 LTS |
CPU | vCPU 8 Cores |
RAM | 16 GB |
DISK SSD | 200 GB |
Software | Version |
---|---|
docker | 20.10.6 or higher |
docker-compose | 1.29.1 or higher |
geth | ethereum/client-go:v1.10.17 |
# curl https://get.docker.com | sh
# curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
# chmod +x /usr/local/bin/docker-compose
# git clone https://github.com/thanachaiTP/workshop-poa.git -b validator validator
# cd validator
# head -1 /dev/urandom | base64 | md5sum
copy Public address of the key ใส่ใน docker-compose.yaml ในบรรทัด unlock
# docker run --rm -it -v $PWD:/poa -w /poa ethereum/client-go:v1.10.17 --datadir /poa/node --password password.txt account new
# docker run --rm -it -v $PWD:/poa -w /poa ethereum/client-go:v1.10.17 --datadir /poa/node --nousb init genesis.json
# docker-compose up -d
# docker-compose logs -f
# docker exec -it validator sh
# geth --datadir /poa/node attach
Command | |
---|---|
Get Signer | > clique.getSigners() |
Check Peers Count | > net.peerCount |
Check IP Peers | > admin.peers |
Add Peers Static | > admin.addPeer("enode://a979fb575495b8d6db44f75@52.16.188.185:30303") |
Check NodeInfo | > admin.nodeInfo |
Add Singer | > clique.propose("0xd881234E73223d1623E0d56789942eA1c0B67890", true) |
Remoce Signer | > clique.propose("0xd881234E73223d1623E0d56789942eA1c0B67890", false) |
Check Vote | > clique.proposals |
command-line สำหรับ get enode
# docker exec -it validator geth --datadir /poa/node attach --exec 'admin.nodeInfo'
command-line สำหรับ add validator
# docker exec -it validator geth --datadir /poa/node attach --exec 'clique.propose("0x048F519b032bAfa19Cf28D0cbf717a5fd119fA7A", true)'
command-line สำหรับ check validator
# docker exec -it validator geth --datadir /poa/node attach --exec 'clique.getSigners()'
# docker run --rm -it -v $PWD:/poa -w /poa ethereum/client-go:v1.10.17 --datadir /poa/node --nousb removedb
และให้ทำการ init genesis ใหม่อีกครั้งก่อนการ deploy
# docker run --rm -it -v $PWD:/poa -w /poa ethereum/client-go:v1.10.17 --datadir /poa/node --nousb init genesis.json