Skip to content

thanachaiTP/workshop-poa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Deploy Blockchain POA (Validator)

networkid 39

รายละเอียด System Requirements

VM Spec Descriptions
OS Ubuntu 20.04 LTS
CPU vCPU 8 Cores
RAM 16 GB
DISK SSD 200 GB

รายละเอียด Software Requirements

Software Version
docker 20.10.6 or higher
docker-compose 1.29.1 or higher
geth ethereum/client-go:v1.10.17

Install docker and docker-compose

# 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

0. clone project POA

# git clone https://github.com/thanachaiTP/workshop-poa.git -b validator validator
# cd validator

1. set password to password.txt file

# head -1 /dev/urandom | base64 | md5sum

2. create new account

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

3. init-genesis

# docker run --rm -it -v $PWD:/poa -w /poa ethereum/client-go:v1.10.17 --datadir /poa/node --nousb  init genesis.json

4. deploy

# docker-compose up -d
# docker-compose logs -f

5. JavaScript Console

https://geth.ethereum.org/docs/rpc/server

# 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://[email protected]:30303")
Check NodeInfo > admin.nodeInfo
Add Singer > clique.propose("0xd881234E73223d1623E0d56789942eA1c0B67890", true)
Remoce Signer > clique.propose("0xd881234E73223d1623E0d56789942eA1c0B67890", false)
Check Vote > clique.proposals
Check Vote > clique.status()

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()'

หากต้องการ reset data เพื่อทำการ join ใหม่

7. removedb

# 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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published