pub struct DebugApi { /* private fields */ }Expand description
Handle exposing the debug endpoints. Cheap to clone.
Implementations§
Source§impl DebugApi
impl DebugApi
Sourcepub async fn balances(&self) -> Result<Vec<Balance>, Error>
pub async fn balances(&self) -> Result<Vec<Balance>, Error>
GET /balances — settlement balances with every known peer.
Sourcepub async fn peer_balance(&self, address: &str) -> Result<Balance, Error>
pub async fn peer_balance(&self, address: &str) -> Result<Balance, Error>
GET /balances/{address} — settlement balance with one peer.
Sourcepub async fn consumed_balances(&self) -> Result<Vec<Balance>, Error>
pub async fn consumed_balances(&self) -> Result<Vec<Balance>, Error>
GET /consumed — past-due consumption balances with every peer.
Sourcepub async fn peer_consumed_balance(
&self,
address: &str,
) -> Result<Balance, Error>
pub async fn peer_consumed_balance( &self, address: &str, ) -> Result<Balance, Error>
GET /consumed/{address} — past-due consumption balance with
one peer.
Sourcepub async fn accounting(&self) -> Result<HashMap<String, PeerAccounting>, Error>
pub async fn accounting(&self) -> Result<HashMap<String, PeerAccounting>, Error>
GET /accounting — full per-peer accounting snapshot keyed by
peer overlay address.
Sourcepub async fn deposit_stake(&self, amount: &BigInt) -> Result<String, Error>
pub async fn deposit_stake(&self, amount: &BigInt) -> Result<String, Error>
POST /stake/{amount} — stake the given amount (PLUR). Returns
the on-chain transaction hash.
Sourcepub async fn withdrawable_stake(&self) -> Result<BigInt, Error>
pub async fn withdrawable_stake(&self) -> Result<BigInt, Error>
GET /stake/withdrawable — withdrawable staked BZZ (PLUR).
Sourcepub async fn withdraw_surplus_stake(&self) -> Result<String, Error>
pub async fn withdraw_surplus_stake(&self) -> Result<String, Error>
DELETE /stake/withdrawable — withdraw surplus stake.
Sourcepub async fn migrate_stake(&self) -> Result<String, Error>
pub async fn migrate_stake(&self) -> Result<String, Error>
DELETE /stake — migrate the stake. Returns the transaction
hash.
Sourcepub async fn redistribution_state(&self) -> Result<RedistributionState, Error>
pub async fn redistribution_state(&self) -> Result<RedistributionState, Error>
GET /redistributionstate — redistribution worker snapshot.
Sourcepub async fn r_chash(
&self,
depth: u8,
anchor1: &str,
anchor2: &str,
) -> Result<RCHashResponse, Error>
pub async fn r_chash( &self, depth: u8, anchor1: &str, anchor2: &str, ) -> Result<RCHashResponse, Error>
GET /rchash/{depth}/{anchor1}/{anchor2} — reserve-commitment
hash with sample inclusion proofs. Used by the redistribution
game; in a TUI / dashboard this is also the natural “sampler
benchmark” — the returned duration_seconds tells operators
whether their hardware can complete a sample within the round
deadline.
Source§impl DebugApi
impl DebugApi
Sourcepub async fn wallet(&self) -> Result<Wallet, Error>
pub async fn wallet(&self) -> Result<Wallet, Error>
GET /wallet — node operator wallet snapshot.
Sourcepub async fn withdraw_bzz(
&self,
amount: &BigInt,
address: &str,
) -> Result<String, Error>
pub async fn withdraw_bzz( &self, amount: &BigInt, address: &str, ) -> Result<String, Error>
POST /wallet/withdraw/bzz?amount=&address= — withdraw BZZ to
an external address. Returns the on-chain transaction hash.
Sourcepub async fn withdraw_native_token(
&self,
amount: &BigInt,
address: &str,
) -> Result<String, Error>
pub async fn withdraw_native_token( &self, amount: &BigInt, address: &str, ) -> Result<String, Error>
POST /wallet/withdraw/nativetoken?amount=&address= — withdraw
the native settlement token (xDAI / ETH).
Sourcepub async fn chequebook_balance(&self) -> Result<ChequebookBalance, Error>
pub async fn chequebook_balance(&self) -> Result<ChequebookBalance, Error>
GET /chequebook/balance — total + available chequebook PLUR.
Sourcepub async fn chequebook_address(&self) -> Result<String, Error>
pub async fn chequebook_address(&self) -> Result<String, Error>
GET /chequebook/address — the on-chain chequebook contract
address. Useful when an operator needs to look the chequebook
up on a block explorer or audit it independently from the
wallet response.
Sourcepub async fn chequebook_deposit(&self, amount: &BigInt) -> Result<String, Error>
pub async fn chequebook_deposit(&self, amount: &BigInt) -> Result<String, Error>
POST /chequebook/deposit?amount= — deposit BZZ into the
chequebook from the operator wallet.
Sourcepub async fn chequebook_withdraw(
&self,
amount: &BigInt,
) -> Result<String, Error>
pub async fn chequebook_withdraw( &self, amount: &BigInt, ) -> Result<String, Error>
POST /chequebook/withdraw?amount= — withdraw BZZ from the
chequebook back to the operator wallet.
Sourcepub async fn last_cheques(&self) -> Result<Vec<LastCheque>, Error>
pub async fn last_cheques(&self) -> Result<Vec<LastCheque>, Error>
GET /chequebook/cheque — the last received cheque per peer.
Sourcepub async fn peer_cheques(&self, peer: &str) -> Result<PeerCheques, Error>
pub async fn peer_cheques(&self, peer: &str) -> Result<PeerCheques, Error>
GET /chequebook/cheque/{peer} — last sent + received cheque
for one peer.
Sourcepub async fn last_cashout_action(
&self,
peer: &str,
) -> Result<LastCashoutAction, Error>
pub async fn last_cashout_action( &self, peer: &str, ) -> Result<LastCashoutAction, Error>
GET /chequebook/cashout/{peer} — last cashout action snapshot
for one peer.
Sourcepub async fn cashout_last_cheque(
&self,
peer: &str,
gas_price: Option<&BigInt>,
) -> Result<String, Error>
pub async fn cashout_last_cheque( &self, peer: &str, gas_price: Option<&BigInt>, ) -> Result<String, Error>
POST /chequebook/cashout/{peer} — cash out the last received
cheque from a peer. gas_price is optional (sent in the
gas-price header when present). Returns the cashout
transaction hash.
Sourcepub async fn settlements(&self) -> Result<Settlements, Error>
pub async fn settlements(&self) -> Result<Settlements, Error>
GET /settlements — totals + per-peer settlement breakdown.
Sourcepub async fn peer_settlement(&self, peer: &str) -> Result<Settlement, Error>
pub async fn peer_settlement(&self, peer: &str) -> Result<Settlement, Error>
GET /settlements/{peer} — settlement totals for one peer.
Sourcepub async fn time_settlements(&self) -> Result<Settlements, Error>
pub async fn time_settlements(&self) -> Result<Settlements, Error>
GET /timesettlements — totals + per-peer breakdown for the
time-based (pseudo-settle / refresh) settlement path. Same
schema as Self::settlements but counts only refresh-rate
settlements rather than cheques.
Source§impl DebugApi
impl DebugApi
Sourcepub async fn loggers(&self) -> Result<LoggerListing, Error>
pub async fn loggers(&self) -> Result<LoggerListing, Error>
GET /loggers — every logger registered in the running node.
Sourcepub async fn loggers_by_expression(
&self,
expression: &str,
) -> Result<LoggerListing, Error>
pub async fn loggers_by_expression( &self, expression: &str, ) -> Result<LoggerListing, Error>
GET /loggers/{base64url(expression)} — loggers matching the
regex / subsystem expression. The expression is base64url
(padded) encoded per the Bee /loggers/{exp} contract.
Sourcepub async fn set_logger(
&self,
expression: &str,
verbosity: &str,
) -> Result<(), Error>
pub async fn set_logger( &self, expression: &str, verbosity: &str, ) -> Result<(), Error>
PUT /loggers/{base64url(expression)}/{verbosity} — set the
verbosity of every logger matching expression. verbosity
must be one of [LOG_LEVELS] (none|error|warning|info|debug| all); anything else is rejected client-side with
Error::Argument before the request is built.
Example: set_logger("node/pushsync", "debug") raises the
pushsync subsystem to debug verbosity. To bump every logger
at once, pass "." (Bee treats it as a regex match-all).
Sourcepub async fn set_logger_verbosity(&self, _expression: &str) -> Result<(), Error>
👎Deprecated since 1.6.0: broken — emits the wrong path. Use set_logger(expr, verbosity) instead.
pub async fn set_logger_verbosity(&self, _expression: &str) -> Result<(), Error>
broken — emits the wrong path. Use set_logger(expr, verbosity) instead.
Deprecated, broken method. Bee’s actual route is
PUT /loggers/{exp}/{verbosity} — verbosity is mandatory
in the path, but this method emits PUT /loggers/{exp} which
404s on every real Bee build. Always returned 404 against a
live node; only ever “succeeded” against mock servers wired
to the wrong path.
Use DebugApi::set_logger instead — it takes both the
expression and verbosity and emits the correct path.
Source§impl DebugApi
impl DebugApi
Sourcepub async fn health(&self) -> Result<Health, Error>
pub async fn health(&self) -> Result<Health, Error>
GET /health — basic liveness + version info.
Sourcepub async fn versions(&self) -> Result<BeeVersions, Error>
pub async fn versions(&self) -> Result<BeeVersions, Error>
Structured version triple derived from /health.
Sourcepub async fn is_supported_api_version(&self) -> Result<bool, Error>
pub async fn is_supported_api_version(&self) -> Result<bool, Error>
True iff the Bee node’s reported API version equals
SUPPORTED_API_VERSION.
Sourcepub async fn is_supported_exact_version(&self) -> Result<bool, Error>
pub async fn is_supported_exact_version(&self) -> Result<bool, Error>
True iff the Bee node’s reported version equals
SUPPORTED_BEE_VERSION_EXACT.
Sourcepub async fn chain_state(&self) -> Result<ChainState, Error>
pub async fn chain_state(&self) -> Result<ChainState, Error>
GET /chainstate — current price and total amount as bigints.
Sourcepub async fn status(&self) -> Result<Status, Error>
pub async fn status(&self) -> Result<Status, Error>
GET /status — operational snapshot (reserve size, sync, peers).
Sourcepub async fn status_peers(&self) -> Result<Vec<PeerStatus>, Error>
pub async fn status_peers(&self) -> Result<Vec<PeerStatus>, Error>
GET /status/peers — per-peer status snapshots gathered in
parallel by the Bee node. Peers that don’t respond have
request_failed = true.
Sourcepub async fn status_neighborhoods(&self) -> Result<Vec<Neighborhood>, Error>
pub async fn status_neighborhoods(&self) -> Result<Vec<Neighborhood>, Error>
GET /status/neighborhoods — reserve statistics per
neighbourhood.
Sourcepub async fn readiness(&self) -> Result<bool, Error>
pub async fn readiness(&self) -> Result<bool, Error>
GET /readiness — true if the node returns 2xx, false on 404,
otherwise the underlying error.
Sourcepub async fn is_gateway(&self) -> Result<bool, Error>
pub async fn is_gateway(&self) -> Result<bool, Error>
GET /gateway — true when Bee is running in gateway mode. A
404 (gateway disabled) becomes Ok(false) — matching bee-js.
Sourcepub async fn is_connected(&self) -> bool
pub async fn is_connected(&self) -> bool
Ping the base URL — true on any 2xx response. Mirrors bee-js
Bee.isConnected.
Sourcepub async fn check_connection(&self) -> Result<(), Error>
pub async fn check_connection(&self) -> Result<(), Error>
Same as DebugApi::is_connected but returns the underlying
error if the node is unreachable.
Source§impl DebugApi
impl DebugApi
Sourcepub async fn peers(&self) -> Result<Vec<Peer>, Error>
pub async fn peers(&self) -> Result<Vec<Peer>, Error>
GET /peers — list every peer this node is currently connected to.
Sourcepub async fn blocklist(&self) -> Result<Vec<Peer>, Error>
pub async fn blocklist(&self) -> Result<Vec<Peer>, Error>
GET /blocklist — peers currently blocklisted by this node.
Sourcepub async fn remove_peer(&self, address: &str) -> Result<(), Error>
pub async fn remove_peer(&self, address: &str) -> Result<(), Error>
DELETE /peers/{address} — disconnect and forget a peer.
Sourcepub async fn ping_peer(&self, address: &str) -> Result<String, Error>
pub async fn ping_peer(&self, address: &str) -> Result<String, Error>
POST /pingpong/{address} — round-trip ping a peer. Returns the
reported RTT string (e.g. "2.5ms").
Sourcepub async fn connect_peer(&self, multiaddr: &str) -> Result<String, Error>
pub async fn connect_peer(&self, multiaddr: &str) -> Result<String, Error>
POST /connect/{multiaddr} — manually dial a peer at the given
multiaddress (e.g. "/dns/bee.example.com/tcp/1634/p2p/16Uiu…").
Returns the resulting overlay address. A leading / in
multiaddr is stripped.
Sourcepub async fn addresses(&self) -> Result<Addresses, Error>
pub async fn addresses(&self) -> Result<Addresses, Error>
GET /addresses — node overlay / underlay / ethereum / pubkeys.
Sourcepub async fn topology(&self) -> Result<Topology, Error>
pub async fn topology(&self) -> Result<Topology, Error>
GET /topology — Kademlia topology snapshot.
Sourcepub async fn reserve_state(&self) -> Result<ReserveState, Error>
pub async fn reserve_state(&self) -> Result<ReserveState, Error>
GET /reservestate — current reserve radius/commitment.
Sourcepub async fn welcome_message(&self) -> Result<String, Error>
pub async fn welcome_message(&self) -> Result<String, Error>
GET /welcome-message — P2P welcome banner.
Source§impl DebugApi
impl DebugApi
Sourcepub async fn pending_transactions(&self) -> Result<Vec<TransactionInfo>, Error>
pub async fn pending_transactions(&self) -> Result<Vec<TransactionInfo>, Error>
GET /transactions — every pending transaction Bee tracks.
Sourcepub async fn pending_transaction(
&self,
tx_hash: &str,
) -> Result<TransactionInfo, Error>
pub async fn pending_transaction( &self, tx_hash: &str, ) -> Result<TransactionInfo, Error>
GET /transactions/{hash} — info for one pending transaction.
Sourcepub async fn rebroadcast_transaction(
&self,
tx_hash: &str,
) -> Result<String, Error>
pub async fn rebroadcast_transaction( &self, tx_hash: &str, ) -> Result<String, Error>
POST /transactions/{hash} — replay a pending transaction to
the network. Returns the resulting transaction hash.
Sourcepub async fn cancel_transaction(
&self,
tx_hash: &str,
gas_price: Option<&BigInt>,
) -> Result<String, Error>
pub async fn cancel_transaction( &self, tx_hash: &str, gas_price: Option<&BigInt>, ) -> Result<String, Error>
DELETE /transactions/{hash} — cancel a pending transaction by
replacing it at the same nonce. gas_price is optional (None
lets Bee pick); when Some(_) it’s sent in the gas-price
header so the replacement bumps the fee. Returns the resulting
transaction hash.