创建用户
geth account new
我们多创建几个账号,如下:
我们打开一个账户文件看看里边的内容:
包括内容如下:
address 公钥地址
crypto 密码 aes-128 密码
私钥密码并没有,私钥为之前输入过口令衍生
cipherparams 密文格式等
其他内容这里不详细描述
编写初始块与区块链配置文件,然后生成区块
{
"nonce":"0x0000000000000042",
"difficulty":"0x1",
"alloc":{
"cd3e93c51b9f748ebca8e62790fc2704bdbe3f5d":{
"balance":"20000009800000000000000000000"
},
"980950f6e27a3d06e19be62be06bfe88e88cc0a7":{
"balance":"20000009800000000000000000000"
},
"929a86cf912859737f1d507beb08873139c0c10e":{
"balance":"20000009800000000000000000000"
},
"15b7b975e91d437da5ace666c85c9f2fdcafccfb":{
"balance":"20000009800000000000000000000"
}
},
"mixhash":"0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase":"0x0000000000000000000000000000000000000000",
"timestamp":"0x00",
"parentHash":"0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData":"0x00000000",
"gasLimit":"0xb2d05e00",
"config":{
"chainId":666,
"homesteadBlock":0,
"eip155Block":0,
"eip150Block":0
}
}
启动开启脚本运行私有链
geth --rpc --rpcapi eth,web3,personal --allow-insecure-unlock --nodiscover --networkid '1234574' --datadir '/home/linux/go-ethereum' console
进入交互式界面
创建几个用户,并显示用户地址
miner.start()
开始挖矿
挖到一个矿,生成一个区块
查看挖到的以太币