pub trait OrchestratorApi<KEY: SignatureKey> {
// 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<KEY>, 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<KEY>, 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<KEY>,
) -> 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<KEY>, ServerError>
fn post_getconfig( &mut self, _node_index: u16, ) -> Result<NetworkConfig<KEY>, 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<KEY>, ServerError>
fn post_config_after_peer_collected( &mut self, ) -> Result<NetworkConfig<KEY>, 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<KEY>,
) -> Result<(), ServerError>
fn post_ready( &mut self, peer_config: &PeerConfig<KEY>, ) -> Result<(), ServerError>
A node POSTs its public key to let the orchestrator know that it is ready
§Errors
if unable to serve