2017-07-25 41 views
-1

ENV: 测试-RPC 松露错误:方法eth_compileSolidity不支持

代码: 令源=“编译指示坚固^ 0.4.11;合同计算值{UINT计数;功能添加(UINT一个,UINT b)中返回(uint){count ++;返回a + b;}函数getCount()返回(uint){return count;}}“;

let calc = web3.eth.compile.solidity(source);

终端告诉我: 松露(开发)>错误:错误:不支持方法eth_compileSolidity。在GethApiDouble.handleRequest(/Users/user/.nvm/versions/node/v6.10.3/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:101870:16) ......

+0

我不确定是否它的弃用..请检查下面的链接https://github.com/ethereum/EIPs/issues/209。如果你想获得合同的ABI /二进制文件,你可以使用混音。 – Rangesh

回答

1

我想你试图获得合同的ABI和/或字节码。 WEB3库(你在松露控制台需要然后实例WEB3提供商)的版本,因为没有web3.eth.compile.solidity()1.6.0

这里描述编译使用混合与SOLC编译方式:https://ethereum.stackexchange.com/questions/15435/how-to-compile-solidity-contracts-with-geth-v1-6

当松露编译你的代码时,它使用一些固定版本的solc(取决于松露版本)。对于松露3.2.5 solc 0.4.11 + commit.68ef5810.Emscripten.clang使用。这是如何获得当前版本的松露solc(它需要知道当你在Etherscan verifying code):https://ethereum.stackexchange.com/questions/18133/how-do-i-find-the-exact-solidity-compiler-version-used-by-truffle

相关问题