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§
- Discovered
Node - 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.
- Discovery
Config - 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_staticbit 2, endpointrsvd_l_b1), so they are given explicitly rather than assumed. - Endpoint
Record - 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.
- Event
Schema - One declared event in an operation’s configuration.
- Node
Status - The node’s view of the parent chain and node set (
GET /v2/status). - Operation
Schema - Operation configuration for a transaction type (
GET /v2/operations/{typ}). - Pending
Transaction - The current response for a transaction (
GET /v2/transactions/pending/{txid}). - Sidewinder
Client - A client for one Sidewinder node, built on an
AlgoOpsparent-chain handle plus endpoint config. - Sidewinder
Config - How to reach a Sidewinder node: its base Uniform Resource Locator (URL) and the bearer token
required on every endpoint but
/health. - Sidewinder
Error - Signed
Transaction - A built, signed transaction ready to submit.
- Suggested
Params - Suggested parameters for building a transaction (
GET /v2/transactions/params). - Transaction
Request - A transaction to build, canonically encode, and sign.
- TxnError
- A transaction failure (
errorin the pending response, present whenstageisFailed,RejectedorExpired).messageis the node’s reason.
Enums§
- AppArg
- Application argument type, similar to Kotlin variant handling.
- Disposition
- How a failed transaction was disposed of (
dispositionin an error body). - Sidewinder
Error Kind - Stage
- Lifecycle stage of a transaction (
stagein the REST response).
Traits§
- Sidewinder
Ops - The client-facing surface of a Sidewinder node.
Functions§
- pinned_
client_ config - Build the mutual-TLS
ClientConfigfor reaching a node: it presentsown’s identity certificate and pins the server to exactlynode_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-entryStaticMembership; no membership cache or node call is involved. - resolve_
nodes - Resolve the live, permitted cluster nodes of
cfg.app_idand their published endpoints, usingalgofor parent-chain access. Only nodes holding theallow_sw_nodebit 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.