1

Has anyone here used the docker version of Mythril (https://github.com/ConsenSys/mythril) and can give me a hint on how to make it work? I only get:

$ docker run mythril/myth -xa 0xc0ed3c3c725c6f3202c13fb49fb7fddb1385e62d29279a0a9a170b5251fb10a6 --rpc ganache
Could not connect to RPC server. Make sure that your node is running and that RPC parameters are set correctly.

$ docker run mythril/myth -x MyContract.sol
Input file not found: MyContract.sol

My Ganache is running my Truffle unit tests fine and MyContract.sol is in the current working directory!

1 Answer 1

3

After reading up on Docker, I found the following solutions.

To connect to a local RPC, use host.docker.internal instead of localhost. For example, Ganache listens on port 7545 by default:

docker run mythril/myth -xa 0xadf6E506c4243E9fb25EA6517017E63a2eaEBB0e --rpc host.docker.internal:7545

To analyze a local .sol file, you have to mount the directory where the file is located. If you want to analyze MyContract.sol in your current working directory, run the following command:

docker run -v $(pwd):/working-dir mythril/myth -x /working-dir/MyContract.sol
1
  • Hej Svante. Jeg faldt over din profil herinde og blev imponeret over din viden om Ethereum. Jeg ville elske at drøfte en ting med dig. Kan jeg kontakte dig privat?
    – Soggiorno
    Commented Jun 30, 2018 at 1:54

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.