Skip to content

A database with all WISE operations, synced with the blockchain

License

Notifications You must be signed in to change notification settings

wise-team/steem-wise-sql

Repository files navigation

Steem WISE SQL

License PRs Welcome Chat Wise operations count

A database with all WISE operations, synced with blockchain.

Swagger docs at https://sql.wise.vote/doc 💡

It consists of four services:

  • postgres: database
  • postgrest: REST api for reading from database
  • pusher: synchronizes database with the blockchain
  • api_proxy: hosts swagger specification at /doc and adds version header to response

Try and use our API online

I have launched a temporary version of steem-wise-sql at https://sql.wise.vote/. Feel free to use and try it, but beware that it was just launched and the synchronization may not have been finished yet.

Examples of api calls

The Api is provided by Postgrest. Detailed instructions on making api calls can be found here: http://postgrest.org/en/v5.0/api.html.

Let's assume that api host is https://sql.wise.vote/.

https://sql.wise.vote/doc                -- swagger docs
https://sql.wise.vote//- openAPI specification
https://sql.wise.vote/operations         -- list all operations
https://sql.wise.vote/properties         -- list all properties
https://sql.wise.vote/rulesets           -- list all rulesets
https://sql.wise.vote/last_confirmation  -- list last confirmations of specified users (moment of the last activity of a daemon)

--- specify only some fields:
https://sql.wise.vote/operations?select=voter,delegator,moment
/* in operations table available fields are: id, block_num, transaction_num, transaction_id, 
   timestamp, voter, delegator, operation_type, json_str, moment */

--- operators (Full list can be found here: https:/sql.wise.vote//en/v5.0/api.html)
https://sql.wise.vote/operations?voter=eq.noisy -- voter == (equals) noisy
https://sql.wise.vote/operations?moment=lt.23029285.0038 -- moment less than 23029285.0038. Format of moment is block_num.trx_num (trx_num is padded with zeros to four digits)
https://sql.wise.vote/operations?block_num=gt.22039180 -- block_num greater than 22039180
https://sql.wise.vote/operations?block_num=lt.22039180&operation_type=eq.set_rules -- block_num less than 22039180 & operation_type==set_rules

--- ordering:
https://sql.wise.vote/operations?order=moment.desc -- from the newest to the oldest
https://sql.wise.vote/operations?order=moment.asc -- from the oldest to the newest

-- pagination:
https://sql.wise.vote/operations?limit=100&offset=0 -- get first 100 operations
https://sql.wise.vote/operations?limit=100&offset=100 -- get next 100 operations

Run WiseSQL by yourself

$ git clone https://github.com/wise-team/steem-wise-sql/
$ docker-compose up

How to dump the database

You can dump the database from outside the container using our dump script:

$ ./scripts/dump-db.sh

This will create a backup directory and dump file in it.

Where to get help?

You can also ask questions as issues in appropriate repository: See issues for this repository.

Contribute to steem Wise

We welcome warmly:

Before contributing please read Wise CONTRIBUTING guide.

Thank you for developing WISE together!

Like the project? Let @wise-team become your favourite witness!

If you use & appreciate our software — you can easily support us. Just vote for "wise-team" to become you one of your witnesses. You can do it here: https://steemit.com/~witnesses.