Snapshot is a command-line utility designed to gather staking information from various staking contracts across multiple blockchain networks. This tool is capable of fetching unique staker addresses, calculating staked balances, and summing the staked balances from all staking contracts, regardless of the blockchain network they are deployed on.
- Fetches unique staker addresses and staked balances from different types of staking contracts.
- Supports standard staking contracts as well as open staking contracts.
- Handles staking contracts deployed across multiple blockchain networks.
- Aggregates the total staked balance from all staking contracts.
- Retrieves the appropriate RPC URL for each blockchain network by querying a MongoDB database.
- Modular code organization for easy maintenance and extensibility.
To run and build Snapshot, you need to have the following software installed on your system:
Clone the repository:
git clone git@github.com:ferrumnet/snapshot.gitChange to the project directory:
cd snapshotInstall the dependencies:
npm installCreate a .env file in the root directory of the project and add the following environment variables:
DB_CONNECTION_STRING=mongodb://username:password@host:port
DB_NAME=your_database_name
DB_COLLECTION=your_collection_name
APP_NAME=snapshotReplace the values with your actual MongoDB connection string, database name, and collection name.
IMPORTANT: Leave APP_NAME value as snapshot.
To run Snapshot, use the following command:
npm startThe tool will then fetch the staking data from the specified contracts and display the results in the terminal.
To build the tool, use the following command:
npm run buildThis will compile the TypeScript files into JavaScript and output them in the build directory.
We welcome contributions to the Snapshot project. If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
Snapshot by Ferrum Network is released under the MIT License.