TODO: Add description
(ExPlasma)[] is an elixir client library to interact with the OmiseGO Plasma contracts.
If available in Hex, the package can be installed
by adding ex_plasma
to your list of dependencies in mix.exs
:
def deps do
[
{:ex_plasma, "~> 0.1.0"}
]
end
You will also need to specify some configurations in your config/config.exs:
config :ex_plasma,
eip_712_domain: %{
name: "ExPlasma",
salt: "some-salt",
verifying_contract: "contract_address",
version: "1"
}
- Clone the repo to your desktop
[email protected]:omisego/ex_plasma.git
- Run
mix compile
in your terminal. - If there are any unavailable dependencies, run
mix deps.get
. If you run into any issues with libsecp256k1_source, runbrew install automake pkg-config libtool libffi gmp
in your terminal.
You can run the tests by running;
mix test
mix credo
mix dialyzer
The test suite has network requests recorded by exvcr. To record new cassettes, spin up docker:
docker-compose up
Or alternatively, you can use the make command to spin up a detached docker compose.
make up # docker-compose detached
make logs # connects to logs from docker-compose
This will load up Ganche and the plasma contracts to deploy.
To ensure we can encode/decode according to the contracts, we have a separate suite of conformance tests that loads up mock contracts to compare encoding results. You can run the test by:
make up-mocks
mix test --only conformance
This will spin up ganache and deploy the mock contracts.
We also have more integrated flows we need to test, such as the exit game. These use live interactions with the plasma framework contracts. To run those, you can execute:
make up
mix test --only integration
This will spin up ganache and deploy the plasma framework and run the integration suite.
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/ex_plasma.