pendulum-chain / spacewalk-testing-service

GNU General Public License v3.0
0 stars 0 forks source link

Create service for periodic Spacewalk vault client integration tests #1

Closed ebma closed 11 months ago

ebma commented 1 year ago

In order to make sure that our vault client infrastructure and bridging work as expected, we should create a service that periodically bridges assets from and to Stellar. If these processes don't finish in a given period of time, e.g. 1 hour, the service sends alert messages to the #devops-incidents slack channel.

How it works

The logic is the following. For every network in NETWORKS: for every vault in TESTED_VAULT_IDS:

Sending messages to the 'devops-incidents' channel on slack

We will use an incoming webhook to post messages to this channel on Slack. The URL is https://hooks.slack.com/services/T02G2ERGQ/B04BPP5J6RH/dQbJ1L3W4zLWtOLpFCeC14q. However, we need to be careful about sharing this URL and thus should feed the ID with an environment variable (with the ID being T02G2ERGQ/B04BPP5J6RH/dQbJ1L3W4zLWtOLpFCeC14q in this case).

Parameters

We have the following set of configurable parameters:

To make it easier to set a configuration per network, we want to have a configuration file that should look roughly as follows:

{
  "completion_window_minutes": 60,
  "bridged_amount": 1000000000000,
  "test_delay_interval_minutes": 720,
  "networks": [
    {
      "name": "foucoco",
      "wss": "wss://rpc-foucoco.pendulumchain.tech",
      "stellar_mainnet": false,
      "tested_vault_ids": [
        "6asdf",
        "6asdf"
      ]
    },
    {
      "name": "amplitude",
      "wss": "wss://rpc-amplitude.pendulumchain.tech",
      "stellar_mainnet": true,
      "tested_vault_ids": [
        "6asdf",
        "6asdf"
      ]
    }
  ]
}

the STELLAR_ACCOUNT_SECRET_MAINNET and STELLAR_ACCOUNT_SECRET_TESTNET parameters should be passed as an environment variable.

Deployment

I would suggest we deploy this in a way that is similar to our token-stats API service i.e. on an extra server that runs 24/7.

ebma commented 1 year ago

@TorstenStueber could you please add the webhook URL for the #devops-incidents channel to the description?

annatekl commented 1 year ago

Hey team! Please add your planning poker estimate with Zenhub @adelarja @b-yap @ebma @gianfra-t @TorstenStueber

TorstenStueber commented 1 year ago

Ignore this comments, see below

@ebma an example call to the webhook is (just try it)

curl -X POST -H 'Content-type: application/json' --data '{"text":"Hello, World!"}' https://hooks.slack.com/services/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

This is of course sensitive information and must not end up in a public repository – best is probably to manage this as a deployment secret.

TorstenStueber commented 1 year ago

Great initiative @ebma . Is your intention that this be written in Rust or TypeScript?

ebma commented 1 year ago

I'd prefer if we implement this service in TypeScript because I assume the implementation would be faster and easier to deploy.

TorstenStueber commented 11 months ago

The correct webhook for "Devops Incidents" is https://hooks.slack.com/services/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

annatekl commented 10 months ago

@ebma does this require runtime upgrade?

ebma commented 10 months ago

@annatekl no it does not. Generally, you can assume that only PRs created in the pendulum repository require a runtime upgrade to take effect.