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:
- Elixir 1.9+
- Erlang 22+
As for now project requires Elixir installed + chain you want to work with.
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
ExTestchain uses geth
installed in your system.
After this geth
should be available in your system.
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
For people who don't want to install everything on local machine there is Docker image provided.
All details are here
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.
For your local instance you could use make dev
command.
Be sure you installed Geth/Ganache
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 ! 👻