trustless-generic-relayer/ethereum/ts-scripts
chase-45 2ea98eaa8d
Typescript SDK (#79)
* sdk additions, query delivery status functions

* import fixes

* imports

* Fixes for getDeliveryStatusBySourceTx

* Fix typo in invalidRedeliveryTopics

* Use negative number feature of queryFilter

* 2047 -> 2040

* WIP

* Typescript test for statusByTx

* small changes

* revert reason WIP

* continued WIP for getting revert reason

* Remove reason parsing

* WIP adding default RPCs

* compiles

* SDK nicely prints delivery information!

* SDK nicely prints delivery information!

* Change error msg

* Tests pass, including test for resending a failed forward!

* Enum

* update SDK in relayer engine

* remove testgovernance file

* Nice error logging around not finding a delivery

* Update relayer engine sdk

* Respond to PR comments

* Fix test

* fixed new lines

* helper

---------

Co-authored-by: derpy-duck <115193320+derpy-duck@users.noreply.github.com>
2023-03-15 15:32:33 -07:00
..
config Continuously send messages to create load (#118) 2023-03-14 10:45:03 -07:00
coreRelayer Forwarding test passes! 2023-02-14 14:08:21 -05:00
helpers Typescript SDK (#79) 2023-03-15 15:32:33 -07:00
mockIntegration Continuously send messages to create load (#118) 2023-03-14 10:45:03 -07:00
relayProvider set buffer and denom in configureRelayProvider 2023-01-27 15:01:50 -07:00
shell
.env.tilt
README.md
tsconfig.json

README.md

How to use these scripts

Configuration

Private keys should be placed in a .env file corresponding to the Environment you intend to work in. For example, tilt private keys should be kept in ./.env.tilt

If you do not set an environment, the 'default' environment will be used, and .env will be read.

All other configuration is done through files in the ./config/${env} directory.

./config/${env}/chains.json is the file which controls how many chains will be executed against, as well as their RPC and basic info.

./config/${env}/contracts.json is the file which allows you to target specific contracts on each chain.

./config/${env}/scriptConfigs contains custom configurations for individual scripts. Not all scripts have custom arguments.

Running the scripts

All files in the coreRelayer, relayProvider, and MockIntegration directories are runnable. These are intended to run from the /ethereum directory.

The target environment must be passed in as an environment variable. So, for example, you can run the RelayProvider deployment script by running:

ENV=tilt ts-node ./ts-scripts/relayProvider/deployRelayProvider.ts

Chaining multiple scripts

Scripts are meant to be run individually or successively. Scripts which deploy contracts will write the deployed addresses into the ./output folder.

If "useLastRun" is set to true in the contracts.json configuration file, the lastrun files from the deployment scripts will be used, rather than the deployed addresses of the contracts.json file. This allows you to easily run things like

ENV=tilt ts-node ./ts-scripts/relayProvider/upgradeRelayProvider.ts && ts-node ./ts-scripts/mockIntegration/messageTest.ts

The ./shell directory contains shell scripts which combine commonly chained actions together.

For example, ./shell/deployConfigureTest.sh will deploy the RelayProvider, CoreRelayer, and MockIntegration contracts. Configure them all to point at eachother, and then run messageTest to test that everything worked. Note: useLastRun in contracts.json needs to be set to "true" in order for this script to work.