Author Topic: Bitshares HUG REST API  (Read 3288 times)

0 Members and 1 Guest are viewing this topic.

Offline R

  • Hero Member
  • *****
  • Posts: 1013
    • View Profile
Please explain what you consider a "User" in your statistics.
The Google Analytics is very limited, it's implemented using the measurement protocol as you can see here:
https://github.com/BTS-CM/Bitshares-HUG-REST-API/blob/master/hug_script.py#L74
https://developers.google.com/analytics/devguides/collection/protocol/v1/reference

The following shows device breakdown, with a 'mozilla compatible agent' being the highest, there seems to be continuous fetching of some cryptobridge market orders which Google Analytics is interpreting as between 70-100 continuous users. I'd imagine that if someone was implementing a production grade solution that they would run their own private HUG REST API with increased security though.



« Last Edit: February 26, 2019, 07:40:39 pm by Customminer »

Offline pc

  • Hero Member
  • *****
  • Posts: 1530
    • View Profile
    • Bitcoin - Perspektive oder Risiko?
  • BitShares: cyrano
Please explain what you consider a "User" in your statistics.
Bitcoin - Perspektive oder Risiko? ISBN 978-3-8442-6568-2 http://bitcoin.quisquis.de

Offline R

  • Hero Member
  • *****
  • Posts: 1013
    • View Profile
The intention of the Bitshares HUG REST API is to provide users an open-source high performance interface to the Bitshares network through simple GET requests. It's implemented using python-bitshares, HUG, nGinx and Gunicorn to offer 'unparalleled performance'. It's fairly easy to set up for a private API and doesn't require running a full server (though do respect usage limits).

I'm interested in potentially continuing development of the Bitshares HUG REST API through a Bitshares worker proposal, I've been maintaining it for the last 2 years as a fully open source project.

Would you support such a worker proposal in the future? If so, what would you like to see included? Is anyone running their own private HUG REST API?

Potential scope of worker proposal development:
  • Functions which query account details are slow - this needs debugged/investigated
  • Some functions are only for 1 asset, like getting price feeds for smartcoins, making more generic than specific functions
  • Increase server size to increase gunicorn worker count
  • Implement anti-abuse functions - currently there's nothing preventing anyone from consuming more than their fair share of resources, though caching does counter some of this concern
  • Improve analytics dashboard - currently limited to what functions are hit and frequency over time
  • Static HTML front end pages for some of the functions, the hertz page is fully generated rather than simply populated so it's pretty slow.
  • Bitshares github org fork of my repo is behind in commits: https://github.com/bitshares/Bitshares-HUG-REST-API
  • Create tests for the functions
  • Create user requested functions
  • Create a more sophisticated API key mechanism
  • Host Bitshares full node server locally to the REST API so as to further reduce latencies
  • Host a testnet REST API - currently only production available to save on billing costs.
  • Implement basic 'write' functions for private API usage - currently all functions are read-only.
  • Fine tune Gunicorn & server configuration
  • Stream account history from full node via ZeroMQ into a Google BigQuery table. Implement HUG functions which interact with BigQuery.
  • Split the python script down into separate python files for easier maintenance.
  • Maintaining inter-worker data stores. Currently a few functions save to disk to get around this limitation, this could be optimized.
  • Create example scripts to query the API using different languages

Current Github stats
* 8 stars
* 7 forks
* Forked into the bitshares github org

Last month's public HUG REST API analytics:


Related links:
https://github.com/BTS-CM/Bitshares-HUG-REST-API
https://github.com/bitshares/python-bitshares
« Last Edit: February 26, 2019, 11:52:34 am by Customminer »

Offline R

  • Hero Member
  • *****
  • Posts: 1013
    • View Profile
Many updates to the HUG REST API since the original post. Most recently, a Bitshares testnet HUG REST API server was created! https://steemit.com/bitshares/@cm-steem/bitshares-testnet-hug-rest-api-server-now-online

Offline fav

  • Hero Member
  • *****
  • Posts: 4278
  • No Pain, No Gain
    • View Profile
    • Follow Me!
  • BitShares: fav

Offline R

  • Hero Member
  • *****
  • Posts: 1013
    • View Profile
Hey,



I've created a REST API using HUG for Bitshares over the last few days. You can't control the wallet, but you can access all data on the blockchain through get requests now.

It's fully open sourced & documented in a manner to improve ease of implementation.

Would you use this tech?

https://github.com/BTS-CM/Bitshares-HUG-REST-API

https://steemit.com/bitshares/@cm-steem/initial-release-bitshares-hug-rest-api