Features

Hydra overview
Automated

Write automated tests for your smart contracts in Typescript or Javascript. Use Hydra to bootstrap your smart contract test case definition.

Simple test execution

Never have to manage a local/development blockchain for your smart contract tests. We run a modified EOSIO Virtual Machine on our backend which is specifically desgined for testing.

Easy contract table setup

Easily configure the test environment your smart contract runs in by loading initial contract table data from JSON files.

Multi-OS

Works everywhere you do; on MacOS, Linux, and unlike EOSIO, we also support Windows.

Massive number of tests

Want to run 10s or 100s of variants of test inputs? No problem, we have you covered. We take care of running the infrastructure so that you don’t need to spin up multiple nodeos sessions.

Debug deployed smart contracts

Hydra accepts EOSIO snapshots which means you can quickly recreate the conditions that lead to a bug on a publicly deployed smart contract.

What Users say about us

Using Hydra, we were able to write 350+ tests for AtomicAssets in significantly less time than compared to the normal nodeos and cleos test scripts. With Hydra we can see a huge improvement in the quality and coverage of our tests.


...

We have developers across the world and they can't easily run Dockerised tests. With Hydra, they don't need any special infrastructure and they can get up and running quickly. We also really like the ability to easily feed oracle information into tests and reset database entries.


...
Aaron Caswell, Blockchain Engineer, WAX

How?


Install Hyra client

npm i -g @klevoya/hydra

Login to your account

hydra login


Bootstrap your test case definitions

hydra init

Write your test case

Using JavaScript/TypeScript and the testing library of your choice.
(We support Jest out of the box.)


Run your tests against Hydra server

npm test

Read the docs
Get Started Now

Frequently Asked Questions

How is Hydra different to running nodeos?
Hydra is a tiny JavaScript testing framework for EOSIO smart contracts. It does not come with its own WebAssembly VM to run transactions, instead it communicates with a backend running a slightly-modified EOSIO nodeos node which is specifically desgined for testing: We are not concerned with CPU/NET/RAM resource restrictions of individual accounts or with producing blocks. Instead, we use our backend to run transactions using the EOSVM while accurately emulating the rest of the EOSIO software.

nodeos is the full-fledged EOSIO node developed by Block One.

Hydra comes with an intuitive API and many convenience features (e.g. CLI to bootstrap tests, loading of smart contract tables from JSON files) that allow you to very easily write tests for your smart contracts.

The biggest convenience feature in our opinion is not having to set up and configure a local blockchain at all, which would require significant infrastructure to recreate.

We spend our time on the tooling, so you don’t have to.

If you would still like to see a feature that is currently missing in Hydra, please contact us.

All other EOSIO testing tools are just a wrapper on top of your local EOSIO node’s chain_api. This means you are still required to have EOSIO installed locally, correctly set up, and ensure it is running whenever you run your tests.

Some testing frameworks try to hide this fact by including EOSIO as a docker container as part of their toolset, however you are still restricted to all the limitations and disadvantages of running a local blockchain:

  • Require EOSIO and/or Docker to be installed on your system, making it infeasible to run on low-resource systems like CI pipelines.
  • Running a local blockchain requires significant CPU and storage resources, slowing down the rest of your system.
  • Cannot run tests in parallel because all operate on the same local blockchain node.
  • You are restricted to the 500ms block production time, even though your transactions might run in microseconds.

The approach we have taken with Hydra is fundamentally different: While we have similar APIs to existing testing tools, we offer additional convenience features and eliminate all of the drawbacks of running a local blockchain by running a modified EOSIO node on our backend which is specifically desgined for testing: We are not concerned with CPU/NET/RAM resource restrictions of individual accounts or with producing blocks. Instead, we use our backend to run transactions using the EOSVM while accurately emulating the rest of the EOSIO software.

We currently support EOSIO v2.0.3. New versions will be available as and when they are released.
We run an unmodified EOSVM, but a fork of the EOSIO software removing features that are not necessary for our use case of executing transactions, such as block production and CPU/NET/RAM and other resource billing. Other than that we run the original EOSIO code with all of its checks.
We are a small team who are passionate about helping developers deliver secure and tested smart contracts.
Hydra supports all smart contract features with all EOSIO WASM intrinsics. But we do not support:
  1. Block production: The block time and block number are always 0, but can be mocked using our testing framework.
  2. Detailed modelling of RAM/CPU and NET per account usage limits. However, we do support transaction traces including transaction execution time.
  3. Running Deferred transactions: Deferred transactions are not automatically executed after the stated delay. Instead, you can get a list of all scheduled transaction and can then decide to run them manually in your test cases. Note that deferred transactions are deprecated and are not guaranteed to run even under normal conditions.
We plan to offer Service Level guarantees for our paid plans.

If you have deeper questions about our infrastructure, robustness, or would prefer a custom SLA, feel free to get in touch.