Extract data from helium-programs via Solana RPC and serves it via HTTP

Overview

Continuous Integration

hnt-explorer

This application extracts data from helium-programs via Solana RPC and serves it via HTTP. There are CLI commands meant to run and test the data extraction logic.

Building and running

You only need to do this if you want to run the server locally and/or make changes. Otherwise, skip to the next section.

cargo run -- server starts the server. By default, it will hit the public Solana RPC so this will probably error. Use the environmental variable SOL_RPC_ENDPOINT to set a different RPC endpoint (checkout Helius for example).

Public endpoint

I am currently hosting a public endpoint here: https://hnt-explorer.herokuapp.com. Prepend the paths below with the endpoint.

Endpoints

GET /v1/accounts/{account} Provides Helium SPL token balances for a given account.

GET /v1/positions

Params: limit, start, timestamp

Provides list of all positions. When no timestamp is provided, the latest pulled data is used, including timestamp. Data is pulled every 5 minutes. Use the timestamp to maintain index on the same batch of data and start and limit to fetch more positions.

When no limit is provided, default of 500 items is used. limit is capped also at 500.

When no start is provided, default of 0 is used.

If using more than one parameter at a time, all parameters must be encapsulated in a string. For example:

https://hnt-explorer.herokuapp.com/v1/positions?"timestamp=1682720623?start=500"

GET /v1/positions/{position}

Provides data of a specific position, including most recently derived veHNT (at most 5 minutes old) and pending rewards.

GET /v1/positions/csv

Serves most recent list of all positions as a CSV file.

GET /v1/positions/info

GET /v1/epoch/info

Legacy Endpoints

Warning: these will be deprecated soon.

GET /v1/delegated_stakes

Params: limit, start, timestamp

Provides list of delegated stakes. When no timestamp is provided, the latest pulled data is used, including timestamp. Data is pulled every 5 minutes. Use the timestamp to maintain index on the same batch of data and start and limit to fetch more positions.

When no limit is provided, default of 500 items is used. limit is capped also at 500.

When no start is provided, default of 0 is used.

If using more than one parameter at a time, all parameters must be encapsulated in a string. For example:

https://hnt-explorer.herokuapp.com/v1/delegated_stakes?"timestamp=1682720623?start=500"

GET /v1/delegated_stakes/csv

Serves most recent list of delegated stakes as a CSV file.

GET /v1/delegated_stakes/info

Environmental variables

  • SOL_RPC_ENDPOINT - Solana RPC URL (defaults to https://api.mainnet-beta.solana.com)
  • PORT - Port to listen on (defaults to 3000)

Pushing to heroku

You can host this program on Heroku easily by creating an app and pushing the container to it. Just change the app name below from hnt-explorer to whatever your app name is.

Build the container:

heroku container:push web -a hnt-explorer

Release it:

heroku container:release web -a hnt-explorer 

Check logs:

heroku logs --tail -a hnt-explorer
You might also like...
A collection of Solana-maintained on-chain programs

Solana Program Library The Solana Program Library (SPL) is a collection of on-chain programs targeting the Sealevel parallel runtime. These programs a

Deploy your Solana programs during high load.

solana-deployer IMPORTANT: There is a known bug with the current program that will be fixed soon. In the meantime you should deploy from Solana Playgr

Write Anchor-compatible Solana programs in TypeScript

Axolotl Write Achor-compatible Solana programs using TypeScript. Writing Rust is hard, but safe. It's also the go-to language for writing Solana progr

My attempt at learning Solana program (smart contract) development through RareSkill's Solana course.

60-days-of-solana My attempt at learning Solana program (smart contract) development through RareSkill's Solana course. Originally, I was trying to cr

A Minimalistic Rust library to extract all potential function selectors from EVM bytecode without source code.

EVM Hound A Minimalistic Rust library to extract all potential function selectors from EVM bytecode without source code. Installation $ cargo add evm_

A guide for Mozilla's developers and data scientists to analyze and interpret the data gathered by our data collection systems.

Mozilla Data Documentation This documentation was written to help Mozillians analyze and interpret data collected by our products, such as Firefox and

Ethereum JSON-RPC multi-transport client. Rust implementation of web3 library

Ethereum JSON-RPC multi-transport client. Rust implementation of web3 library. ENS address: rust-web3.eth

RPC over mezzenger transports.

zzrpc RPC over mezzenger transports. https://crates.io/crates/zzrpc usage See zzrpc-tutorial. targeting WebAssembly See rust-webapp-template-api. furt

An ether-rs middleware to access reth's db directly, bypassing JSON-RPC
An ether-rs middleware to access reth's db directly, bypassing JSON-RPC

Octane A ether-rs middleware for reth that bypasses JSON-RPC allowing for faster db queries. Work in Progress! Please note that Octane is currently in

Owner
Louis Thiery
Louis Thiery
Simple template for building smart contract(Rust) and RPC Client(web3.js) on Solana (WIP) โ›๐Ÿ‘ท๐Ÿšงโš ๏ธ

Solana BPF Boilerplate Simple template for building smart contract(Rust) and RPC Client(web3.js) on Solana This boilerplate provides the following. Si

ono 6 Jan 30, 2022
This is a solana lite rpc which optimizes sending transactions and confirming transactions strategies.

Solana Lite RPC This project aims to create a lite rpc server which is responsible only for sending and confirming the transactions. The lite-rpc serv

Blockworks Foundation 7 Dec 24, 2022
Fast way to test a Substrate Runtime via RPC (eg. PolkadotJS UI).

runstrate Fast way to test a Substrate Runtime via RPC (eg. PolkadotJS UI). Build & Run git clone https://github.com/arturgontijo/runstrate cd runstra

Artur Gontijo 3 May 9, 2023
A suite of programs for Solana key management and security.

?? goki Goki is a suite of programs for Solana key management and security. It currently features: Goki Smart Wallet: A wallet loosely based on the Se

Goki Protocol 157 Dec 8, 2022
๐Ÿง‘โ€โœˆ Version control and key management for Solana programs.

captain ??โ€โœˆ๏ธ Version control and key management for Solana programs. Automatic versioning of program binaries based on Cargo Separation of deployer a

Saber 35 Mar 1, 2022
cryo is the easiest way to extract blockchain data to parquet, csv, or json

โ„๏ธ ?? cryo ?? โ„๏ธ cryo is the easiest way to extract blockchain data to parquet, csv, or json cryo is also extremely flexible, with many different opti

Paradigm 287 Jul 12, 2023
โ› An open protocol for launching liquidity mining programs on Solana.

โ› Quarry An open protocol for launching liquidity mining programs on Solana. Background Quarry was built with the intention of helping more Solana pro

Quarry Protocol 207 Dec 19, 2022
The Solana Program Library (SPL) is a collection of on-chain programs targeting the Sealevel parallel runtime.

Solana Program Library The Solana Program Library (SPL) is a collection of on-chain programs targeting the Sealevel parallel runtime. These programs a

null 6 Jun 12, 2022
Examples of Solana on-chain programs

spl-examples List of Solana on-chain programs which demonstrate different aspects of Solana architecture. 01__state It's a counter program. Each user

Max Block 51 Dec 6, 2022
Synchronized shadow state of Solana programs available for off-chain processing.

Solana Shadow The Solana Shadow crate adds shadows to solana on-chain accounts for off-chain processing. This create synchronises all accounts and the

null 40 Oct 30, 2022