# Deployment Reference
Prerequisites
- A machine with docker installed, with a publicly accessible static IP address.
- A DNS service (such as GoDaddy, NameCheap, or DuckDNS) to give your host a DNS name
- Ether (roughly 3 eth) to activate and fund the relayer.
# Start a Machine
This document demonstrate using Google Compute Engine, but you can use any hosting service The reason we use GCP, is that it has a "free tier" not limited in time (for a single micro instance), and that it comes with "docker" pre-installed.
- Go to the Google Cloud Compute Engine UI (opens new window)
- Create a new instance.
- For "Machine type", select "e2-micro".
- In "Boot Disk" change the Operating system to "Container Optimized OS".
- Allow http and https traffic into the instance.
- Create the instance.
- Once you can get its public IP address, add an "A" record for that IP your DNS service.
- To easily SSH into the machine, add your ssh public key, to the "Settings/Metadata/SSH keys"
# Install GSN Relayer
Checkout the code in GSN git repository, and navigate to the
dockers/relaydc
folderedit
.env
file and set the HOST value to the public DNS name of your host.edit the
config-sample/gsn-relay-config.json
:- Edit the
ethereumNodeUrl
to point to a valid RPC url of the network you want to use. - Edit the
versionRegistry
to point to the right entry for your network from the Deployed networks
- Edit the
copy the files to the host:
- The
.env
file must be placed at the home folder - The
gsn-relay-config.json
must be placed inside aconfig
folder
- The
to bring up the relayer, run the command
./rdc HOSTNAME up -d
To view the log, run:
./rdc HOSTNAME logs [gsn1]
Note that initial startup takes about a minute (to create a private key and register an SSL certificate)
Check the relay is up:
curl https://HOSTNAME/getaddr
You should see JSON output containing:
{ .. "ready":false, ...}
, meaning the relayer is up and running, but not registered yet.To register and fund using the gsn relayer-register command
Wait for the Relayer to complete the registration. It should take 1-2 minutes.
Run curl again:
curl https://my.host.name.com/getaddr
You can see it says:
ready:true
Congratulations. You have a running relayer. You should now be able to see your relayer in the list of all relayers: https://relays.opengsn.org
Note: in order to test your relayer, add its URL to the list of preferedRelays
for your client's RelayProvider.
Otherwise, your client is free to pick any active relay.