CloudFlare Worker bootstrap service for AIngle networks
A CloudFlare Worker that enables AIngle networks to bootstrap securely. This service allows new nodes to discover existing peers and join the distributed network while mitigating eclipse attacks.
AIngle uses a distributed Semantic Graph Data (SGD) architecture where:
- Data is distributed across all nodes on the network
- Nodes communicate peer-to-peer without central servers
- New nodes need a way to find honest peers initially
The bootstrap service provides a secure entry point by:
- Accepting signed agent information via POST API
- Storing data in CloudFlare's key/value store with automatic expiration
- Returning random agents to prevent targeted attacks
- Verifying all cryptographic signatures
# Install dependencies
npm install
# Install wrangler (CloudFlare CLI)
npm install -g @cloudflare/wrangler
# or via Cargo
cargo install wrangler
# Run development server
wrangler dev
# Run tests (requires running wrangler dev)
npm testAll API requests use HTTP POST with MessagePack binary serialization.
| Op Header | Description | Request | Response |
|---|---|---|---|
put |
Store signed agent info | AgentInfoSigned |
null |
random |
Get random agents | {space, limit} |
AgentInfoSigned[] |
now |
Get server timestamp | (none) | number (ms) |
# GET request returns "OK"
curl https://your-worker.workers.dev// Signed agent information
interface AgentInfoSigned {
signature: Uint8Array; // Ed25519 signature (64 bytes)
agent: Uint8Array; // Public key (32 bytes)
agent_info: Uint8Array; // Serialized AgentInfo
}
// Inner agent info (after validation)
interface AgentInfo {
space: Uint8Array; // SGD/SAF hash
agent: Uint8Array; // Public key
urls: string[]; // Network locations
signed_at_ms: number; // Unix timestamp
expires_after_ms: number;
}- Cryptographic verification - Ed25519 signatures on all data
- Automatic expiration - Agent info expires (1 min - 1 hour)
- Random selection - Prevents targeted eclipse attacks
- CloudFlare protection - Built-in DDoS mitigation
- Trust delegation model (developer-approved keys)
- DPKI integration for identity verification
- Audit logging for cross-reference
- Fork this repository
- Configure
wrangler.tomlwith your CloudFlare account - Deploy:
wrangler publish - Point AIngle conductors to your bootstrap URL
This service is part of the AIngle ecosystem - a Semantic DAG framework for IoT and distributed AI applications.
Licensed under the Apache License, Version 2.0. See LICENSE for details.
Maintained by Apilium Technologies - Tallinn, Estonia