GithubHelp home page GithubHelp logo

privnw_poa's Introduction

Setup a Consortium/Private network

Specifications for this setup

  • Platform : Ethereum
  • Client : Go-Ethereum (Geth) version 1.10.3-stable https://geth.ethereum.org/downloads/
  • Architecture : amd64
  • Go Version : go1.16.3
  • OS : linux
  • Consensus Model : Clique proof-of-authority
  • Nodes : 1 bootnode, 1 sealer node, 1 peer

Configurable setup (for new user + most settings must be unique)

  • Network name
  • Chain Id, refer to [https://chainlist.org/]
  • Other Geth CLI options including http port, http address http cors domain, ipc, bootnodes etc

Below listed the steps need to be taken to correctly configure the setup

  1. Create 3 directories for different nodes (bootnode, sealer, and peer)

    • Chaindata will go under the subdirectory 'data' (only for node1 and node2)
  2. Create accounts:

    • geth --datadir ./node1/data account new
    • geth --datadir ./node2/data account new
  3. Run the puppeth tool to generate the genesis.json file

  4. Initialize node1 and node2

    cd node1 && geth --datadir ./data init ../genesis.json
    cd node2 && geth --datadir ./data init ../genesis.json
    
  5. Setup bootnode

    • Generate a node key
    bootnode -genkey boot.key
    
    • Start using private key filename
    bootnode -nodekey "./boot.key"
    

    After run second command, take note the enode echoed. It looks something like this "enode://83cab5439021f0dcad5a12faa2c628c212bc072d78d2ebf5dd80c3cdd0d625f262bbac924492f5e0c0ce1140fdbfc569dfa5893615e386395bca2f61f551b722@127.0.0.1:0?discport=30301"

  6. Launch the node1 and node2 including the enode value of the bootnode created. Example of command template is as follows

    geth --networkid <> --mine --datadir "./data" --port <> --ipcdisable --syncmode full --http --http.corsdomain "*" --http.port <> --unlock <<public address of node1 without "0x">> --password <<password filename (e.g: password.txt)>> --bootnodes '<>' console

To reuse this setup and configure from the very start, feel free to clean the following folders

  1. node1\data\geth
  2. node1\data\keystore
  3. node2\data\geth
  4. node2\data\keystore
  5. bootnode\boot.key
  6. privnw-harmony.json
  7. privnw.json
  8. node1\password.txt
  9. node2\password.txt
  10. node1\launch.sh
  11. node2\launch.sh

privnw_poa's People

Contributors

salikzquidz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.