-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
398 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
identity1,127.0.0.1:8000,127.0.0.1:8001 | ||
identity2,127.0.0.1:8002,127.0.0.1:8003 | ||
identity3,127.0.0.1:8004,127.0.0.1:8005 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
use std::{collections::HashMap, net::SocketAddr}; | ||
|
||
use serde::{Serialize, Deserialize}; | ||
use shinkai_message_primitives::schemas::shinkai_name::ShinkaiName; | ||
|
||
|
||
#[derive(Clone, Debug, Serialize, Deserialize)] | ||
pub enum NodeProxyMode { | ||
// Node acts as a proxy, holds identities it proxies for | ||
// and a flag indicating if it allows new identities | ||
// if the flag is also then it will also clean up saved identities | ||
IsProxy(IsProxyConf), | ||
// Node is being proxied, holds its proxy's identity | ||
IsProxied(ProxyIdentity), | ||
// Node is not using a proxy | ||
NoProxy, | ||
} | ||
|
||
#[derive(Clone, Debug, Serialize, Deserialize)] | ||
pub struct IsProxyConf { | ||
// Flag indicating if new identities can be added | ||
pub allow_new_identities: bool, | ||
// Starting node identities | ||
pub proxy_node_identities: HashMap<String, ProxyIdentity>, | ||
} | ||
|
||
#[derive(Clone, Debug, Serialize, Deserialize)] | ||
pub struct ProxyIdentity { | ||
// Address of the API proxy | ||
pub api_peer: SocketAddr, | ||
// Address of the TCP proxy | ||
pub tcp_peer: SocketAddr, | ||
// Name of the proxied node | ||
// Or the name of my identity proxied | ||
pub shinkai_name: ShinkaiName, | ||
} | ||
|
Oops, something went wrong.