fio-supply

command module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2021 License: MIT Imports: 15 Imported by: 0

README

fio-supply

CodeQL Gosec

This is a microservice for getting current token state: total supply, circulating supply, locked tokens, bp bucket, and bp rewards. By default it returns the response in whole FIO as a float with 9 digits of precision. The values are calculated every 126 seconds (each full production round), and will return the previous calculation if there is an error getting the values. The X-Last-Refreshed: header in the response has the time of the most recent refresh.

All heavy lifting is performed by the fio-go library. Included is a Postman collection to assist in using the service.

Running

The nodeos URL and Listen Port (does not support TLS, assumes that the service runs behind a proxy) can be set using either a command line flag or via environment variable.

Examples:

fio-supply -u https://fio.nodeos-host -p 8080
# -OR-
URL=https://fio.nodeos-host PORT=8080 fio-supply

The valid paths are:

  • /supply or /minted for current supply.
  • /locked for current count of locked tokens
  • /bprewards
  • /bpbucket
  • /circulating == (supply - locked - bprewards - bpbucket)

Modifiers:

  • Adding /suf to the path will return the value as an unsigned integer in smallest units instead of a float.
  • Adding /int to the path will return the value as an unsigned integer in whole FIO instead of a float.
  • Adding ?json=true will return the result as a json object.

A live version of this service is available on the fioprotocol.io site, for example to get the circulating tokens in whole FIO as a float formatted as JSON:

curl -s https://fioprotocol.io/circulating?json

Additional examples:

  • https://fioprotocol.io/circulating
  • https://fioprotocol.io/supply/suf
  • https://fioprotocol.io/locked?json=true
  • https://fioprotocol.io/bpbucket/suf?json=true

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL