Giter Club home page Giter Club logo

eth-dev's Introduction

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:

  • truffle to build/deploy contracts
  • testrpc to run a "dev" blockchain
  • parity (against Ropsten) for live testing

Dependencies

  • Requires Docker. (tested version 1.13.0-rc2, build 1f9b3ef)
  • May require Docker Compose also, depending on your Docker installation.

Getting Started

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

    git clone https://github.com/gnidan/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=ropsten

    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-ropsten inside containers. Port 80 will be opened on localhost for nginx's proxy.

  5. Add parity-ropsten.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-ropsten.ethereum/ in your browser.

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

    In case Parity Wallet needs to authenticate with the running parity-ropsten 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?

  • Dapps should live in separate directories in $ETH/dapps for truffle to behave as expected

  • truffle serve configuration could use some love and might not work right.

  • This env works by setting alises - if necessary, you can do \truffle, etc.

  • This opens port 80 locally. That's currently hardcoded in. I'm looking for ways around this, or to make it easier to deal with.

  • I have no idea if configuring Parity behind an nginx proxy is wildly unsafe, hence why it's only set up to do Ropsten right now.

    At the very least, though, I will say that Parity tries very hard to prevent you from configuring it this way.

eth-dev's People

Contributors

gnidan 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.