How to Create Your Own Private Blockchain (POW) in Linux Using Geth 1.11.5, 2023 Version


1. Add ethereum repo

sudo add-apt-repository -y ppa:ethereum/ethereum 

2. Install ethereum and geth

sudo apt-get install ethereum

3. Create an initial configuration file

nano genesis.json

And paste the following:

{
  "config": {
    "chainId": 141319,
    "homesteadBlock": 0,
    "eip150Block": 0,
    "eip155Block": 0,
    "eip158Block": 0,
    "byzantiumBlock": 0,
    "constantinopleBlock": 0,
    "petersburgBlock": 0,
    "istanbulBlock": 0,
    "berlinBlock": 0,
    "ethash": {}
  },
  "difficulty": "1",
  "gasLimit": "8000000",
  "alloc": {
    "7df9a875a174b3bc565e6424a0050ebc1b2d1d82": { "balance": "300000" },
    "f41c74c9ae680c1aa78f42e5647a62f353b7bdde": { "balance": "400000" }
  }
}

4. Initiate genesis.json

geth --datadir ~ init genesis.json

5. Create a new account (you need this to run, if not you can run clef)

geth --datadir ~ account new

6. Run the node as a miner

geth --mine --networkid 141319 --miner.etherbase 0xF83ad97529FCAAf08c610C28EF1DE862c0d0E39B --miner.threads 1 --datadir ~ --http --http.addr '0.0.0.0' --http.port 8545 --http.api 'eth,net,web3,txpool' --http.corsdomain '*' --nat any --unlock 0 --password password.sec --allow-insecure-unlock --syncmode full console

Replace all the necessary value with one you desired. In my above example this RPC is able to receive from any IP address to be able to receive from external network.

I will be doing a PoA version that requires 2 signers in my next post.

Comments

Popular posts from this blog

Kokology Questions & Answers

Neuro-Linguistic Programming Models Summary (02 of 14)

Neuro-Linguistic Programming Models Summary (11 of 14)