gnidan / docker-eth-dev

Hacking together a containerized environment for Ethereum development with Truffle using Parity
22 stars 5 forks source link
docker eth-dev ethereum nginx-proxy parity testrpc truffle wrapper-binaries

docker-eth-dev

Join the chat at https://gitter.im/gnidan/docker-eth-dev

Multi-container development environment for building dapps on test chains

Background / Goals

I'm trying to find a suitable solution to the problem of having to run switch between running Ethereum nodes and running dapps. Most of the programs all use the same few ports and don't work together quite so well out of the box.

Docker Compose seems like a reasonable solution - by setting up a virtual network of containers for individual services, and wrapping it behind a web proxy, it should remove a lot of the overhead of process and dependency management.

This project also aims to create a collection of custom wrapper binaries around the supported services, to maintain the interface of local development while everything runs virtualized and separated from localhost.

Overview

This repository is currently a WIP attempt to get a sane (to me?) Ethereum dev environment up and running inside docker-compose.

Dev tools include:

Dependencies

Getting Started

  1. Clone this repository somewhere to be your docker-eth-dev home directory ($ETH)

    git clone https://github.com/gnidan/docker-eth-dev.git <dir>

    This directory will contain the contents of this repository:

    • containers configuration
    • wrapper binaries
    • dapps top-level directory
      • example dapp (the truffle init result, reconfigured)
    • this README
  2. Activate shell environment

    source <dir>/bin/activate.sh

    This aliases all the wrapper binaries so they're available for us in the shell.

  3. Create Docker volume for Ropsten Parity

    docker volume create --name=parity-testnet-data

    This creates a persistent volume so that the Ropsten account information/ chain data does not get lost when the containers are stopped.

  4. Start Docker containers

    docker-compose up -d

    This runs nginx, testrpc, and parity-testnet inside containers. Port 80 will be opened on localhost for nginx's proxy.

  5. Add parity-testnet.ethereum to your /etc/hosts file, pointing locally or at your docker-machine

    This is so that nginx may recognize the resource you are trying to reach.

  6. Visit http://parity-testnet.ethereum/ in your browser.

  7. Run parity-testnet signer new-token in your active env shell.

    In case Parity Wallet needs to authenticate with the running parity-testnet container.

  8. Note: In case anything stops working, I find that restarting docker-compose from scratch seems to help:

    docker-compose down
    docker-compose up -d

What Else?