Shang Silicon Valley Ethereum blockchain learning (4)

Difficult to name 2022-04-05 05:58:34 阅读数:1,007

shang silicon valley ethereum blockchain


Preface

Tips : Service outsourcing blockchain learning

explain : Since this blog, you don't have to Ubuntu Write blockchain , change to the use of sth. Windows, Because you need to link the previous written about NFT The background of the system , And backstage Windows On a host of , Even with VMware Port mapping is set , The host MataMask Still can't link to the virtual machine , So use Windows, It's almost the same , even to the extent that Windows It's simpler .

Only record operations
Direct link of Silicon Valley Ethereum blockchain

One 、 Installation environment

1、 install Golang

go1.18 Installation package
link :https://pan.baidu.com/s/1MGiJlyGCWBr1b5BNKanmsg?pwd=jlvd
Extraction code :jlvd

The installation will configure its own environment variables

direct Win+R Input cmd

go version

 Insert picture description here

2、 install Geth

geth1.10.17 Installation package
link :https://pan.baidu.com/s/1Ba95o6t-hDEC9cTwWz_81A
Extraction code :c7ff

After installation, go to Geth Enter... In the installation path bar of cmd

geth version

 Insert picture description here

Two 、 Initialize blockchain

1、 Create the genesis block

New text , write in , Change of name ,over

{

"config": {

"chainId": 123,
"homesteadBlock": 0,
"eip150Block": 0,
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0,
"istanbulBlock": 0
},
"alloc": {

"0x634c4CF26680fa8C2Ef3d8B9FA4E6AE748667BB8": {
 "balance": "300000000000000000000000000000" }
},
"coinbase": "0x0000000000000000000000000000000000000000",
"difficulty": "0x2000",
"extraData": "",
"gasLimit": "0x2fefd8",
"nonce": "0x0000000000000042",
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"timestamp": "0x00"
}

2、 Blockchain initialization

The same is in Geth Where is the installation path cmd

geth --datadir . init genesis.json

 Insert picture description here

3、 ... and 、Geth Client operation

1、 start-up Geth client

The same is in Geth Where is the installation path cmd

Actually, it's just like Ubuntu Of Geth The client operation is the same
So I won't repeat , If you don't understand, look at the front

Still learning from Silicon Valley Ethereum blockchain (3)

Start command

geth --datadir . --networkid 123 --nodiscover --http --http.addr 0.0.0.0 --http.port 8545 --http.corsdomain "*" --port 30305 --allow-insecure-unlock console 2>output.log

Over

版权声明:本文为[Difficult to name]所创,转载请带上原文链接,感谢。 https://netfreeman.com/2022/04/202204050555188396.html