Need help running the typescript code for the relay server locally

Is there a developer guide for setting up the relay server locally? I am trying to run the typescript code for the relay server locally so that I can make changes. I deployed the contracts on a ganache client using node_modules/.bin/gsn start -n http://localhost:8545. I then shut down the relay server so that I can connect to the deployed contract directly from the typescript code. I installed the dependencies using lerna bootstrap and started the relay server from the root of the relay server package using ts-node ./src/runServer.ts. I got the log below which indicates that I am not doing it correctly:

info:    
Not registered yet. Prerequisites:
Balance        | wrong          | actual:       0.0000 ETH | required:       0.1000 ETH
Stake          | wrong          | actual:       0.0000 ETH | required:       0.0000 ETH
Hub authorized | wrong         
Stake locked   | wrong         
Manager        | 0x7e11873ae13a9360e5cd726146e66ea0f2a85bfd
Worker         | 0x88e7a481e26dc0ae584bbb50e385d94d4893f502
Owner          | unknown

Listening on port 57463

I have my env set as shown below:

export relayHubAddress='0xb72F57e40FABe5CBc4d5dA5E3aB24501Dd3C052E'
export stakeManagerAddress='0x3C7576174820955046db71f4AA41FF3649799B72'
export penalizerAddress='0x5E20356771E17471605Cb7634BeE498FA861CDA0'
export forwarderAddress='0x707d783070e6CFcD5D244A3bd301Bae075420Feb'
export paymasterAddress='0x458b192ff2eC4Cc3B46ddFb7C54836ab9E740E5d'
export ethereumNodeUrl='http://127.0.0.1:8545'
export url='http://127.0.0.1:9000'
export workdir='/Users/user/projects/1aa/multisend/harmony/gsn/packages/relay/work'

I think that I need to pass in the mnemonics that would be used to sign transactions but I don’t know how to do this. I will also appreciate pointing me to other things that I might be missing.

My goal is to know how this works so that I will be able to make it work with harmony network.

I was able to get this to work by running node_modules/.bin/gsn relayer-register after starting the second relay.

Glad you succeeded. The relayer doesn’t need any mnenonics, since it keeps its own in the keystore file.

1 Like