-
Notifications
You must be signed in to change notification settings - Fork 20.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
common/compiler: add metadata output for solc > 0.4.6 #3786
Conversation
Metadata is provided as JSON string, rather than as JSON object. This ensures that we can decode to a set of bytes that will be consistent with the swarm hash embedded in the code, without worrying about ambiguities of spacing, ordering, or escaping.
@fjl thanks! |
@fjl Oh, shoot. Tried to test under jsonrpc, it didn't work, noticed the previous commit and then your note. That's a problem for me, as I've put some time into building a development tool that expects compilation as a JSON-RPC service. I'm unhappy, but I guess I'll have to deal. Thanks for your help. |
Please read the reasoning in ethereum/EIPs#209. I can see both sides. |
@fjl if you do bring JSON-RPC support back under a different name, please let me know (and take this as encouragement!) |
I did read it, and can see both sides too. My tool is written in Scala, https://github.com/swaldman/sbt-ethereum It basically plugs solidity compilation into It's very nice, from my perspective, to have the environment's sole unmanaged dependency be the existence of a running geth node. It would allow me to publish builds that are reproducible with no external dependencies except a running node, which I can host, and an installed JVM (which Oracle makes easy even for nontechnical users). I mean to template apps this way, not gigantic dApps with pretty GUIs and token sales, but small smart contracts users can modify and deploy to enter into economic relationships with people that they know. Requiring people to download Thanks again. |
Maybe you can use the wrapper provided by EthereumJ (see https://github.com/ethereum/ethereumj/blob/develop/ethereumj-core/src/test/java/org/ethereum/solidity/CompilerTest.java) |
Thanks for the suggestion. I do appreciate all your help. Wrapping |
You can also run the JS version of solc with Rhino. But that would add a dependency too ;) |
Yup! I'm not sure that'd be easier for users. I can write my own network service just to compile solidity, but it was sure nice when you guys did that for me! |
Out of interest, how did you provide it so far? I mean, did you run geth on a public endpoint to provide the compileSolidity API? |
Yeah, it's up and available at http://ethjsonrpc.mchange.com:8545/ A trivial wrapper one can use to just execute a shell script and then "conveniently" interact with the blockchain by command line is here. It'll download and install all JVM-based external dependencies upon first execution, and just work without further ceremony. (An installed JVM is the only dependency.) "Conveniently" is in quotes because right now there are too many commands. A user types |
So, I've added a long complaint to the EIP... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM. Abigen works with it (without it too). Not sure how better to test is.
Metadata is provided as JSON string, rather than as JSON object. This
ensures that we can decode to a set of bytes that will be consistent
with the swarm hash embedded in the code, without worrying about
ambiguities of spacing, ordering, or escaping.
This PR is a resubmit of #3606 with additional fixes.