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.
- Indexus Core
- Appendix
At the core of the Indexus protocol lies the concept of collections and items. These entities are indexed and made available by a network of peers. Users can explore and retrieve data by running a proximity algorithm that interacts with the network of nodes.
Each collection is constructed upon a space that encompasses one or multiple dimensions. These dimensions can include geospatiality, temporality, words, and more. By defining coordinates within this space, items are assigned specific locations.
To navigate through the Indexus collections effectively, users employ a combination of origin, filters, and algorithm parameters. By specifying an origin point and setting filters such as directions and distances, users can explore the collections and retrieve relevant items. The proximity algorithm ensures that the displayed feed of items prioritizes proximity, showing the nearest items first. Additionally, the feed can be incrementally loaded without sacrificing performance, allowing users to seamlessly explore an ever-expanding collection of information.
- Decentralized Data Indexing: Index and retrieve data in a decentralized manner without relying on central servers.
- Peer-to-Peer Networking: Utilizes a peer-to-peer network based on Kademlia for efficient node communication.
- Support for Multiple Dimensions: Index data using various dimensions like geospatiality, temporality, and more.
- Delegation Mechanism: Automatically delegates sub-parts of collections to different nodes when they reach a certain size, ensuring balanced data distribution.
- Extensible and Modular: Designed to be extensible, allowing for the integration of additional features and dimensions.
- Redundancy and Caching: Implements data redundancy and caching mechanisms for high availability and quick data access.
- Go (version 1.15 or newer)
- Git
-
Clone the Repository
git clone https://github.com/yourusername/go-indexus-core.git
-
Navigate to the Project Directory
cd go-indexus-core
-
Install Dependencies
go mod tidy
You can run the application directly using Go:
go run app/node/main.go
Alternatively, you can build the application and run the executable:
go build -o indexus-core app/node/main.go
./indexus-core
The application accepts several command-line flags for configuration:
-bootstrap
: Host of the bootstrap peer in the formathost|port
(e.g.,bootstrap.testnet.indexus.network|21000
).-name
: Name of the node (defaults to a random ID).-monitoringPort
: Port number for the monitoring service (default:19000
).-p2pPort
: Port number for the peer-to-peer network (default:21000
).-storage
: Path to the storage directory (default:.data/backup
).
go run app/node/main.go -bootstrap bootstrap.testnet.indexus.network|21000 -name dlLUqr7C9118Ja9etrk_RjN9EMU -p2pPort 21000 -monitoringPort 19000 -storage ./data
To start a node on the network, you can use the following commands:
-
Starting a Node Without a Bootstrap Node
If you are starting the first node in the network:
go run app/node/main.go -name MyFirstNode
-
Starting a Node and Connecting to a Bootstrap Node
To join an existing network, specify the bootstrap node:
go run app/node/main.go -bootstrap bootstrap.testnet.indexus.network|21000 -name MyNode
The node will automatically attempt to connect to the specified bootstrap node and integrate into the network.
The node includes a monitoring service that runs on the specified monitoring port (default 19000
). You can access the monitoring interface by navigating to:
https://localhost:19000/
The node includes a monitoring service that runs on the specified monitoring port (default 19000
). You can access the monitoring interface by navigating to:
https://localhost:19000/
(Note: Monitoring endpoints and features will be expanded in future releases.)
-
Item
-
Method:
POST
-
URL:
https://bootstrap.testnet.indexus.network:21000/item
-
Body:
{ "item": { "id": "reference", "collection": "oVxwqpn90mkO7ZX9xHCaiskLkTo", "location": "rAwbDBzPQPR0e5NXGCDCZXg6d4s" }, "root": "@", "current": "rAwbDBzPQPR0e5NXGCDCZXg6d4s" }
-
Description: Adds an item to the specified collection at the given location.
-
-
Set
-
Method:
GET
-
URL:
https://bootstrap.testnet.indexus.network:21000/set
- Query Parameters:
collection=oVxwqpn90mkO7ZX9xHCaiskLkTo
location=@
- Query Parameters:
-
Description: Retrieves a set of items from the specified collection and location.
-
-
Ping
-
Method:
POST
-
URL:
https://bootstrap.testnet.indexus.network:21000/ping
-
Description: Checks the availability of a peer node.
-
-
Neighbors
-
Method:
GET
-
URL:
https://bootstrap.testnet.indexus.network:21000/neighbors
- Query Parameters:
origin=rAwbDBzPQPR0e5NXGCDCZXg6d4s
- Query Parameters:
-
Description: Retrieves a list of neighboring peers relative to the specified origin.
-
-
Acknowledged
-
Method:
GET
-
URL:
https://bootstrap.testnet.indexus.network:19000/acknowledged
-
Description: Lists acknowledged nodes in the network.
-
-
Registered
-
Method:
GET
-
URL:
https://bootstrap.testnet.indexus.network:19000/registered
-
Description: Lists registered nodes in the network.
-
-
Routing
-
Method:
GET
-
URL:
https://bootstrap.testnet.indexus.network:19000/routing
-
Description: Displays the routing table of the node.
-
-
Ownership
-
Method:
GET
-
URL:
https://bootstrap.testnet.indexus.network:19000/ownership
-
Description: Shows the collections and items owned by the node.
-
-
Queue
-
Method:
GET
-
URL:
https://bootstrap.testnet.indexus.network:19000/queue
-
Description: Displays the current task queue of the node.
-
We welcome contributions from the community! Please follow these steps:
-
Fork the Repository
-
Create a Feature Branch
git checkout -b feature/YourFeature
-
Commit Your Changes
-
Push to Your Fork
-
Create a Pull Request
This project is licensed under the MIT License.
For any inquiries or support, please contact contact@indexus.io.
When you start the application, you will see output similar to:
██╗███╗ ██╗██████╗ ███████╗██╗ ██╗██╗ ██╗███████╗
██║████╗ ██║██╔══██╗██╔════╝╚██╗██╔╝██║ ██║██╔════╝
██║██╔██╗ ██║██║ ██║█████╗ ╚███╔╝ ██║ ██║███████╗
██║██║╚██╗██║██║ ██║██╔══╝ ██╔██╗ ██║ ██║╚════██║
██║██║ ╚████║██████╔╝███████╗██╔╝ ██╗╚██████╔╝███████║
╚═╝╚═╝ ╚═══╝╚═════╝ ╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝
Indexus Version 1.0.0 | Build Date: 2023-10-03 | Commit Hash: abcdef1234567890
Start Time: 2023-10-03 15:04:05
Name: dlLUqr7C9118Ja9etrk_RjN9EMU
Monitoring, P2P Ports: 19000 21000
Bootstrap Nodes: bootstrap.testnet.indexus.network:21000
Storage Path: ./data
[Additional logs...]
The main.go
file is the entry point of the application. It performs the following steps:
- Flag Parsing: Parses command-line flags for configuration.
- Display Startup Messages: Outputs the application banner and configuration details.
- Initialize Components:
- Settings: Creates settings for the node.
- Storage: Initializes storage for data persistence.
- Node: Creates a new node instance with the provided settings and storage.
- Monitoring Handler: Sets up the monitoring HTTP handler.
- P2P Handler: Sets up the peer-to-peer HTTP handler.
- Worker: Initializes a worker for background tasks.
- Start Services: Begins listening on the specified ports and starts background processes.
- Graceful Shutdown: Handles interrupt signals to gracefully shut down the node and clean up resources.
- Extensibility: The architecture is designed to be modular, allowing developers to extend functionalities by integrating new dimensions or features.
- Data Storage: The current storage implementation is a mockup for simulation purposes. In production, you should implement a robust storage solution.
- Error Handling: Proper error handling and logging are crucial for monitoring the health of your node.
This README was last updated on October 2, 2024.