is there any way to execute functions on a smart contract (as EVM-Bytecode) in a separate program like evm (provided by go-ethereum) without having to run a test-network? I need to find a way to run code multiple times so using Remix is unfortunately no option.

Thanks in advance!

  • have a look at truffle, their aim is to make ethereum development easier.
    – Malone
    Nov 27 '17 at 12:46
  • Hi there. What's the issue with running things multiple times in Remix? Why do you want to be able to run it multiple times, and how many times are we talking about? (Clarifying things might help with an answer.) Nov 27 '17 at 16:56
  • I wanted to run functions on a smart contract multiple times for testing purposes to trace bugs. Using Remix I would need to start each call manually and Web3 w/ testrpc would be too slow. Nov 29 '17 at 1:20

Truffle and Ganache seem to be an excellent combo:

  • Ganache is a standalone, in-memory node, designed for development. It can auto-mine, meaning it immediately creates and mine a block each time a transaction is submitted. This make smart contract deployment and invocation almost synchronous.
  • Truffle comes with a command line tool and console with web3 built-in, removing some of the hassle of web3 setup.
  • Truffle lets you write JavaScript tests for your contracts using Mocha and Chai. Definitely the right way to run your contracts "multiple times" :)

For whom it may interests, I used the build-in EVM of the Go-Ethereum implementation (Geth). For that I wrote my application in go and mainly used "github.com/ethereum/go-ethereum/core/vm/runtime" and github.com/ethereum/go-ethereum/core/vm" as imports. To generate a EVM-instance I used *runtime.Config and *vm.EVM. Then I used a modified version of the Create- and Call-functions demonstrated in [..]runtime/runtime.go to deploy contracts and call transactions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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