2017-07-25 39 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

相關問題