Real-Time COVID-19 &SARS-CoV-2 Outbreak Stats Over LibP2P & IPFS

RTrade Technologies, Ltd.
Temporal.cloud
Published in
2 min readMar 23, 2020

Accuracy of data is not guaranteed and is sourced from an API that aggregates the data from John Hopkins and confrence of state bank supervisors.

ipcoronafs is a golang too that interacts with TemporalX gRPC API and the coronavirus tracker api that tracks the total number of COVID-19 and SARS-CoV-2 outbreak statistics. The data is then sent to a variety of consumption methods:

The coronavirus tracker API has a couple different types of data it provides. The two we enable access to is the “all location data” which contains all known outbreak stats for all known regions, and the “latest data” which contains the latest update to the outbreak statistics.

The “all location dataset” is sent on the following LibP2P pubsub topic: coronavirus-all-location-data-topic

The “latest dataset” is sent on the following LibP2P pubsub topic: coronavirus-latest-location-data-topic

We poll the coronavirus tracker API every 60 minutes for each of the associated topics. However anytime we hit the API, we start a background process that until the next update, will continually rebroadcast on the topic every minute.

To ensure that you can discover the pubsub topic and peers, you’ll want to connect to the following hosts:

  • /ip4/206.116.153.42/tcp/4004/ipfs/QmePr8gxUswSsD7anQCm8P1F599CrmK2Wze1DjoN8LaLAx
  • /ip4/206.116.153.42/tcp/4005/p2p/12D3KooWLrKQEE5NfA3vmEXfRFWKzNjq7DuwVS9CsZ8ooPe7sZFM

Using the hashes you can then retrieve this data and process it in your applications. For example to pick this up on and IPFS node;

1) ipfs swarm connect /ip4/206.116.153.42/tcp/4005/p2p/12D3KooWLrKQEE5NfA3vmEXfRFWKzNjq7DuwVS9CsZ8ooPe7sZFM

2) ipfs swarm connect /ip4/206.116.153.42/tcp/4004/ipfs/QmePr8gxUswSsD7anQCm8P1F599CrmK2Wze1DjoN8LaLAx

3) ipfs pubsub sub coronavirus-latest-location-data-topic and then within about a minute you should start seeing the data coming through.

4) ipfs pin add <hash from pubsub message> and you’ll then be pinning the data locally

Every so often we will update our DNSLink record too, but the way to get the up to date information frequently is over libp2p.

For more information on how to protect you, loved ones and the people around you please visit https://www.cdc.gov/coronavirus/2019-nCoV/index.html. Our thought and prayers go out to those who have lost during this time, as well a big thank you to the front liners and anyone contributing in anyway to help selflessly in this time of need.

--

--

RTrade Technologies, Ltd.
Temporal.cloud

We are a team of blockchain Technology Specialists. Helping to build a decentralized world.