To use Enveloping, follow these steps to build the project.
The project has on-chain and off-chain components.
contractsdirectory in the root directory, contains all the smart contracts involved in Enveloping.
yarn prepare. The changes will be reflected in the
migrations/2_deploy_contracts.jsfor deploying it.
srcdirectory contains the off-chain components such as
relayserver. Everything here is coded in
yarn tsc. The changes will appear in the
jsrelaydirectory contains files for running a Relay Server. See here for more details.
testcontains the test suite. See section below to learn how to test Enveloping.
When adding new tests, we should compile them first (with
yarn tsc) before running them.
Note: The script will start an RSK node in regtest mode and then run all the tests. So it takes some time to run the tests. You need to have
curl in order to run it.
Once the project is built, we can test it with truffle
yarn generate && npx truffle test --network rsk test/Flows.test.ts (with truffle)
To contribute to the project, create a branch with the name of the new feature you are implementing (e.g.
gas-optimization). When you commit to git, a hook is executed. The hook executes a linter and all the tests.
Common errors when testing
Ensure that you are in the project’s root directory and that the test’s name has no typos
Stop the running node and delete the db used by the node.
The relay server running in the background. Run the bash file
Go to top