Function request_service

Source
pub async fn request_service(
    ws_rpc_url: String,
    blueprint_id: u64,
    min_exposure_percent: u8,
    max_exposure_percent: u8,
    target_operators: Vec<AccountId32>,
    value: u128,
    keystore_uri: String,
) -> Result<()>
Expand description

Requests a service from the Tangle Network.

§Arguments

  • ws_rpc_url - WebSocket RPC URL for the Tangle Network
  • blueprint_id - ID of the blueprint to request
  • min_exposure_percent - Minimum exposure percentage
  • max_exposure_percent - Maximum exposure percentage
  • target_operators - List of target operators
  • value - Value to stake
  • keystore_uri - URI for the keystore

§Errors

Returns an error if:

  • Failed to connect to the Tangle Network
  • Failed to sign or submit the transaction
  • Transaction failed

§Panics

Panics if:

  • Failed to create keystore
  • Failed to get keys from keystore