switcheo-node-api
v1.0.0
Published
Downloads
2
Readme
ETH Broadcaster
Dependencies
Requires the contracts from switcheo-eth to be deployed on your local Ganache application.
Use the following mnemonic for Ganache to ensure your deployed contracts matches the contract address in lib/artifacts/Broker.json
. In Ganache, Settings > ACCOUNTS & KEYS, enter:
fly fee spell coin can security input already ozone swallow juice limit
Running
To connect to ganache, run:
$ npm run watch-dev
Deploying
The ./env.json
file needs to be setup:
{
"SWITCHEO_ENV": "<canary|staging|production>",
"SENTRY_DSN": "<sentry-reporting-url>",
"REDIS_URL": "<redis-host-url>",
"COORDINATOR_KEY": "<coordinator-private-key>",
"SWAP_PROVIDER_KEY": <swap-provider-private-key>",
"INFURA_ID": "<infura-id>",
"CHAIN_ID": "<chain-id>",
"ADMIN_KEYS": {
"<admin-address-1>": "<admin-private-key-1>",
"<admin-address-2>": "<admin-private-key-2>"
}
}
To deploy, pull in the latest commit, build, and run with pm2
:
$ git pull
$ npm i && npm run build
$ pm2 delete 0 # if already running
$ pm2 start ./dist/index.js
For subsequent deploys, and if the arguments to the app does not need to be changed, then you can also deploy the code with: . deploy.sh
.