Skip to content

YutaSugimura/ethereum-poa

Repository files navigation

Document

Link: https://wiki.parity.io/JSONRPC

Setup

  1. update
   sudo apt update -y && sudo apt install vim -y && sudo apt upgrade -y 
  1. parity install
   bash <(curl https://get.parity.io -L) -r stable
  1. git clone
   git clone https://github.com/YutaSugimura/ethereum-poa-parity.git 
   mv ethereum-poa-parity Parity && cd Parity 
  1. parity start
   parity 
   # startしたらすぐにctl + cで終了 
   # ~/.local/share/io.parity.ethereum が生成される 
  1. start config PoA
   parity --config ./config/config.toml
  1. create Validator Accounts
   # 別window
   curl --data '{"jsonrpc":"2.0","method":"parity_newAccountFromPhrase","params":["$MNEMONIC", "$PASSWORD"],"id":0}' -H "Content-Type: application/json" -X POST localhost:8545
  1. stop config PoA
   # ctl + c 
   # 停止させる
  1. create password-file
   cd && mkdir .safe 
   echo '$PASSWORD' >> .safe/validator.pwd 
  1. setting systemctl
   cd Parity 
   sudo cp parity.service /etc/systemd/system 
   sudo chmod +x /etc/systemd/system/parity.service 
   sudo systemctl enable parity 
  1. start PoA
   sudo systemctl start parity 
   sudo systemctl status parity 
  1. cofirm peer enode
   curl --data '{"jsonrpc":"2.0","method":"parity_enode","params":[],"id":0}' -H "Content-Type: application/json" -X POST localhost:8545 

   # result {"jsonrpc":"2.0","result":"enode://d4af2ed1b929c7a7a10aa11ba54349cac61cd4fb1b3e7e8fb11ebaccdb3175489980125952d2514c25260b5dc611afb937cf72d40a133ec4fde5719834a67d71@171.11.11.11:30300","id":0}
  1. connect peer
   # 他peer 
   curl --data '{"jsonrpc":"2.0","method":"parity_addReservedPeer","params":["ENODE://"],"id":0}' -H "Content-Type: application/json" -X POST localhost:8545 
  1. unlock Accounts
   curl --data '{"jsonrpc":"2.0","method":"parity_newAccountFromPhrase","params":["$MNEMONIC", "$PASSWORD"],"id":0}' -H "Content-Type: application/json" -X POST localhost:8545 

   or 

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

   # result {"jsonrpc":"2.0","result":"0x001060e5c7eef4c637fb46e2f389e1d14a447ea8","id":0}

接続

   // get web3
   const provider = new Web3.providers.HttpProvider(
      "http://ip-address:8545"
   );
   const web3 = new Web3(provider);

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages