Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ Official SDKs for integrating AIngle into your applications:
```javascript
import { AIngleClient } from '@apilium/aingle-sdk';

const client = new AIngleClient('http://localhost:8080');
const client = new AIngleClient('http://localhost:19090');

// Create an entry
const hash = await client.createEntry({ sensor: 'temp', value: 23.5 });
Expand All @@ -390,7 +390,7 @@ client.subscribe((entry) => {

```bash
# Start node with REST API enabled
aingle-minimal run --rest-port 8080
aingle-minimal run --rest-port 19080
```

---
Expand Down
2 changes: 1 addition & 1 deletion crates/aingle_ai/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "aingle_ai"
version = "0.6.0"
version = "0.6.2"
description = "AI integration layer for AIngle - Ineru, Nested Learning, Kaneru"
license = "Apache-2.0 OR LicenseRef-Commercial"
repository = "https://github.com/ApiliumCode/aingle"
Expand Down
2 changes: 1 addition & 1 deletion crates/aingle_contracts/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "aingle_contracts"
version = "0.6.0"
version = "0.6.2"
description = "Smart Contracts DSL and WASM Runtime for AIngle"
license = "Apache-2.0 OR LicenseRef-Commercial"
repository = "https://github.com/ApiliumCode/aingle"
Expand Down
2 changes: 1 addition & 1 deletion crates/aingle_cortex/COMPLETION_REPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ use aingle_cortex::{CortexServer, CortexConfig};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = CortexConfig::default()
.with_port(8080)
.with_port(19090)
.with_rate_limit_rpm(100);

let server = CortexServer::new(config)?;
Expand Down
2 changes: 1 addition & 1 deletion crates/aingle_cortex/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "aingle_cortex"
version = "0.6.1"
version = "0.6.2"
description = "Córtex API - REST/GraphQL/SPARQL interface for AIngle semantic graphs"
license = "Apache-2.0 OR LicenseRef-Commercial"
repository = "https://github.com/ApiliumCode/aingle"
Expand Down
2 changes: 1 addition & 1 deletion crates/aingle_cortex/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ info:
url: https://www.apache.org/licenses/LICENSE-2.0.html

servers:
- url: http://localhost:8080
- url: http://localhost:19090
description: Local development server
- url: https://api.aingle.apilium.com
description: Production server
Expand Down
6 changes: 3 additions & 3 deletions crates/aingle_cortex/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use serde::{Deserialize, Serialize};
/// Configuration for the Cortex internal client.
#[derive(Debug, Clone)]
pub struct CortexClientConfig {
/// Base URL of the Cortex REST API (e.g., "http://127.0.0.1:8080").
/// Base URL of the Cortex REST API (e.g., "http://127.0.0.1:19090").
pub base_url: String,
/// Optional authentication token.
pub auth_token: Option<String>,
Expand All @@ -28,7 +28,7 @@ pub struct CortexClientConfig {
impl Default for CortexClientConfig {
fn default() -> Self {
Self {
base_url: "http://127.0.0.1:8080".to_string(),
base_url: "http://127.0.0.1:19090".to_string(),
auth_token: None,
timeout_ms: 5000,
}
Expand Down Expand Up @@ -332,7 +332,7 @@ mod tests {
#[test]
fn test_default_config() {
let config = CortexClientConfig::default();
assert_eq!(config.base_url, "http://127.0.0.1:8080");
assert_eq!(config.base_url, "http://127.0.0.1:19090");
assert!(config.auth_token.is_none());
assert_eq!(config.timeout_ms, 5000);
}
Expand Down
10 changes: 5 additions & 5 deletions crates/aingle_cortex/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Start server on localhost:8080
//! // Start server on localhost:19090
//! let config = CortexConfig::default();
//! let server = CortexServer::new(config)?;
//! server.run().await?;
Expand All @@ -80,7 +80,7 @@
//! ### Add a Triple
//!
//! ```bash
//! curl -X POST http://localhost:8080/api/v1/triples \
//! curl -X POST http://localhost:19090/api/v1/triples \
//! -H "Content-Type: application/json" \
//! -H "Authorization: Bearer YOUR_TOKEN" \
//! -d '{
Expand All @@ -93,13 +93,13 @@
//! ### Query Triples
//!
//! ```bash
//! curl "http://localhost:8080/api/v1/triples?subject=alice"
//! curl "http://localhost:19090/api/v1/triples?subject=alice"
//! ```
//!
//! ### Validate Proof
//!
//! ```bash
//! curl -X POST http://localhost:8080/api/v1/proofs/validate \
//! curl -X POST http://localhost:19090/api/v1/proofs/validate \
//! -H "Content-Type: application/json" \
//! -d '{
//! "proof_type": "schnorr",
Expand All @@ -110,7 +110,7 @@
//!
//! ## GraphQL Examples
//!
//! Access the GraphQL playground at `http://localhost:8080/graphql`.
//! Access the GraphQL playground at `http://localhost:19090/graphql`.
//!
//! ### Query
//!
Expand Down
4 changes: 2 additions & 2 deletions crates/aingle_cortex/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
}
"--port" | "-p" => {
if i + 1 < args.len() {
config.port = args[i + 1].parse().unwrap_or(8080);
config.port = args[i + 1].parse().unwrap_or(19090);
i += 1;
}
}
Expand Down Expand Up @@ -344,7 +344,7 @@ fn print_help() {
println!();
println!("OPTIONS:");
println!(" -h, --host <HOST> Host to bind to (default: 127.0.0.1)");
println!(" -p, --port <PORT> Port to listen on (default: 8080)");
println!(" -p, --port <PORT> Port to listen on (default: 19090)");
println!(" --public Bind to all interfaces (0.0.0.0)");
println!(" --db <PATH> Path to graph database (default: ~/.aingle/cortex/graph.sled)");
println!(" --memory Use volatile in-memory storage (no persistence)");
Expand Down
10 changes: 5 additions & 5 deletions crates/aingle_cortex/src/middleware/rate_limit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ impl IntoResponse for RateLimitError {
)
.into_response();

// Add Retry-After header
// Add Retry-After header (infallible: From<u64> for HeaderValue)
response.headers_mut().insert(
"Retry-After",
HeaderValue::from_str(&secs.to_string()).unwrap(),
HeaderValue::from(*secs),
);

// Add rate limit headers
Expand Down Expand Up @@ -303,15 +303,15 @@ where
// Call inner service
let mut response = inner.call(req).await?;

// Add rate limit headers
// Add rate limit headers (infallible: From<u64>/From<u32>)
let headers = response.headers_mut();
headers.insert(
"X-RateLimit-Limit",
HeaderValue::from_str(&limiter.requests_per_minute.to_string()).unwrap(),
HeaderValue::from(limiter.requests_per_minute),
);
headers.insert(
"X-RateLimit-Remaining",
HeaderValue::from_str(&remaining.to_string()).unwrap(),
HeaderValue::from(remaining),
);

Ok(response)
Expand Down
2 changes: 1 addition & 1 deletion crates/aingle_cortex/src/p2p/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ mod tests {
config.port = 0; // OS-assigned
config.data_dir = tempfile::TempDir::new().unwrap().into_path();

let state = AppState::new();
let state = AppState::new().unwrap();
let manager = P2pManager::start(config, state).await.unwrap();
assert!(!manager.node_id().is_empty());

Expand Down
Loading
Loading