Prerequisites:
- member on Digital Ocean on Hydro project
- installed doctl https://github.com/digitalocean/doctl
Install serverless:
doctl serverless install
doctl serverless connect
This is how Vortex namespace was created - don't need to do it again:
doctl serverless namespaces create --region Europe --label vortex
doctl serverless namespaces create --region fra1 --label vortex
This is how Vortex bot go project is initialized:
doctl serverless status --languages - if you want to see supported languages, for example rust isn't supported
doctl serverless init --language go vortex-bot-go
Since we already have vortex/monitor deployed - this is what needs to be done if we need new position/s to be monitored:
- Make sure we have the repository cloned locally: https://github.com/informalsystems/vortex-bot-go (this one)
- edit the project.yml - positions section - can track one or multiple positions at the same time
Please make sure for each position (vortex contract instance) you have the correct parameters set for:
- pool_id
- contract_address (vortex)
- lower_tick
- upper_tick
- principal_denom
- owner (can be address)
- notification_webhook_url (should only be changed if we change slack channel)
In case code needs to be changed and tested locally before deploying - see the difference between commented main and serverless entrypoint main.
If only yml is changed, you can deploy to Digital Ocean without building locally:
doctl serverless deploy vortex-bot-go
doctl serverless functions invoke vortex/monitor (optionally if you want to test with triggering manually to check if it works fine)
Setting the trigger:
this is done trough web app in Triggers section with cron: 0 * * * * (at minute 0, meaning every hour).
Not to be confused - the trigger defined in yml was never activated.