ethereum-compass
ethereum-compass copied to clipboard
《以太坊的指南针》 一本写给普通人看的以太坊区块链技术书。A Book of Ethereum in Chinese.
solc 版本 : 0.8.16+commit.07a7930e.Linux.g++ Vault.sol 中的版本也已经改成了 0.8.16 编译命令:`solc --optimize --combined-json abi,bin,interface Vault.sol` 报错内容:`Invalid option to --combined-json: interface` 自己的解决办法:删除编译命令中的 interface 选项 得到的结果: ``` Warning: SPDX license identifier not provided in source...
请问下,这个重排是怎么实现的 出处:[](https://ethbook.abyteahead.com/ch6/compile.html ) `var output = {"contracts":{"Vault.sol:Vault":{"abi":"[{\"constant\":false,\"inputs\":[{\"name\":\"data\",\"type\":\"uint256\"}],\"name\":\"set\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"get\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}]","bin":"608060405234801561001057600080fd5b5060bf8061001f6000396000f30060806040526004361060485763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166360fe47b18114604d5780636d4ce63c146064575b600080fd5b348015605857600080fd5b5060626004356088565b005b348015606f57600080fd5b506076608d565b60408051918252519081900360200190f35b600055565b600054905600a165627a7a723058203269ba0a634bf05e2a15966872aaa719b6d147aaa419d656374ad860104e6ef40029"}},"version":"0.4.24+commit.e67f0147.Darwin.appleclang"}` 目标:实现教材中那样对编译结果的重排 实际结果: Command 'var' not found, but there are 18 similar ones. 具体操作: 在系统终端直接输入 `var output = {"contracts":{"Vault.sol:Vault":{"abi":"[{\"constant\":false,\"inputs\":[{\"name\":\"data\",\"type\":\"uint256\"}],\"name\":\"set\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"get\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}]","bin":"608060405234801561001057600080fd5b5060bf8061001f6000396000f30060806040526004361060485763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166360fe47b18114604d5780636d4ce63c146064575b600080fd5b348015605857600080fd5b5060626004356088565b005b348015606f57600080fd5b506076608d565b60408051918252519081900360200190f35b600055565b600054905600a165627a7a723058203269ba0a634bf05e2a15966872aaa719b6d147aaa419d656374ad860104e6ef40029"}},"version":"0.4.24+commit.e67f0147.Darwin.appleclang"} ` 系统: ubuntu 18.04 solc...
新版本geth,出于安全考虑,默认禁止了HTTP通道解锁账户 相关issue:https://github.com/ethereum/go-ethereum/pull/17037 第5章中的“转账与收款” 需要以下面的命令来启动节点,才能使用personal.unlockAccount() geth --datadir ./db/ --http --http.addr=127.0.0.1 --http.port 8545 --http.corsdomain "*" \ --http.api "eth,net,web3,personal,admin,shh,txpool,debug,miner" \ --nodiscover --maxpeers 30 --networkid 198989 --port 30303 \ --mine --miner.threads 1 \ --miner.etherbase...
第5章中的“启动一条以太坊私链” 其中geth命令的多个参数已经过时,得用新的参数名称 --rpc 改为 --http --rpcaddr 改为 --http.addr --rpcport 改为 --http.port --rpccorsdomain 改为 --http.corsdomain --rpcapi 改为 --http.api --minerthreads 改为 --miner.threads --etherbase 改为 --miner.etherbase 修改过后的命令行是这样 geth --datadir ./db/ --http --http.addr=127.0.0.1 --http.port...
现在创世配置和以前不一样了 必须加上 eip150Block 不然初始化时会报错 "Fatal: Failed to write genesis block: unsupported fork ordering: eip150Block not enabled, but eip155Block enabled at 0" 修正后的配置是这样 { "config": { "chainId": 987, "homesteadBlock": 0, "eip150Block":...
otherwise, it would throw an error msg > Fatal: Failed to write genesis block: unsupported fork ordering: eip150Block not enabled, but eip155Block enabled at 0 [ref](https://github.com/ethereum/go-ethereum/issues/20676#issuecomment-586865377)
该书原文: transactions 交易列表: ***所有入选该区块的交易的哈希值列表***,每个哈希是一个 32字节 的数据。根据哈希值,可以用客户端在以太坊节点上唯一查询该笔交易 但是根据github的geth源码: [https://github.com/ethereum/go-ethereum/blob/master/core/types/block.go#L168](url) `type Block struct { header *Header uncles []*Header transactions Transactions ...` 以及 [https://github.com/ethereum/go-ethereum/blob/6c3513c0775e1e1e69a7c9e5c86255804fa3fb36/core/types/transaction.go#L51](url) `type Transaction struct { inner TxData // Consensus contents...
不然会觉得有点啰嗦,不够简洁。
原文件启动报错:Failed to write genesis block: unsupported fork ordering: eip150Block not enabled, but eip155Block enabled at 0,增加eip150Block 启动正常。