A fast, lightweight Iotube bridge analytics and API.
- Component based design to easily add new bridges
- Low resource usage
- Reduced on-chain calls
This project uses InfluxDB to save the time series data. InfluxDB empowers developers to build IoT, analytics and monitoring software. It is purpose-built to handle the massive volumes and countless sources of time-stamped data produced by sensors, applications and infrastructure.
A react frontend was developed to show statistics to the end user. see dashboard here, source codes are available here.
Frontend overview:
Influxdb dashboards are a great way to visualize data. Here we provided an influxdb dashboard as to query the time series and even craft new ideas based on time series.
See this example influxdb_ethiotex_board.json.
InfluxDB dashboard overview:
$ cp env.example .env # edit and add postgres credentials
$ docker-compose up -d --build
$ make lint # (optional)
$ make build
Here are brief explanations about different components of this project.
Bridge trackers are the core components of this project and are located in the pkg/bridge
directory. for every bridge there is <network-name>
subdirectory there, that contains two packages for different directions of the bridge transactions. For example pkg/bridge/eth/ethiotex
tracks the bridge transactions from ethereum to iotex network and the pkg/bridge/eth/iotexeth
package handles transactions in the opposite way.
For every bridge we tracks two main records.
depositTo
method calls to the cashier contract- Total value locked in token safe contract (we collect token data from token list contracts)
Store is the component responsible for saving bridge data to the influxdb.
Price tracker is responsible for retrieving price informations for different coin symbols. this will allow us to do aggregations on the influxdb side and results to faster overall aggregations for the tvl
time series.