Code Monkey home page Code Monkey logo

ddapptools's Introduction

DDapptools, aka Docker-Dapptools

DockerHub Publish CI

A docker version of the ๐Ÿ’Š of solidity development.

The container lives here on DockerHub.

Instructions

The docker image is a drop-in replacement for dapptools.

In order for the container to function as a drop-in replacement, it must do 3 things:

  • Have access to the same env context as the dev machine
  • Have access to the files in the directory from which it's invoked
  • Use the same command without having to mess with docker internals

To satisfy all 3 requirements, we run:

if [[ -e ".env" ]];then
  SOURCE_COMMAND="source .env"
else
  SOURCE_COMMAND=""
fi
docker run -it --env "$(env | grep -v 'NIX|TERM')" --name ddapptools --mount type="bind",source="$(pwd)",target=/dapptools odyslam/ddapptools:latest $SOURCE_COMMAND && $@
docker stop ddapptools > /dev/null
docker rm ddapptools > /dev/null

These commands have been packaged into ddapp.sh. To invoke seth we run ddapp.sh seth.

It's a helper script that does the following:

  • Creates a container from the odyslam/ddapptools image
  • Mounts the $(pwd) (the current) directory to that container
  • Deletes the container after use

Example

If you use gakonst/dapptools-template as the basis for your project:

  • Clone this repository (odyslam/ddapptools) to your dev machine. Let's say you clone it in ~/code/ddapptools.
  • cd into thedapptools-template directory
  • run ~/code/ddapptools/scripts/ddapp.sh make test
  • Deploy the contract and test it with ~/code/ddapptools/scripts/ddapp.sh seth send 0x42... "Greeter(uint256)" 345

Troubleshooting

Mounting directories with Docker Desktop

If you use Docker Desktop, there are settings regarding the directories that you allow docker to mount to containers. You can read more about this on Docker's documentation, in the user manual of the platform that you are using (Windows/MacOS/Linux).

Hardware wallet support

  • Linux: It should be supported, due to the --privileged flag that is used to run the container. It hasn't been tested.
  • MacOS: It's not supported. This is because currently Docker Desktop for Mac does not support USB passthrough. The container simply can't see the usb devices.
  • Windows: Unknown

Ethsign keystores

ddapp.sh will automatically mount the default keystore directories that ethsign uses, if they are detected to exist. That means that the dev machine and the ddapptools container will share the same keystores that will persist between subsequent runs of ddapp.sh as they are stored on the dev machine, via the container.

It will mount the first keystore that is detected, with the following order:

  • Detect $ETH_KEYSTORE env variable
  • Detect existence of $HOME/Library/Ethereum/keystore
  • Detect existence of $HOME/.ethereum/keystore

The directory will be mounted inside the container at the following directory: /root/.ethereum/keystore.

Contributing

Yes

License

MIT

TODO

  • Install dapptools in container
  • create drop-in replacement container as CLI for dapptools
  • create full-fledged devenv that user can ssh into and develop

ddapptools's People

Contributors

odyslam avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.