Skip to main content

Crate sidewinder_ops

Crate sidewinder_ops 

Source
Expand description

Client for a Sidewinder sidechain node.

SidewinderClient wraps the node’s Representational State Transfer (REST) surface — the reconciled sidewinder_rest.yaml v0.1.1 contract — behind the SidewinderOps trait, one method per endpoint. It is built on an algo_ops::AlgoOps handle (the enrolled parent-chain account, which signs the transactions the client builds) plus a SidewinderConfig naming the node URL and bearer token.

Beyond wrapping the endpoints, the client builds, canonically encodes, and signs transactions: SidewinderClient::build_signed_transaction turns a TransactionRequest into the bytes and identifier, and SidewinderClient::submit_transaction builds, signs, and submits in one call.

The client speaks only the HTTP contract; it takes no code dependency on the sidewinder crates and keeps neutral types on the boundary (e.g. PendingTransaction, NodeStatus), so a consumer stays decoupled from the node’s internal versions. Certificate and proof bytes are surfaced opaque and are not verified (a v0.0.2 non-goal).

Structs§

DiscoveredNode
A resolved cluster node: its Algorand identity address and the endpoint record it published. The identity is what a connecting client pins in the TLS handshake.
DiscoveryConfig
How to discover the permitted cluster nodes of an application: the local-state key/bit that marks a permitted cluster node (allow_sw_node) and the key its endpoint record lives under. These are the deploying application’s schema (for the Bingle contract: allow_static bit 2, endpoint rsvd_l_b1), so they are given explicitly rather than assumed.
EndpointRecord
a node’s published reachable endpoint(s): an optional IPv4 socket address and an optional IPv6 one, each independent (they need not share an address or a port). At least one is present in a valid record.
Event
An event emitted during execution.
EventSchema
One declared event in an operation’s configuration.
NodeStatus
The node’s view of the parent chain and node set (GET /v2/status).
OperationSchema
Operation configuration for a transaction type (GET /v2/operations/{typ}).
PendingTransaction
The current response for a transaction (GET /v2/transactions/pending/{txid}).
SidewinderClient
A client for one Sidewinder node, built on an AlgoOps parent-chain handle plus endpoint config.
SidewinderConfig
How to reach a Sidewinder node: its base Uniform Resource Locator (URL) and the bearer token required on every endpoint but /health.
SidewinderError
SignedTransaction
A built, signed transaction ready to submit.
SuggestedParams
Suggested parameters for building a transaction (GET /v2/transactions/params).
TransactionRequest
A transaction to build, canonically encode, and sign.
TxnError
A transaction failure (error in the pending response, present when stage is Failed, Rejected or Expired). message is the node’s reason.

Enums§

AppArg
Application argument type, similar to Kotlin variant handling.
Disposition
How a failed transaction was disposed of (disposition in an error body).
SidewinderErrorKind
Stage
Lifecycle stage of a transaction (stage in the REST response).

Traits§

SidewinderOps
The client-facing surface of a Sidewinder node.

Functions§

pinned_client_config
Build the mutual-TLS ClientConfig for reaching a node: it presents own’s identity certificate and pins the server to exactly node_identity — the node must present a certificate bound to that Algorand identity (any other authentic node, or a forged certificate, is rejected). The pin is a single-entry StaticMembership; no membership cache or node call is involved.
resolve_nodes
Resolve the live, permitted cluster nodes of cfg.app_id and their published endpoints, using algo for parent-chain access. Only nodes holding the allow_sw_node bit are returned, so an endpoint published by an unpermitted account cannot poison discovery. A redeploy that rewrites an endpoint is observed on the next call within the freshness window.