a small rocks-db explorer for debugging purposes #292
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Explorer
Explorer is a small RESTful service built in Rust that allows you to interact with a RocksDB database. It provides endpoints to:
Both keys and values are Base58-encoded for safe transmission over HTTP.
Table of Contents
Features
curl
or any HTTP client.Prerequisites
Building the Project
Clone the repository and navigate to the project directory:
git clone https://github.com/metaplex-foundation/aura.git cd nft_ingester
Build the project using Cargo:
Running the Service
Run the compiled binary with the required arguments:
Optional Arguments
• --secondary-db-path: Path to the secondary RocksDB database. If not provided, a temporary directory is used.
• --port: Port number for the REST service (defaults to 8086).
Example with all arguments:
Configuration
The service accepts the following command-line arguments:
• --primary-db-path (required): Path to the primary RocksDB database.
• --secondary-db-path (optional): Path to the secondary RocksDB database.
• --port (optional): Port number for the REST service (default is 8086).
API Endpoints
Iterate Keys
• URL: /iterate_keys
• Method: GET
• Query Parameters:
• cf_name (required): Name of the column family.
• limit (optional): Maximum number of keys to return (default is 10).
• start_key (optional): Base58-encoded key to start iteration from.
Example Request:
curl "http://localhost:8086/iterate_keys?cf_name=default&limit=5"
Get Value
• URL: /get_value
• Method: GET
• Query Parameters:
• cf_name (required): Name of the column family.
• key (required): Base58-encoded key whose value is to be retrieved.
Example Request:
curl "http://localhost:8086/get_value?cf_name=default&key=3vQB7B6MrGQZaxCuFg4oh"
Acknowledgements
• RocksDB for the high-performance key-value database.
• Actix Web for the powerful and pragmatic web framework.
• bs58 crate for Base58 encoding and decoding.
• Clap for command-line argument parsing.