• Stars
    star
    210
  • Rank 187,585 (Top 4 %)
  • Language
    Elixir
  • License
    Apache License 2.0
  • Created over 6 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

OMG-Network repository of Watcher and Watcher Info

The elixir-omg repository contains OMG Network's Elixir implementation of Plasma and forms the basis for the OMG Network.

Build Status Coverage Status

IMPORTANT NOTICE: Heavily WIP, expect anything

Table of Contents

Getting Started

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:

make init_test

It creates a file ./localchain_contract_addresses.env. It is required to have this file in current directory for running any docker-compose command.

docker-compose up

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

Troubleshooting Docker

You can view the running containers via docker ps

If service start up is unsuccessful, containers can be left hanging which impacts the start of services on the future attempts of docker-compose up. 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-childchain, make docker-watcher and make docker-watcher_info.

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:

make init_test

Testing & development

Docker building of source code and dependencies used to directly use common mix folders like _build and deps. To support workflows that switch between bare metal and Docker containers we've introduced _build_docker and deps_docker folders:

sudo rm -rf _build_docker
sudo rm -rf deps_docker

mkdir _build_docker && chmod 777 _build_docker
mkdir deps_docker && chmod 777 deps_docker

Pull in the compatible Plasma contracts snapshot:

make init_test

You can setup the docker environment to run testing and development tasks:

docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.datadog.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:

cd app && mix deps.get

Quick test (no integration tests):

mix test

Longer-running integration tests (requires compiling contracts):

mix test   --only integration

For other kinds of checks, refer to the CI/CD pipeline (https://app.circleci.com/pipelines/github/omgnetwork/elixir-omg) or build steps (https://github.com/omgnetwork/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

Running integration cabbage tests

Integration tests are written using the cabbage library and they are located in a separated repo - specs. This repo is added to elixir-omg as a git submodule. So to fetch them run:

git submodule init
git submodule update --remote

Create a directory for geth:

mkdir data && chmod 777 data

Make services:

make docker-watcher
make docker-watcher_info

Start geth and postgres:

cd priv/cabbage
make start_daemon_services-2

If the above command fails with the message similar to:

Creating network "omisego_chain_net" with driver "bridge"
ERROR: Pool overlaps with other one on this address space

try the following remedy and retry:

make stop_daemon_services
rm -rf ../../data/*
docker network prune

Build the integration tests project and run tests:

cd priv/cabbage
make install
make generate_api_code
mix deps.get
mix test

Running reorg cabbage tests

Reorg tests test different assumptions against chain reorgs. They also use the same submodule as regular integration cabbage tests.

Fetch submodule:

git submodule init
git submodule update --remote

Create a directory for geth nodes:

mkdir data1 && chmod 777 data1 && mkdir data2 && chmod 777 data2 && mkdir data && chmod 777 data

Make services:

make docker-watcher
make docker-watcher_info

Start geth nodes and postgres:

cd priv/cabbage
make start_daemon_services_reorg-2

Build the integration tests project and run reorg tests:

cd priv/cabbage
make install
make generate_api_code
mix deps.get
REORG=true mix test --only reorg

Working with API Spec's

This repo contains gh-pages branch intended to host Swagger-based API specification. Branch 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 architecture

Details about the repository, code, architecture and design decisions are available here.

More Repositories

1

plasma-mvp

OmiseGO's research implementation of Minimal Viable Plasma
Python
564
star
2

ewallet

eWallet Backend for the OmiseGO SDKs.
Elixir
323
star
3

plasma-cash

Python
122
star
4

plasma-contracts

Root chain contracts for Plasma
JavaScript
113
star
5

airdrop

Python
83
star
6

research

43
star
7

omg-js

JavaScript Library for communication with OMG network
JavaScript
42
star
8

optimism-v2

ARCHIVE of monorepo implementing Boba, an L2 Compute solution built on Optimistic Ethereum - active repo is at https://github.com/bobanetwork/boba
Go
40
star
9

ios-sdk

OmiseGO iOS SDK for integrating with eWallet Server.
Swift
31
star
10

ex_ulid

Universally Unique Lexicographically Sortable Identifier (ULID) in Elixir
Elixir
29
star
11

web-wallet

JavaScript
24
star
12

android-sdk

OmiseGO Android SDK for integrating with Wallet API Server.
Kotlin
18
star
13

sample-ios

Sample iOS application for loyalty point server and OmiseGO Wallet Server.
Swift
15
star
14

honted

OmiseGO node on Tendermint.
Elixir
12
star
15

community-points

Community points monorepo
JavaScript
11
star
16

js-starter-kit

Vue
11
star
17

ex_plasma

Elixir library for the OMG Plasma Contracts Transaction Format
Elixir
10
star
18

dev-portal

OmiseGO Developers Portal
JavaScript
8
star
19

salty

Elixir wrapper for enacl and libsodium.
Elixir
8
star
20

plasma-cli

Go
8
star
21

ruby-sdk

OmiseGO Ruby SDK for integration with Wallet Server.
Ruby
8
star
22

pos-client-android

Kotlin
7
star
23

sample-server

OMGShop, a.k.a Sample Server: sample loyalty points with OmiseGO eWallet Server integration.
Ruby
6
star
24

potterhat

Like Babel fish but you canโ€™t put into your ears
Elixir
6
star
25

pos-merchant-android

Kotlin
6
star
26

OIP

OmiseGO Improvement Proposal
6
star
27

sample-android

Sample Android application for loyalty point server and OmiseGO Wallet Server.
Kotlin
6
star
28

omg-childchain-v2

pronounced /Ch-ch/
Elixir
5
star
29

omg-samples

OMG Network code samples
4
star
30

specs

OMG Network Specs, Integration, Performance, Stress Testing
Elixir
4
star
31

goban

Development environment bootstrapper for OmiseGO projects using Vagrant and Ansible.
Shell
4
star
32

omg-js-samples

Code samples for omg-js library
JavaScript
3
star
33

omgx_wallet

web wallet for OMGX
JavaScript
3
star
34

omg-block-explorer

a mysterious place where you can see transactions data.
JavaScript
3
star
35

pos-client-ios

Swift
3
star
36

pos-merchant-ios

Swift
3
star
37

roadmap

2
star
38

quasar-services

JavaScript
1
star
39

boba-mainnet-addresses

[Boba Network]Mainnet Contract Addresses
1
star
40

omg-quasar-js

JavaScript
1
star
41

safe-gnosis

A full service docker compose setup and container building repo
Shell
1
star
42

omg-js-testrunner

Dockerfile
1
star
43

omgx_contracts

OMGX smart contracts
TypeScript
1
star
44

xomg-vagrant

Vagrant setup for elixir-omg
Shell
1
star
45

omgnetwork.github.io

Developer Portal for OMG Network
HTML
1
star
46

e2e

Acceptance Tests for eWallet.
RobotFramework
1
star
47

contractexchanger

Python
1
star
48

mobile-wallet

JavaScript
1
star
49

omgx_contracts-analyzer

ARCHIVED - see /omgnetwork/optimism/packages/omgx for the active repo. Sushi on OMGX - An example of contract changes needed to run a non-trivial system on OMGX
Solidity
1
star