New public Bitshares APIs and services

in #bitshares6 years ago (edited)

With a more mature blockchain data inserted in elasticsearch database thanks to the bitshares-core plugins it is time to get the most of this tools by providing more endpoints to community in general and developers.

For this reason, I created a small infrastructure consisting in 1 node with the 2 elasticsearch plugins(elasticsearch and es_objects) and several services on top of that.

Services are in the mainnet and at this moment fully synchronized.

1- Kibana server: https://bitshares-kibana.info/

Idea here is to theme a bit kibana to make it more Bitshares friendly. This is work in progress but the plan is to provide visualizations of all kinds. Kibana is great for searching and visualizing our data, the addition of data in objects makes it even more powerful, check all the accounts in the blockchain with:

https://bitshares-kibana.info/app/kibana#/discover?_g=(refreshInterval:(display:Off,pause:!f,value:0),time:(from:now-5y,mode:quick,to:now))&_a=(columns:!(_source),index:debd10a0-20b6-11e9-82af-8dfbd16c55a9,interval:auto,query:(language:lucene,query:'_index:%20objects-account'),sort:!(block_time,desc))

please copy and paste the full link instead of clikicng it.

check all the assets:

https://bitshares-kibana.info/app/kibana#/discover?_g=(refreshInterval:(display:Off,pause:!f,value:0),time:(from:now-5y,mode:quick,to:now))&_a=(columns:!(_source),index:debd10a0-20b6-11e9-82af-8dfbd16c55a9,interval:auto,query:(language:lucene,query:'_index:%20objects-asset'),sort:!(block_time,desc))

filter data, for example check only bitassets:

https://bitshares-kibana.info/app/kibana#/discover?_g=(refreshInterval:(display:Off,pause:!f,value:0),time:(from:now-5y,mode:quick,to:now))&_a=(columns:!(_source),index:debd10a0-20b6-11e9-82af-8dfbd16c55a9,interval:auto,query:(language:lucene,query:'_index:%20objects-asset%20AND%20issuer:%201.2.0'),sort:!(block_time,desc))

Possibilities are huge and for that reason a new document on how to use kibana with bitshares will be published soon but you can go ahead and try stuff in this place.

2- A direct elsticsearch endpoint: https://elasticsearch.bitshares-kibana.info

When kibana is not giving what you need or when you want to develop an application using data stored in elasticsearch you can query the database directly as:

alfredo@alfredo-Inspiron-5559 ~ $ curl -X GET 'https://elasticsearch.bitshares-kibana.info/bitshares-*/data/_count?pretty=true' -H 'Content-Type: application/json' -d ' 
{
    "query" : {
        "bool" : { "must" : [{"match_all": {}}] }
    }
}
'
{
  "count" : 758526064,
  "_shards" : {
    "total" : 205,
    "successful" : 205,
    "skipped" : 0,
    "failed" : 0
  }
}
alfredo@alfredo-Inspiron-5559 ~ $ 

3- A secure api to make queries or connect your wallet: wss://api.bitshares-kibana.info/ws

This are classic Bitshares API websocket endpoints, can use directly as:

alfredo@alfredo-Inspiron-5559 ~/bitshares-kibana-plugin $ curl --silent -d '{"id":1,"method":"call","params":["database","get_ticker",["1.3.0", "1.3.113"]]}' https://api.bitshares-kibana.info/ws | jq
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "time": "2019-02-08T20:50:12",
    "base": "1.3.0",
    "quote": "1.3.113",
    "latest": "3.9651087343835720977",
    "lowest_ask": "3.9651087306478943037",
    "highest_bid": "3.96510740343068064162",
    "percent_change": "-7.21",
    "base_volume": "4223287.04734",
    "quote_volume": "1046771.2819"
  }
}
alfredo@alfredo-Inspiron-5559 ~/bitshares-kibana-plugin $ 

Or as websocket:

alfredo@alfredo-Inspiron-5559 ~/bitshares-kibana-plugin $ wscat -c https://api.bitshares-kibana.info/ws
connected (press CTRL+C to quit)
> 

Or with your wallet, etc.

4- Finally, an explorer API is also up at: https://explorer.bitshares-kibana.info/apidocs/

Stay tuned for more updates, any question/comment/whatever is welcome.

Sort:  

Thank you kindly Alfredo for providing this public service and for your continued development of the elasticsearch plugin for BitShares. Awesome work!

Second that!

Only plain elastic, no wrapper?

es-wrapper is part of the explorer api so yes, there is support for the wrapper available in this pack. Unfortunately, the server where i installed everything is out of disk space so i am speaking with hosting to see if i can extend. ill restore the services asap and send you the link to the wrapper. My apologies.

please check https://explorer.bitshares-kibana.info/apidocs/#/wrapper for the es-wrapper api calls.

please also note:

  • elasticsearch 6.2(the version i am using) changes the indexes to read only when 95% of disk space is filled by default. i had a hard time figuring out was failing as i had some space left.
  • i removed the protection, changed the indexes to write state again and now all the services are working(unprotected).
  • however, hosting is going to increase me the SSD in 120G more so everything will be fine for a while.
  • for this change they are going to reboot the server so there is going to be some more downtime in this next days.
  • ill update about that as soon as it is happening and when it gets done, you can test the services but should not use them in any production application until then.

thanks for the patience.

The hard drive upgrade was done, we now have 300G more available so everything should be good for a while. all services are working. thanks again for the patience.

Hello @oxarbitrage! This is a friendly reminder that you have 3000 Partiko Points unclaimed in your Partiko account!

Partiko is a fast and beautiful mobile app for Steem, and it’s the most popular Steem mobile app out there! Download Partiko using the link below and login using SteemConnect to claim your 3000 Partiko points! You can easily convert them into Steem token!

https://partiko.app/referral/partiko

Congratulations @oxarbitrage! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

Click here to view your Board

Do not miss the last post from @steemitboard:

Carnival Challenge - Collect badge and win 5 STEEM
Vote for @Steemitboard as a witness and get one more award and increased upvotes!

Congratulations @oxarbitrage! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 3 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.23
TRX 0.21
JST 0.035
BTC 98860.98
ETH 3352.36
USDT 1.00
SBD 3.13