Go-ethereum: Unable to attach solc to geth console

Created on 6 Jun 2017  路  7Comments  路  Source: ethereum/go-ethereum

System information

Geth version: V1.6.5 stable
OS & Version: Linuc 16.04
Commit hash : NA

Expected behaviour

When I run the command admin.setSolc("/usr/bin/solc/") in my geth console to link the solidity compiler it shows the following error " TypeError: 'setSolc' is not a function at :1:1"

Actual behaviour

After running the above command eth.getCompilers() must show the output as ['Solidity'] but it shows as "Error: The method eth_getCompilers does not exist/is not available
at web3.js:3104:20
at web3.js:6191:15
at web3.js:5004:36
at :1:1"

Steps to reproduce the behaviour

For me its just:
1) install geth
2)run the geth console command
3)admin.setSolc("path to the solc")

Description :
I have read somewhere that the Geth version 1.6.5 doesnt have this linking available but how do I use the solc compiler? Please let me know at the earliest.

inactive

Most helpful comment

I subscribe. For people preferring low level usage instead of higher level user friendly tools is a must to have this capability back. Personally I'm blocked without it.

All 7 comments

Please bring it back. We need functionality upload smart contract from dapp, and compile it. So the compiler need to be accessible from web3 interface.

I subscribe. For people preferring low level usage instead of higher level user friendly tools is a must to have this capability back. Personally I'm blocked without it.

I support. This change breaks back compatibility of existing apps and makes many existing tutorials outdated and worse - misguiding. This change in API increase learning curve which might has negative (or even fatal) impact on community growth if tech still on early adopter phase.

Right. The examples must be up to date with current API supported level otherwise people will develop shortly frustration and move away, and that's by far not positive for a tech still on early adopter phase and facing already aggressive competition. For example, the 'eth_getCompilers' operation seems to have been removed and the documentation not updated. See https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getcompilers

curl -d '{"jsonrpc":"2.0","method":"eth_getCompilers","params":[],"id":1}' -H 'content-type:application/json;' http://localhost:8545
{"jsonrpc":"2.0","id":1,"error":{"code":-32601,"message":"The method eth_getCompilers does not exist/is not available"}}

Another one. It seems the decision was made to drop support of compiling smart contracts in the GETH client itself. Curious how Parity supports this use cases - I'll research.
https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_compilesolidity
curl -d '{"jsonrpc":"2.0","method":"eth_compileSolidity","params":["contract test { function multiply(uint a) returns(uint d) { return a * 7; } }"],"id":1}' -H 'content-type:application/json;' http://localhost:8545
{"jsonrpc":"2.0","id":1,"error":{"code":-32601,"message":"The method eth_compileSolidity does not exist/is not available"}}

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vogelito picture vogelito  路  3Comments

prene picture prene  路  3Comments

keitaj picture keitaj  路  3Comments

leonzhao picture leonzhao  路  3Comments

freshonline picture freshonline  路  3Comments