pub struct SentryApi<C: Unlocked, P = ChainsValidators> {
    pub adapter: Adapter<C, UnlockedState>,
    pub client: Client,
    pub logger: Logger,
    pub config: Config,
    pub sentry_url: ApiUrl,
    pub whoami: HashMap<ChainId, Validator>,
    pub propagate_to: P,
}

Fields

adapter: Adapter<C, UnlockedState>client: Clientlogger: Loggerconfig: Configsentry_url: ApiUrl

For all the calls that do not have information about the Chains

whoami: HashMap<ChainId, Validator>

Whilelisted chains for which this validator (Who Am I) can operate on.

Since the validator might have different urls for old vs new Campaigns, we can override the URL based on the campaign, see crate::Worker. Auth token for this validator is generated for each Chain on SentryApi::new

propagate_to: P

If set with Validators, propagate_to should contain the whoami Validator in each Chain! use SentryApi::init or SentryApi::with_propagate instead

Implementations

sentry_url is the default URL to which the current Who am I validator should make requests. It is used to populate the config Chains with Authentication Token & [ApiUrl]. This value can be overwritten using propagate_to, if any of the passed validators has the same [ValidatorId].

Initialize the SentryApi and makes sure that [Adapter::whoami()] is present in each chain Validators. Sets the Who am I [ApiUrl] and the Authentication Token for a specific Chain for calls that require authentication.

If the Who am I Validator is not found in propagate_to it will be added. Propagation should happen to all validators Sentry instances including Who am I i.e. the current validator. If a Chain in propagate_to is not setup (SentryApi::whoami) for this instance, an error is returned.

Get’s the last approved state and requesting a [primitives::validator::Heartbeat], see [LastApprovedResponse]

page always starts from 0

Get the accounting from Sentry Balances should always be in CheckedState

Fetches all Campaigns from the Who am I Sentry. It builds the Channels to be processed alongside all the Validators’ url & auth token.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more