elixir-omg repository contains OmiseGO's Elixir implementation of Plasma and forms the basis for the OMG Network.
IMPORTANT NOTICE: Heavily WIP, expect anything
Table of Contents
- Getting Started
- Installing Plasma contract snapshots
- Testing & development
- Working with API Spec's
A public testnet for the OMG Network is coming soon. However, if you are brave and want to test being a Plasma chain operator, read on!
Service start up using Docker Compose
This is the recommended method of starting the blockchain services, with the auxiliary services automatically provisioned through Docker.
Before attempting the start up please ensure that you are not running any services that are listening on the following TCP ports: 9656, 7434, 7534, 5000, 8545, 5432, 5433. All commands should be run from the root of the repo.
To bring the entire system up you will first need to bring in the compatible Geth snapshot of plasma contracts:
To bring only specific services up (eg: the childchain service, geth, etc...):
docker-compose up childchain geth ...
(Note: This will also bring up any services childchain depends on.)
To run a Watcher only, first make sure you sent an ENV variable called with
INFURA_API_KEY with your api key and then run:
docker-compose -f docker-compose-watcher.yml up
You can view the running containers via
If service start up is unsuccessful, containers can be left hanging which impacts the start of services on the future attempts of
You can stop all running containers via
docker kill $(docker ps -q).
If the blockchain services are not already present on the host, docker-compose will attempt to pull the latest build coming from master.
If you want Docker to use the latest commit from
elixir-omg you can trigger a fresh build by building all three services with
make docker-watcher and
Install on a Linux host
Follow the guide to install the Child Chain server, Watcher and Watcher Info.
Installing Plasma contract snapshots
To pull in the compatible snapshot for Geth:
Testing & development
Docker building of source code and dependencies used to directly use common
mix folders like
deps. To support workflows that switch between bare metal and Docker containers we've introduced
You can setup the docker environment to run testing and development tasks:
docker-compose -f docker-compose.yml -f docker-compose.dev.yml run --rm --entrypoint bash elixir-omg
Once the shell has loaded, you can continue and run additional tasks.
Get the necessary dependencies for building:
Pull in the compatible Plasma contracts snapshot:
Quick test (no integration tests):
Longer-running integration tests (requires compiling contracts):
mix test --trace --only integration
For other kinds of checks, refer to the CI/CD pipeline (https://circleci.com/gh/omisego/workflows/elixir-omg) or build steps (https://github.com/omisego/elixir-omg/blob/master/.circleci/config.yml).
To run a development
iex REPL with all code loaded:
MIX_ENV=test iex -S mix run --no-start
Working with API Spec's
This repo contains
gh-pages branch intended to host Swagger-based API specification.
gh-pages is totally diseparated from other development branches and contains just Slate generated page's files.
See gh-pages README for more details.
More details about the design and arhitecture
Details about the repository, code, arhitecture and design decisions are available here.