geth启动方式及参数

几种geth启动方式,带解锁账户的参数,rpc指定IP,gcmode archive参数。

更多区块链技术与应用分类:

区块链应用    区块链开发

以太坊 | Fabric | BCOS | 密码技术 | 共识算法 | 比特币其他链

通证经济传统金融场景 | 去中心化金融 | 防伪溯源 | 数据共享 | 可信存证

1. 简洁版

geth --rpc --rpcaddr "0.0.0.0" --port 30303 --rpcapi "db,eth,net,web3,personal" --rpccorsdomain "http://localhost:8000" --datadir "data0" --networkid 1108 console

2. 带解锁账户的参数

geth --rpc --rpcaddr "0.0.0.0" --port 30303 --rpcapi "web3,personal,admin,db,net,eth,miner,rpc,txpool" --rpccorsdomain "*" --datadir "data0" --networkid 1108 --ws --wsaddr="0.0.0.0" --wsorigins "*" --wsapi "web3,personal,admin,db,net,eth,miner,rpc,txpool" --unlock "0xef98d12f6876bc19dfd12a6f895ff9ebc38fd015","0x76471b06ca788b27c5256b56da19a48c10786642",""0x752c70d14ae057f3de857b6289d388af01b12041"","0xf64b8ee4069dde372f073190d13714b806c4c902","0x62b06e6f3d157c13a3a5e4eec99964e1446d4282" console

3.带rpc调用指定IP以及解锁账户的参数

geth --rpc --rpcaddr "0.0.0.0" --port 30303 --rpcapi "web3,personal,admin,db,net,eth,miner,rpc,txpool" --rpccorsdomain "http://localhost:8000,http://localhost:8080,http://172.27.34.164:8000,http://172.27.34.164:8080" --datadir "data0" --networkid 1108 --ws --wsaddr="0.0.0.0" --wsorigins "*" --wsapi "web3,personal,admin,db,net,eth,miner,rpc,txpool" --unlock "0xb62d5c6531e152e211f53e01496eb38fa4713bf3","0x90a02dc5674c48d1187104b694cec779849bc852","0x5000f3a82eb4664be146afda43da129512f79450","0x8aec1dc335cd084cfbf709ac1028492395dd1505","0xdcf68eb2cc89a2142fb6db2eb25c3da349f4e760" console

4. gcmode archive参数

geth --networkid 1818 --datadir "./chain" --rpc -rpcaddr="0.0.0.0" --rpcport 7545 --rpcapi "web3,personal,admin,db,net,eth,miner,rpc,txpool,clique" --ws -wsaddr="0.0.0.0" --wsport 8546 --wsapi "web3,personal,admin,db,net,eth,miner,rpc,txpool,clique" --wsorigins "*" --unlock 0 --password pwd --nodiscover --gcmode archive &

5. 同步公网数据

geth --datadir "./chain" --syncmode "fast" --rpc --rpcaddr="0.0.0.0" --rpcapi "web3,personal,admin,db,net,eth,miner,rpc,txpool" --ws --wsaddr="0.0.0.0" --wsorigins "*" --wsapi "web3,personal,admin,db,net,eth,miner,rpc,txpool" --maxpeers 30 --cache 3096

若开发测试,可安装ganache-cli

npm install -g ganache-cli --unsafe-perm

centos下安装,若报错:Error: EACCES: permission denied时可使用如下命令启动:

ganache-cli --secure -p 7545 -l 60000000 -e 1500000 -u 0 -u 1 -u 2 -u 3 -u 4

原文链接:geth启动方式及参数 

  • 2
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值