pub trait OrchestratorApi<TYPES: NodeType> {
// Required methods
fn post_identity(
&mut self,
libp2p_address: Option<Multiaddr>,
libp2p_public_key: Option<PeerId>,
) -> Result<u16, ServerError>;
fn post_getconfig(
&mut self,
_node_index: u16,
) -> Result<NetworkConfig<TYPES>, ServerError>;
fn get_tmp_node_index(&mut self) -> Result<u16, ServerError>;
fn register_public_key(
&mut self,
pubkey: &mut Vec<u8>,
is_da: bool,
libp2p_address: Option<Multiaddr>,
libp2p_public_key: Option<PeerId>,
) -> Result<(u64, bool), ServerError>;
fn peer_pub_ready(&self) -> Result<bool, ServerError>;
fn post_config_after_peer_collected(
&mut self,
) -> Result<NetworkConfig<TYPES>, ServerError>;
fn get_start(&self) -> Result<bool, ServerError>;
fn post_run_results(
&mut self,
metrics: BenchResults,
) -> Result<(), ServerError>;
fn post_ready(
&mut self,
peer_config: &PeerConfig<TYPES>,
) -> Result<(), ServerError>;
fn post_manual_start(
&mut self,
password_bytes: Vec<u8>,
) -> Result<(), ServerError>;
fn post_builder(&mut self, builder: Url) -> Result<(), ServerError>;
fn get_builders(&self) -> Result<Vec<Url>, ServerError>;
}
Expand description
An api exposed by the orchestrator
Required Methods§
Sourcefn post_identity(
&mut self,
libp2p_address: Option<Multiaddr>,
libp2p_public_key: Option<PeerId>,
) -> Result<u16, ServerError>
fn post_identity( &mut self, libp2p_address: Option<Multiaddr>, libp2p_public_key: Option<PeerId>, ) -> Result<u16, ServerError>
Post an identity to the orchestrator. Takes in optional arguments so others can identify us on the Libp2p network.
§Errors
If we were unable to serve the request
Sourcefn post_getconfig(
&mut self,
_node_index: u16,
) -> Result<NetworkConfig<TYPES>, ServerError>
fn post_getconfig( &mut self, _node_index: u16, ) -> Result<NetworkConfig<TYPES>, ServerError>
Sourcefn get_tmp_node_index(&mut self) -> Result<u16, ServerError>
fn get_tmp_node_index(&mut self) -> Result<u16, ServerError>
Sourcefn register_public_key(
&mut self,
pubkey: &mut Vec<u8>,
is_da: bool,
libp2p_address: Option<Multiaddr>,
libp2p_public_key: Option<PeerId>,
) -> Result<(u64, bool), ServerError>
fn register_public_key( &mut self, pubkey: &mut Vec<u8>, is_da: bool, libp2p_address: Option<Multiaddr>, libp2p_public_key: Option<PeerId>, ) -> Result<(u64, bool), ServerError>
Sourcefn peer_pub_ready(&self) -> Result<bool, ServerError>
fn peer_pub_ready(&self) -> Result<bool, ServerError>
Sourcefn post_config_after_peer_collected(
&mut self,
) -> Result<NetworkConfig<TYPES>, ServerError>
fn post_config_after_peer_collected( &mut self, ) -> Result<NetworkConfig<TYPES>, ServerError>
get endpoint for the network config after all peers public keys are collected
§Errors
if unable to serve
Sourcefn post_run_results(&mut self, metrics: BenchResults) -> Result<(), ServerError>
fn post_run_results(&mut self, metrics: BenchResults) -> Result<(), ServerError>
Sourcefn post_ready(
&mut self,
peer_config: &PeerConfig<TYPES>,
) -> Result<(), ServerError>
fn post_ready( &mut self, peer_config: &PeerConfig<TYPES>, ) -> Result<(), ServerError>
A node POSTs its public key to let the orchestrator know that it is ready
§Errors
if unable to serve