Skip to content

eth_compilers, eth_compileSolidity are gone in go-ethereum 1.6.0 #3793

Closed
@beatrizsanchez

Description

@beatrizsanchez

System information

Geth version: v1.6.0-unstable-6d038e76/linux/go1.7.3
OS & Version: Linux/Ubuntu 16.04.1 LTS (x86_64)
Commit hash : 6d038e7

Expected behaviour

Running eth.getCompilers() in the geth console should return an array of compilers ['solidity'] that could even be empty ( [] )

Actual behaviour

The command returns Error: The method eth_getCompilers does not exist/is not available but I have started the node with --ipcapi "admin,db,eth,debug,miner,net,shh,txpool,personal,web3" and I am able to run other eth commands. I was actually trying to execute the command via RPC with web3j and was getting an error then realized it didn't work in the console either.

> eth.compile
{
  lll: function(),
  serpent: function(),
  solidity: function()
}

Steps to reproduce the behaviour

  1. Attach the console to a running node with -ipc enabled
  2. Run eth.getCompilers()
  3. If no compilers are installed you should get [], not an error message

Activity

fjl

fjl commented on Mar 17, 2017

@fjl
Contributor

Compiling via RPC has been removed in #3740 (see ethereum/EIPs#209 for why). We will bring it back under a different method name if there is sufficient user demand. You're the second person to complain about it within 2 days, so it looks like there is demand.

changed the title [-]"Method does not exist/is not available" eth.getCompilers(), in geth console[/-] [+]eth_compilers, eth_compileSolidity are gone in go-ethereum 1.6.0[/+] on Mar 17, 2017
fjl

fjl commented on Mar 17, 2017

@fjl
Contributor

Leaving this open so other people can find this issue and raise their voice here.

beatrizsanchez

beatrizsanchez commented on Mar 17, 2017

@beatrizsanchez
Author

@fjl, Thanks for the info. It would be convenient to have it on RPC but I have the issue as well on IPC, any idea why?

fjl

fjl commented on Mar 17, 2017

@fjl
Contributor

When I say RPC I mean the IPC endpoint too. The methods have been removed by the linked PR. There is no way to invoke solc through geth at this time.

ghost

ghost commented on Mar 23, 2017

@ghost

This feature is really useful. Can we please have the compilers available?

mavstronaut

mavstronaut commented on Mar 26, 2017

@mavstronaut

Eth.compile is a great feature!

islandBilly

islandBilly commented on Mar 28, 2017

@islandBilly

I too think eth.compile is a great feature, and it was an important part of my Dapp, so that people could generate a simple contract from a web form, compile and deploy it, all without knowledge of Solididty or the need to use Mist.

kunalbansal92

kunalbansal92 commented on Apr 11, 2017

@kunalbansal92

Updated my project due to this issue ethereum/solidity#1708, And now :/

vyorkin

vyorkin commented on Apr 11, 2017

@vyorkin

Also voting for bringing it back, otherwise at least we should update the official docs and tutorials to not confuse a newcomers (like me)

RomanKrakowiak

RomanKrakowiak commented on Apr 11, 2017

@RomanKrakowiak

Living exactly the same situation as the comment above from vyorkin. Newcomer, confused by outdated official tutorial.
also, please update the private network genesis block specifications in the official documentation please :p

michiels

michiels commented on Apr 16, 2017

@michiels

Either way, the docs/website should reflect the latest state I think :) On this page https://www.ethereum.org/greeter it still assumes you're using solc.

ropod7

ropod7 commented on Apr 17, 2017

@ropod7

eth_compileSolidity, or analogue should be available over RPC . Please.

ghost

ghost commented on Apr 17, 2017

@ghost

If the old console command has to go, can we not just replace it with a similarly named function that calls a solidity compiler? It just seems sensible that it's there. Or at least, make a tutorial for writing and making solidity apps that people can follow.

I was trying to hard to learn how to use geth or ethereum or anything. All the introductions I can find use Solidity [1]. This system is hard enough to follow or install as it is without all the documentation leading us down dead ends after DAYS AND DAYS of trying to install compilers that apparently don't exist now. So how are we meant to make or deploy smart contracts? This crypto tool has amazing potential but the impossibility of learning how to use or interact with it is terrible.

I can run geth as a fast node on my windows 10 machine, and I have a command-line solc compiler on my MacBook. But I don't seem to be able to get both at once!

Windows10: For example chocolaty now doesn't work, despite tutorials telling me its by far the easiest way to get solc on Windows. If instead I run ">npm install -g solc" ([2]) it seems to work but then when I run ">solc" it just says it's not recognised as a command, program or batch file.
Running ">npm install solc" I get a series of warnings, starting with "npm WARN enoent ENOENT: no such file or directory, open 'LocalDir/package.json'".

MacBook: I think solc is working in Terminal, but without a tutorial I'm stuck with rookie errors in even compiling the "Hello World" of [1]. I describe this issue below.

[1] https://ethereum.org/greeter#getting-other-people-to-interact-with-your-code
[2] https://solidity.readthedocs.io/en/develop/installing-solidity.html


/* Rookie error with compiling my first solidity program. */
SolidityProjects$ cat helloWorld.sol
pragma solidity ^0.4.1

contract mortal {    
    /* Define variable owner of the type address*/
    address owner;

    /* this function is executed at initialization and sets the owner of the contract */
    function mortal() { owner = msg.sender; }

    /* Function to recover the funds on the contract */
    function kill() { if (msg.sender == owner) selfdestruct(owner); }
}

contract greeter is mortal {
    /* define variable greeting of the type string */
    string greeting;

    /* this runs when the contract is executed */
    function greeter(string _greeting) public {
        greeting = _greeting;
    }

    /* main function */
    function greet() constant returns (string) {
        return greeting;
    }
}

SolidityProjects$ solc helloWorld.sol 
helloWorld.sol:8:5: Error: Expected import directive or contract definition.
    function mortal() { owner = msg.sender; }
    ^
SolidityProjects$ 

alphaqiu

alphaqiu commented on Apr 19, 2017

@alphaqiu

Sorry, but how to adding my contract into the gethereum in version of geth 1.6.0?

Okey, web3.eth.contract([]).new() just still can be used.

108 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @fjl@michiels@andyl@katopz@karalabe

        Issue actions

          eth_compilers, eth_compileSolidity are gone in go-ethereum 1.6.0 · Issue #3793 · ethereum/go-ethereum