Skip to content

daddyfatstacksBIG/ex_testchain

 
 

Repository files navigation

TestChain

Build Status

This is Elixir MVP implementation of Testchain as a Service.

Right now it implements this features:

  • Start/stop new chain (geth|ganache)
  • Start/Stop mining process
  • Take/revert snapshot

Other documentation:

Requirements

  • Elixir 1.9+
  • Erlang 22+

Installation

As for now project requires Elixir installed + chain you want to work with.

Installing Elixir

For NixOS you will also need to install Erlang R21 to make escript available

$ nix-env -iA nixos.erlangR22

Installing project dependencies is easy:

$ mix do deps.get, deps.compile

Will install, compile all elixir dependencies and node.js for ganache

Geth

ExTestchain uses geth installed in your system.

Installation

After this geth should be available in your system.

Ganache

Note that you have to use Node.js less than 12 Ganache wouldn't work with node.js 12 !

ExTestchain uses local ganache-cli installation.

And ganache-cli added as git module to the project and you have to check it out.

$ git submodule init
$ git submodule update

After fetching it locally you have to install dependencies (if you didn't run make deps):

$ cd priv/presets/ganache-cli
$ npm install

Docker support

For people who don't want to install everything on local machine there is Docker image provided.

All details are here

How it's working

How it's working

Building

First you need to install dependencies. For elixir project it's done using command:

$ mix do deps.get, deps.compile

To build project you can use:

$ mix compile

To run it locally:

$ iex -S mix phx.server

This command will start project locally but for using a HTTP/WS server on port 4000 you have to use makerdao/testchain-backendgateway

And it will become accessible from anywhere you need.

Running ex_testchain

For your local instance you could use make dev command. Be sure you installed Geth/Ganache

Logging

For now ExTestchain uses logger in debug mode and all messages will be printed to your CLI. To omit this uncomment logger level in apps/chain/config/config.ex

config :logger, level: :info

And recompile your project

Happy testing ! 👻

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Elixir 93.6%
  • Dockerfile 3.6%
  • Makefile 1.6%
  • Other 1.2%