主页 > 怎样下载imtoken > 以太坊私有节点搭建

以太坊私有节点搭建

怎样下载imtoken 2024-01-26 05:14:03

2021-12-28

我们可以搭建一个以太坊私有节点以太坊节点搭建,模拟以太坊挖矿、交易、部署和运行智能合约,从而达到测试开发的目的。 以下是施工过程的详细说明:

1.创建一个新帐户

geth --datadir {eth_dir} account new //其中eth_dir是私有节点的数据目录

//这条命令会在{eth_dir}目录下生成一个keystore目录以太坊节点搭建,目录下会有对应的账户文件

2.创建genesis.json文件保存创世块的配置信息

ubuntu搭建以太坊环境_以太坊矿池搭建_以太坊节点搭建

{
"config": {
        "chainId": 1,
        "homesteadBlock": 0,
        "eip155Block": 0,

ubuntu搭建以太坊环境_以太坊矿池搭建_以太坊节点搭建

"eip158Block": 0 }, "alloc" : { "f985f8578206c6d317785cf131682259bf84588f": {"balance": "100000001"} //红色部分代表帐号,来自上个命令生成的帐号文件的address属性 },

以太坊节点搭建_ubuntu搭建以太坊环境_以太坊矿池搭建

"coinbase" : "0x0000000000000000000000000000000000000000", "difficulty" : "0x20000", "extraData" : "", "gasLimit" : "0x4c4b40", "nonce" : "0x0001000000000042",

以太坊矿池搭建_以太坊节点搭建_ubuntu搭建以太坊环境

"mixhash" : "0x0000000000000000000000000000000000000000000000000000000000000000", "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000", "timestamp" : "0x00" }

3. 初始化创世块

以太坊矿池搭建_ubuntu搭建以太坊环境_以太坊节点搭建

geth --datadir {eth_dir} 初始化 {./genesis.json}

4.启动以太坊工作节点

geth --verbosity 6 --datadir e:/eth_dir --networkid 13579 --etherbase f985f8578206c6d317785cf131682259bf84588f 
    --port 30303 --rpcport 8545 --rpcaddr localhost --rpc --rpccorsdomain http://localhost:3000
    --ws --wsorigins "http://localhost:3000" --wsport 8546 --unlock f985f8578206c6d317785cf131682259bf84588f
    --nodiscover --mine --minerthreads 1 --password e:/eth_dir/passwd console 2>>eth_output.log

分类:

技术要点:

相关文章: