Mimir is a flexible and powerful indexer for AVM (Algorand Virtual Machine) blockchains, designed specifically to support networks like Voi. By combining multiple specialized components, Mimir provides a robust solution for indexing blockchain data with enhanced querying capabilities.
Mimir integrates several key components to create a comprehensive indexing solution:
- Follower Node: A specialized blockchain node that synchronizes with the network in a controlled manner, advancing only when instructed.
- Conduit: A data processing layer that reads block information and manages node progression while writing to PostgreSQL.
- Supabase: A powerful PostgreSQL-based backend that provides:
- Real-time subscriptions
- Auto-generated REST API
- Authentication and row-level security
- GraphQL interface
- Database management dashboard
This architecture provides several advantages over traditional indexers:
- Flexible querying capabilities through PostgreSQL
- Real-time data subscriptions
- Built-in authentication and authorization
- GraphQL and REST API endpoints
- Simple deployment and management
- Docker and Docker Compose
- Node.js 16 or higher
- Git
-
Clone the repository:
git clone [email protected]:cswenor/mimir.git cd mimir
-
Initialize the environment:
./bin/mimir init
This command will:
- Generate necessary environment variables
- Create required configuration files
- Set up data directories
- Initialize the database schema
-
Start the services:
./bin/mimir start
-
Check the status of the Voi follower node:
./bin/mimir status
This will display the current sync status and other node-related information.
Once running, Mimir will be indexing the blockchain and persisting data into the PostgreSQL database managed by Supabase.
Mimir provides a local Supabase dashboard for managing your database and settings. Once the services are running, you can access the dashboard at:
Use the Supabase dashboard user ID and password defined in the .env
file (located in mimir/supabase/.env
) to log in.
Mimir includes a command-line utility mimir
(located in /bin/mimir
) to help you manage and maintain your indexing environment. Below are the available commands:
-
init: Initialize or reinitialize the Mimir environment.
./bin/mimir init [OPTIONS] Options: -v Verbose mode
-
start: Start all Mimir-related services, including the follower node, Conduit, and Supabase.
./bin/mimir start
-
stop: Stop all services cleanly.
./bin/mimir stop
-
reset: Reset the Mimir environment. This removes existing data, configurations, and other stateful components. Use with caution.
./bin/mimir reset [OPTIONS] Options: -v Verbose mode -f Force reset (skip confirmation prompts)
-
status: Check the status of the Voi node.
./bin/mimir status
-
help: Display help and usage information about the
mimir
commands../bin/mimir help
mimir/
├── algod-data/ # Follower node data directory
├── conduit-data/ # Conduit configuration and data
├── scripts/ # Setup and utility scripts
├── templates/ # Configuration templates
├── supabase/ # Supabase configuration, .env file, and services
├── bin/ # Directory containing the mimir command-line tool
├── docker-compose.yml # Main service orchestration
└── supabase/.env # Environment configuration for Supabase and Mimir
Mimir uses a .env
file located inside the supabase
folder. The mimir init
command will generate this file with secure defaults. Key configuration areas include:
- Node connection details
- Database credentials
- JWT secrets
- API keys
- Service endpoints
For advanced use of Mimir and its integrations with Supabase, please refer to the Supabase documentation.
Mimir stores blockchain data in PostgreSQL, allowing for complex custom queries. You can:
- Create custom views
- Set up materialized views for performance
- Implement custom functions
- Use full-text search capabilities
Subscribe to real-time updates using Supabase's real-time feature:
const subscription = supabase
.from("transactions")
.on("INSERT", handleNewTransaction)
.subscribe();
Mimir includes built-in authentication through Supabase, supporting:
- JWT-based authentication
- Row-level security policies
- Multiple auth providers
- Role-based access control
Contributions are welcome! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License.
- Voi Network - For their support and collaboration
- Algorand - For the underlying AVM technology
- Supabase - For their excellent database platform
For support, please:
- Open an issue in the GitHub repository