⚠️ This project is deprecated. All development on the GSN has been moved to the OpenGSN organization. Please refer to the OpenGSN localgsn implementation. We won't be developing new features nor addressing issues. Read here for more info.
OpenZeppelin GSN Helpers
Helper functions and scripts for using the Gas Station Network. Develop and test your GSN application with minimal setup.
Provides methods for:
- Deploying a
- Funding a recipient
- Query a recipient's or relayer owner's GSN balance
- Running and registering a relayer
- Withdrawing a relayer's revenue
$ npm install @openzeppelin/gsn-helpers
The following samples show how to use each to deploy the
RelayHub contract, fund a recipient and then start a relayer server.
Using the CLI
$ npx oz-gsn deploy-relay-hub --ethereumNodeURLDeploying singleton RelayHub instanceRelayHub deployed at 0xd216153c06e857cd7f72665e0af1d7d82172f494$ npx oz-gsn fund-recipient --recipient <address> --amount 50000000Recipient <address> balance is now 50000000 wei$ npx oz-gsn run-relayer --ethereumNodeURL --quietStarting relayer~/.cache/gsn-nodejs/gsn-relay-v0.2.1-EthereumNodeUrl-RelayHubAddress 0xd216153c06e857cd7f72665e0af1d7d82172f494-Port 8090-UrlRelay is funded and ready!
constdeployRelayHubrunRelayerfundRecipient= ;const web3 = '';await ;await ;await ;
NOTE: All of these actions require a local blockchain to be running in the background on port 8545.
- Head to Preparing a Testing Environment to quickstart your project with ready-to-use GSN setup scripts.
- For detailed usage information, take a look at the API Reference.
The MIT License.