go-indexus-core is the core application of the Indexus protocol, enabling decentralized data indexing and retrieval through a peer-to-peer network. It allows communities to index data and make it available in a decentralized way, focusing on efficient data availability and search capabilities.
- Decentralized Data Storage: Distributed storage of collections and items across the network
- Write-Ahead Logging: Ensures data durability through operation logging
- Automatic Data Replication: Delegates data to other nodes when collections grow too large
- Binary-Space Partitioning: Efficient data organization using BST for routing and data management
- Persistent Storage: Automatic saving of collections to disk with backup functionality
- Monitoring Interface: HTTP endpoints for monitoring node status and network health
- Go 1.22.5 or later
- Git
- Clone the repository:
git clone https://github.com/indexus/go-indexus-core.git cd go-indexus-core- Install dependencies:
go mod tidyThe project includes several launch configurations:
- Run Simulation:
go run app/simulation/main.go -port 2100- Run Node 1 (Bootstrap):
go run app/node/main.go -p2pPort 21001 -monitoringPort 19001- Run Node 2 (Peer):
go run app/node/main.go -bootstrap "127.0.0.1|21001" -p2pPort 21002 -monitoringPort 19002-
Collections
- Manages sets of items with their locations
- Implements Write-Ahead Logging for durability
- Automatic data delegation when size thresholds are reached
-
Node
- Handles peer-to-peer communication
- Manages routing table and network topology
- Implements Kademlia-like routing algorithm
-
Worker
- Performs periodic tasks:
- Collection saving (every 5 minutes)
- Network observation
- Data refresh and updates
- Operation replay on startup
- Performs periodic tasks:
-
Storage
- Binary file format for collections
- Write-Ahead Log for operation durability
- Automatic backup system
-
Binary Search Tree (BST)
- Used for routing table management
- Efficient peer lookup and management
- Thread-safe implementation
-
Collection
- Manages sets of items
- Handles data delegation
- Implements efficient binary encoding
-
Queue
- Thread-safe implementation
- Used for asynchronous operation processing
POST /ping- Node discovery and health checkGET /neighbors- Retrieve neighboring nodesGET /random- Get a random peerPOST /transfer- Transfer items between nodesGET /set- Retrieve items from a collectionPOST /item- Add new items to a collection
GET /acknowledged- List acknowledged nodesGET /registered- List registered nodesGET /routing- View routing tableGET /ownership- View owned collectionsGET /queue- Check operation queue status
The system implements several persistence mechanisms:
-
Collection Storage
- Binary format for efficient storage
- Automatic periodic saving
- Backup creation on successful saves
-
Write-Ahead Log
- Records all operations before execution
- Enables recovery after crashes
- Cleared after successful collection saves
-
Backup System
- Creates timestamped backups
- Handles corrupted file recovery
- Maintains data integrity
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.