I'm running a geth node in a private network, and running swarm in singleton mode on that network. I'm deploying contracts via JSON-RPC; I'm not using JavaScript.

I run the command solc --optimize --metadata --bin -o . ./coin.sol which produces the files Coin_metadata.json and Coin.bin

The file Coin.bin contains the string:


Solidity documentation says

So in order to retrieve the data, the end of the deployed bytecode can be checked to match that pattern and use the Swarm hash to retrieve the file.

So, the Swarm hash is


My question is: What content must I upload to Swarm, via command line, to get exactly the previous hash?

I've upload all files individually and the directory containing them, but any upload produces the previous hash.

Thanks in advance.

1 Answer 1


Playing a bit more with Swarm, I found the swarm's option needed to upload the metadata and return the required hash:

swarm --manifest=false up Coin_meta.json

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.