7

How do I compile a solidity file (e.g. 05_greeter.sol) from the command-line into bytecode?

Without using IDE such as Mix.

1 Answer 1

2

Instructions are well documented here, the steps would be

  1. Make sure solidity is recognised by your geth installation eth.compile.solidity("")
  2. Let us take this simple contract source: source = "contract test { function multiply(uint a) returns(uint d) { return a * 7; } }"
  3. Compile it contract = eth.compile.solidity(source).test
  4. Deploy it

Compile .sol files directly

See How to load Solidity source file into geth. Or you can use tools like Truffle to deploy it. In truffle you can create a contract and deploy it via commands.

0

Your Answer

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

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