To use Enveloping, follow these steps to build the project.
The project has on-chain and off-chain components.
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 Getting Started 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.
yarn generate && npx truffle test --network rsk test/Flows.test.ts
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.
Running a test throws the
Error: Cannot find module 'directory-to-the-project/enveloping/rsknode/test/Flows.test.ts'
Ensure that you are in the project’s root directory and that the test’s name has no typos
Running Flows.test.ts test throws the error: http://localhost:8090 => Error: local view call to ‘relayCall()’ reverted: view call to ‘relayCall’..
Stop the running node and delete the db used by the node.
Running some test and one of them throws:
Error: listen EADDRINUSE: address already in use :::8090
The relay server running in the background. Run the bash file
Go to top