Using Gas Station Network starter kit on a public testnet

Following on from Using Gas Station Network starter kit on a local network this guide is using Gas Station Network starter kit on a public testnet (specifically Rinkeby)

Change App.js to use public network

In App.js change the web3 context from ganache-cli to Infura by uncommenting Infura and commenting out the local network.

  // get GSN web3
  const context = useWeb3Network(`wss://${infuraToken}`, {
    pollInterval: 15 * 1000,
    gsn: {

  // const context = useWeb3Network('', {
  //   gsn: {
  //     dev: true,
  //     signKey,
  //   },
  // });

Deploy Counter to public network

The following guide walks through the process of deploying to a public network, though most of the setup is already done for us in the starter kit:

Test account

npx mnemonics will generate a 12 word seed phrase suitable for development testing

$ npx mnemonics
npx: installed 15 in 4.617s

Configure .env

Create a .env file in your project directory with the contents being the mnemonic just generated


Configure truffle-config.js

Fix typo of MNEMONIC to match value in .env (

const mnemonic = process.env.MNEMONIC;

Fund test account

Fund test account on Rinkeby

Get the default account using openzeppelin accounts

$ npx openzeppelin accounts
? Pick a network rinkeby
Accounts for rinkeby:
Default: 0x4924b7e51F71f2D3a57711C7a2Ac8a5ca3b2DBED
- 0: 0x4924b7e51F71f2D3a57711C7a2Ac8a5ca3b2DBED

Add Rinkeby Ether, you can use or you can request test Ether from the MetaMask faucet. (

Import into MetaMask

Hack: Get the private key for the default account using ganache-cli

$ ganache-cli -a 1 -m "ENTER 12 WORD SEED PHRASE"

Copy the private key and import into MetaMask

Deploy Contract

Deploy Counter.sol on Rinkeby

$ npx openzeppelin create
Nothing to compile, all contracts are up to date.
? Pick a contract to instantiate Counter
? Pick a network rinkeby
✓ Contract Counter deployed
All contracts have been deployed
? Do you want to call a function on the instance after creating it? Yes
? Select which function * initialize(num: uint256)
? num (uint256): 72
✓ Setting everything up to create contract instances
✓ Instance created at 0x227984286964861BBFb45AFBf1EC9B2a57c65C89

Fund Recipient

Fund Recipient using GSN Dapp Tool

Open in a browser with MetaMask (or other web3 provider)

Paste Counter address on Rinkeby

Deposit 0.1 Rinkeby ETH

Use Dapp

Refresh Dapp and increase/decrease counter using Gas Station Network