luguslabs / habs

High availability for blockchain services
https://luguslabs.com
Apache License 2.0
12 stars 3 forks source link

check "system peers" polkadot api to detect proxy servers down and suspend archipel earthbeat in this case #265

Open branciard opened 3 years ago

branciard commented 3 years ago

Proposal for detecting proxy server down.

After a tcp ping test on the deployed proxy, it appears that tcp ports are not open. That leads me to find another solution, here a proposal :

  async checkPeers ( containerName ) {
       console.log("checkPeers start");
        // Construct command to check system_peers
        const commandSystemPeers = ['curl', 'http://localhost:' + config.polkadotRpcPort, '-H', 'Content-Type:application/json;charset=utf-8', '-d',
        `{
          "jsonrpc":"2.0",
          "id":1,
          "method":"system_peers"
        }`];

        // Call system_health command in docker container
        const resultSystemPeers = await this.docker.dockerExecute(containerName, commandSystemPeers);
        console.log(resultSystemPeers);
  }

link to #241 #260

branciard commented 3 years ago

A simpler solution will be a libp2p rust deamon pinging and alerting proxy port.