go-etherum configuration on the window

Productivity tools

  • golang

  • Git

  • mingw64

    Link: https://pan.baidu.com/s/1Mm5iSXDEVkTmpV7wBGk8Lg
    Extraction code: wasd

  • go

    Details: Go language development environment setup

    The above environment configuration can be found on the Internet, so I won’t go into details here

    ps: (with pictures for everyone)

    GoPath

Insert picture description here

Under system variables, configure under Path

Insert picture description here

installation steps

Create a new src->github.com->etherum folder in the gopath directory you set

My setup path is

D:\GoProjects\src\github.com\ethereum

Then use your gitbash to use the command under this file

git clone [email protected]:ethereum/go-ethereum.git

Open golang

Import the file go-etherum just now

If the import is not popular, congratulations, it is popular, don’t be nervous, follow the instructions on the sticker,

This step will jump the agent to China

Insert picture description here

Then open your golang terminal and enter

Insert picture description here

Only need to complete the bottom two lines

If there is an error, such as hello.go main.go under miner(), take out these two files directly for backup (to prevent future need)

Check geth, and some operations of geth

Open the terminal under the GOPATH bin path and enter the command geth version

Insert picture description here

Then create the genesis block

{
    
    
  "config": {
    
    
    "chainId": 10,
    "homesteadBlock": 0,
    "eip150Block": 0,
    "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "eip155Block": 0,
    "eip158Block": 0,
    "byzantiumBlock": 0,
    "constantinopleBlock": 0,
    "petersburgBlock": 0,
    "istanbulBlock": 0,
    "ethash": {
    
    }
  },
  "nonce": "0x0",
  "timestamp": "0x5e4a53b2",
  "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "gasLimit": "0x47b760",
  "difficulty": "0x80000",
  "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "coinbase": "0x0000000000000000000000000000000000000000",
  "alloc": {
    
    
    "0000000000000000000000000000000000000088": {
    
    
      "balance": "0x200000000000000000000000000000000000000000000000000000000000000"
    }
  },
  "number": "0x0",
  "gasUsed": "0x0",
  "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}

Use the geth command with the terminal

geth --datadir ~/.ethereum/myprivatenet init privategensis.json

Insert picture description here

ps golang some configuration

Insert picture description here

Guess you like

Origin blog.csdn.net/tangshuai96/article/details/114598921