Geth_私链创建并链接钱包
1. 下载安装geth
2. 创建私有链
创建创世块配置文件 genesis.json
{
"config": {
"chainId": 15,
"homesteadBlock": 0,
"eip155Block": 0,
"eip158Block": 0,
"eip150Block": 0
},
"coinbase" : "0x0000000000000000000000000000000000000000",
"difficulty" : "0x40000",
"extraData" : "",
"gasLimit" : "0xffffffff",
"nonce" : "0x0000000000000042",
"mixhash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
"parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
"timestamp" : "0x00",
"alloc": { }
}
3. 初始化
geth --datadir genesis-block init genesis.json
启动节点
#1
geth --datadir genesis-block --networkid 1108 console
注册账户
personal.newAccount('Your Password') #创建两个
余额查询
my=eth.accounts[0]
eth.getBalance(my)
personal.newAccount('password')
other=eth.accounts[1]
personal.unlockAccount(my)
账户余额查询
eth.getBalance(my)
eth.getBalance(other)
挖矿
miner.start(1)
miner.stop() #null
转移资产到另一个号
eth.sendTransaction({from:my, to:other, value:10000})
测试网络
geth --http --http.api db,eth,net,web3,personal --datadir genesis-block --networkid 1108 console 2>>1out.log
Re:
https://blog.csdn.net/weixin_40401264/article/details/78095222
https://blog.csdn.net/qq_25870633/article/details/82931782