# Release process of a new GSN - staging a new version of npm pacakges, docker, contracts, test app - Not affecting existing release The docker is published with a new name. the NPM package is published into verdaccio, since we can't change it once published. ## procedure: ### deployment: #### deploy contracts: Note: for deployments on Hardhat Node(1337) always remove the 'deployments/dev' folder after Hardhat Node restart. - `cd gsn/packages/deployer` - `git clone git@github.com:opengsn/gsn-deployments.git deployments` (this is the previous deploymens. contains the deployment-config.js) - `yarn deploy --network dev` (dev is "localhost". add to hardhat.config new networks) - for new network, it will prompt you for the default block to add to deployment-config.js - the line: `minimumStakePerToken: { test: '0.5' }` means to deploy a test token. instead of "test" it can be an address of a pre-deployed token. - it outputs a suggested configuration for relayer (and relayer-register command line...) - `yarn export` generates `./deployments/gsn-networks.json`. used later - `yarn verify` to perform source verification on Etherscan #### Create docker image: - `yarn && yarn preprocess && yarn preprocess-paymasters` - run `./dockers/jsrelay/dbuild.sh` - at the end, it dumps a line with something like: `docker push ...@latest ; docker push ...@3.0.0...`` - copy and execute **JUST THE SECOND** cmd (don't push "latest" yet) ### run relayer To run without Docker Compose I used this command: `docker run -p 8090:8090 -e config=/app/conf/gsn-relay-config.json \` `-v /var/run/docker.sock:/var/run/docker.sock \` `-v /tmp/gsn/config:/app/conf opengsn/jsrelay:3.0.0-beta.2` - in gsn-web-tool: - copy above `gsn-networks.json` itno "`./src`" - start web - register a relayer.. ### publish npm - `yarn verdaccio-start` in another window: - `yarn verdaccio-publish` - select: "custom prerelease". should increment the "beta.xx" number ### ctf switch to ctf-react project - cd `workspaces/ctf-eth` - `cp gsn/verdaccio/yarnrc .yarnrc` (notice the "dot" in front of the filename) - `yarn add @opengsn/provider @opengsn/contracts @opengsn/dev @opengsn/cli` - see traffic from "verdaccio" server - validate `package.json` is updated with new version - copy `gsn-networks.json` from GSN deployment (above) into config - make sure `hardhat.config` contains the same network - in the root "ctf" folder do `yarn deploy --network development` (this deploys CTF, connect to GSN's forwarder and updates the `config/ctf-networks.json`) - in the root "ctf" folder do "yarn start" (or yarn start-prod)