Closed beatrizsanchez closed 6 years ago
oh,my god 。I see a lot of tutorials using this!The official docs and tutorials!!!
Please update the wiki documents
EthDeployer updated to ignore (sometimes erroneous) warning messages from solc. Working again:
https://www.enledger.io/EthDeployer/
See: https://github.com/ethereum/solidity/issues/2525#issuecomment-314742767
@Tectract I upgraded the Geth version, and I'm still having problems with Metamask. It's doing the same thing as before. I am trying to take pictures of the "Developer Console", on the actual Metamask window, and the Create Smart Contract Page.
I am going to try to update truffle too. I don't know if that will help or not. I'm not entirely sure.
Thanks for all the help Tectract!
Sebastian
Sounds like a metamask problem, I suggest you start a ticket here: https://github.com/MetaMask/metamask-plugin/issues
This thread is for the issue of solc not being included in the ethereum node ;)
Not able to compile solidity code. any work around, please. I am trying with this method.
web3.eth.compile.solidity(source)
The method eth_compileSolidity does not exist/is not available
See here for working client-side code for solc compilation:
https://github.com/Tectract/EthDeployer/blob/master/src/Deploy.js
I have still not found any viable solution... This is a joke, how can they disable a function that so many people use ....
Did you look at the links I posted?
FYI i get this error in the ethereum wallet when trying to a deploy a contract through the wallet (https://wallet.ethereum.org/deploy-contract)
Thanks @k26dr - I think the "contract.sol:" in the fs.readFileSync
path should go.
Wouldn't that work with solcjs? That's way faster to install.
@hdiedrich The way the solc compiler operates on Linux, that's what works for me. I already had solc installed so I used that method. I haven't looked into solcjs
so this tutorial has been broken for FIVE MONTHS ?? can it be ??
You should start a ticket about fixing the tutorial, maybe. This one is about getting the compiling back into Geth, or figuring out workarounds for people. See my tutorial linked above. It still works.
More human hours wasted here. I agree, if it can't be fixed, fix the tutorial or add an a warning that it's outdated at least.
The tutorial has a workaround listed under "USING THE ONLINE COMPILER"
It's definitely not as slick as I imagine the compile function was, but it will get you through the tutorial
a working tutorial is essential!
For the time being, please see how I compile solidity code CLIENT-SIDE, using web3 and browser-solc, here:
https://blockgeeks.com/guides/how-to-learn-solidity/
Until they resolve the issue of solc not being included in Geth, browser-solc is the way to go.
Because geth deprecated the command-line compiler interface after version 1.6, I was puzzled for a long time.I wrote a simple tutorial to describe how to compile and deploy a contract after geth1.6. Hope this tutorial will help you. Depoly contract on the private chain
Please update the HelloWorld documentation to reflect how it is today.
As of now you can use the following command which generated .abi and .bin files which can be loaded using loadScript() locally
solc -o . --bin --abi
I am still trying to understand why this was removed. The least you could do is update all documents to reflect changes. Thanks
Add 1 hour to the pile of wasted human hours!
+1
This is a nightmare. Nothing works. Every solution I try fails. Thanks ethereum people for that crap docu and stupid changes.
So this is why https://github.com/ethereum/web3.js/blob/develop/example/contract.html#L20 not work am I right?
Anyone having difficulty compiling their code, download the Ethereum Wallet. In the Contracts tab, in the Deploy New Contract feature there's a function to compile your contract before uploading it to the Blockchain.
7 months later and still no eth.compile.solidity() function nor an update on the tutorial. Shame.
@zachgoll I commented above, use the compiler in Ethereum Wallet
i demand for it
I haven't read through all along this thread, but, I have to say that, the SDKs of Java/.Net CLR, always provide compiler with runtime together. I thought it is practical standard for programming runtime. And a lot of document is out-of-date, if you remove this important feature, can you just push an update of doc at the same time? This is like a distributed transaction failure causing inconsistency.
Seems odd to remove something that the tutorials depend on, what is the work around for this, to get started with a contract have to start somewhere, if can't get a Hello World example to work because of this it makes it hard to get going
WORKAROUND: https://www.youtube.com/watch?v=cRg2m2A2NGM
Anyone knows where is the source code of this page: https://www.ethereum.org/greeter and who can fix the glaring error? cc: @vbuterin
Working update as of 4th December 2017:
Alright everyone... let's calm down... languages like C++ (and respective communities) have been around for decades, Solidity has been around for years... the newest version at that, for just months. Plus, the Ethereum Foundation team, which is probably in charge of changes like this, is literally 3 people. Sheesh, give 'em a break.
With that said, all you need for the greeter example to compile is the solc
command line tool:
npm install -g solc
Then, you can use the command line tool from solc
to compile to binary:
***NOTE: on the command line, the command is solcjs
NOT solc
!!!
solcjs --bin --abi --optimize -o bin hello_world.sol
(I named my solidity file hello_world.sol
)
And pit pat piffy wing wong wang just like that1, you've got your compiled binaries and contract ABIs in the folder bin/
:
hello_world_sol_greeter.bin
hello_world_sol_greeter.abi
hello_world_sol_mortal.bin
hello_world_sol_mortal.abi
BONUS: to get perfect linting for the code (the original example will compile just fine, but with warnings), add public
to the top two functions and the last function, and pragma
on the first line. The final code then looks like this:
pragma solidity ^0.4.19;
contract mortal {
/* Define variable owner of the type address */
address owner;
/* This function is executed at initilization and sets the owner of the contract */
function mortal() public { owner = msg.sender; }
/* Function to recover the funds on the contract */
function kill() public { if (msg.sender == owner) selfdestruct(owner); }
}
contract greeter is mortal {
/* Define variable gretting of the type string */
string greeting;
/* This runs when the contract is executed */
function greeter(string _greeting) public {
greeting = _greeting;
}
/* Main function */
function greet() public constant returns (string) {
return greeting;
}
}
Note that the official site still documents the method, though.
Please bring back the feature, it's very useful for any kind of projects
Internet is full of examples with eth_compileSolidity used in compile function, so now every newbie trying to learn from examples on the web is failing. Some people just think its all about the code and can't think outside the box, it's not about the code but its about the people so whoever orchestrated this change has failed. You should first find out how people are using something you are about to change and how much are they using it and then carefully plan how to change it and also inform people where change is about to happen to change the code. This is not a way how to treat an open source project of this importance or maybe people o charge think it is but I think it just sucks for community.
These are from the days when the compiler was coupled to the RPC layer...which imho is a big no no. But we had a big EIP discussion about this...someone feel free to take up the charge on the EIP.
I'm giving up entirely on Ethereum. It was a nice idea but it's become just another cryptocurrency like bitcoin and wasted its chance to be a great distrubuted computing language due to infuriating barriers to entry. I'm a moderaderly good python, C++ and C# programmer and have a PhD in Cyber Security, but for the life of me I can't get to grips with this ruddy software. Come back when you've got a working and accessible API to write and deploy DAPPs, add funds, check balances and search and use other DAPPs.
please see how I compile solidity code CLIENT-SIDE, using web3 and browser-solc, here:
https://blockgeeks.com/guides/how-to-learn-solidity/
relevant source code is here:
https://github.com/Tectract/EthDeployer/blob/master/src/Deploy.js
This should be the standard until solc is added back into GETH, if ever, imho. My article was recently translated to Chinese too :)
If you just need to compile and deploy a contract, you can use the tool I wrote, running here:
https://www.enledger.io/EthDeployer/
Using Metamask and Chrome. It's not flawless, but I did recently updated it to handle deployment of ERC20 contracts.
If the method is not supposed to exist, it should probably not be mentioned at https://github.com/ethereum/go-ethereum/wiki/Contract-Tutorial
Is this normal:
> eth.getCompilers()
Error: The method eth_getCompilers does not exist/is not available
at web3.js:3143:20
at web3.js:6347:15
at web3.js:5081:36
at <anonymous>:1:1
If the method is not supposed to exist, it should probably not be mentioned at https://github.com/ethereum/go-ethereum/wiki/Contract-Tutorial
And probably the official doc: https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_compilesolidity ? a little bit frastrated :(
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 : 6d038e76
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 othereth
commands. I was actually trying to execute the command via RPC withweb3j
and was getting an error then realized it didn't work in the console either.Steps to reproduce the behaviour
eth.getCompilers()
[]
, not an error message