The following is a brief walkthrough of how our lightning app for data feeds works. Of course, developers can implement this programmatically as well.

After you have connected to our Suredbits lightning node:

033[email protected]ln.test.suredbits.com

You can then connect via websocket client of your choosing or use our Suredbits drop-in solution built using Blockstream’s Lightning Charge client.

When you first hit our lightning app for data feeds, you will see this message:

{"message":"Welcome to the SuredBits API!","ln_uri":"033[email protected]ln.test.suredbits.com","version":0,"openChannels":["info","games","players","stats","team"]}

A basic sample query will look like this:

{“channel”: “info”}

which will return an invoice such as:

{"invoice":"lntb10n1pdkrlgvpp502gnfawd6t8julfq522nhjrutya7q67xuxm2upnex0a5jv42gfjsdqqxqrrssy47yeszs4sy89z7zrpe5u8kzfw2ydr87qjsgtv3wnzdz7g30p3m3ql72rzq5ax0fp5ctrfmpfnx4lw6ty558gp8z22e0qtwd8pm6haqpvjta8e"}

Then paste this invoice into whatever lightning network client you are using (or place it into a command line interface):

An example Lightning Network invoice

Within your websocket client, you should now see the data returned:

{"data":{"version":"8","lastRosterDownload":"20180801T153829.816Z","seasonType":"Regular","seasonYear":2017,"week":"NflWeek17"}}

That is the quick 101 of how out lightning app works. Again, we are currently only on testnet and only have NFL data available.

We are planning for NBA data as well as our initial cryptocurrency feed for Fall 2018.

We’d love to hear from you. Stay in touch and join our Suredbits slack community and hit us up on twitter @Suredbits.