Ethereum相关命令怎么使用
Ethereum相关命令怎么使用
本篇内容主要讲解“Ethereum相关命令怎么使用”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“Ethereum相关命令怎么使用”吧!
一、struct ConfirmOrder中定义一个mapping(uint=>ConfirmDetail) confirmDetails,则创建ConfirmOrder时,confirmDetails可以不赋值。如果使用ConfirmDetail[]confirmDetails时,创建ConfirmOrder时,不赋值,则报错:TypeError: Wrong argument count for struct constructor: 5 arguments given but expected 6.
二、function AddConfirmDetails(uint _orderId,string _state) public view returns(uint amount){,这样写无法显示这个方法。function AddConfirmDetails(uint _orderId,string _state) public{,这样写就能显示这个方法。
三、public view returns,加view时,就无法插入,不加view能插入但无法返回值
四、查询geth版本
$ geth version
Geth
Version: 1.8.3-stable
Architecture: amd64
Protocol Versions: [63 62]
Network Id: 1
Go Version: go1.10.1
Operating System: darwin
GOPATH=
GOROOT=/usr/local/opt/go/libexec
五、查询go版本
$ go version
go version go1.10.1 darwin/amd64
六、区块链命令
txpool.status
miner.start(1);admin.sleepBlocks(5);miner.stop();
eth.getBlock(33)
web3.fromWei(eth.getBalance(eth.accounts[0]),'ether')
admin.peers
$ geth --testnet --fast console 2>> geth-test.log 测试网络
$ geth --fast console 2>> geth-test.log 主网络
> eth.syncing 查询同步进度
遇到问题:synchronisation failed retrying block download canceled使用下面两句话后继续执行上面的语句同步节点
$ geth removedb
$ geth upgradedb
七、多节点私有链启动命令必须一致,否则一个节点提交区块,其他节点无法挖矿处理此区块。
比如
$ geth --identity "itari" --datadir data0 --networkid 899 --port 30303 --rpc --rpcaddr localhost --rpcport 8545 --rpcapi "db,web3,eth,personal,miner,net,txpool" --rpccorsdomain "*" console 2>> data.log
和
$ geth --identity "itari" --datadir data0 --networkid 899 --port 30303 --rpc --rpcaddr localhost --rpcport 8545 console
两种不同的启动方式
到此,相信大家对“Ethereum相关命令怎么使用”有了更深的了解,不妨来实际操作一番吧!这里是亿速云网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!
推荐阅读
-
Notepad++ 插件推荐:代码折叠、语法高亮增强工具合集
-
Emacs Evil 模式:Vim 用户快速上手 Emacs 的过渡方案
-
Vim 寄存器深度解析:多缓冲区操作与复杂文本处理
-
Atom 主题切换:Material Design 与扁平化风格对比推荐
-
Lightly IDE 快捷键:Python 开发者必学的效率提升操作
-
Xcode 模拟器调试:多设备同步与性能监控技巧
-
PyCharm 代码格式化:黑魔法工具 Black 与自动规范配置
-
IntelliJ IDEA Docker 集成:微服务本地调试与镜像构建
-
VS Code Remote SSH:远程服务器开发环境搭建全流程
-
Retool 数据库连接:支持 MySQL、PostgreSQL 等多数据源配置