Skip to main content

DebugApi

Struct DebugApi 

Source
pub struct DebugApi { /* private fields */ }
Expand description

Handle exposing the debug endpoints. Cheap to clone.

Implementations§

Source§

impl DebugApi

Source

pub async fn balances(&self) -> Result<Vec<Balance>, Error>

GET /balances — settlement balances with every known peer.

Source

pub async fn peer_balance(&self, address: &str) -> Result<Balance, Error>

GET /balances/{address} — settlement balance with one peer.

Source

pub async fn consumed_balances(&self) -> Result<Vec<Balance>, Error>

GET /consumed — past-due consumption balances with every peer.

Source

pub async fn peer_consumed_balance( &self, address: &str, ) -> Result<Balance, Error>

GET /consumed/{address} — past-due consumption balance with one peer.

Source

pub async fn accounting(&self) -> Result<HashMap<String, PeerAccounting>, Error>

GET /accounting — full per-peer accounting snapshot keyed by peer overlay address.

Source

pub async fn stake(&self) -> Result<BigInt, Error>

GET /stake — staked BZZ amount (PLUR).

Source

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.

Source

pub async fn withdrawable_stake(&self) -> Result<BigInt, Error>

GET /stake/withdrawable — withdrawable staked BZZ (PLUR).

Source

pub async fn withdraw_surplus_stake(&self) -> Result<String, Error>

DELETE /stake/withdrawable — withdraw surplus stake.

Source

pub async fn migrate_stake(&self) -> Result<String, Error>

DELETE /stake — migrate the stake. Returns the transaction hash.

Source

pub async fn redistribution_state(&self) -> Result<RedistributionState, Error>

GET /redistributionstate — redistribution worker snapshot.

Source

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

Source

pub async fn wallet(&self) -> Result<Wallet, Error>

GET /wallet — node operator wallet snapshot.

Source

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.

Source

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).

Source

pub async fn chequebook_balance(&self) -> Result<ChequebookBalance, Error>

GET /chequebook/balance — total + available chequebook PLUR.

Source

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.

Source

pub async fn chequebook_deposit(&self, amount: &BigInt) -> Result<String, Error>

POST /chequebook/deposit?amount= — deposit BZZ into the chequebook from the operator wallet.

Source

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.

Source

pub async fn last_cheques(&self) -> Result<Vec<LastCheque>, Error>

GET /chequebook/cheque — the last received cheque per peer.

Source

pub async fn peer_cheques(&self, peer: &str) -> Result<PeerCheques, Error>

GET /chequebook/cheque/{peer} — last sent + received cheque for one peer.

Source

pub async fn last_cashout_action( &self, peer: &str, ) -> Result<LastCashoutAction, Error>

GET /chequebook/cashout/{peer} — last cashout action snapshot for one peer.

Source

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.

Source

pub async fn settlements(&self) -> Result<Settlements, Error>

GET /settlements — totals + per-peer settlement breakdown.

Source

pub async fn peer_settlement(&self, peer: &str) -> Result<Settlement, Error>

GET /settlements/{peer} — settlement totals for one peer.

Source

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

Source

pub async fn loggers(&self) -> Result<LoggerListing, Error>

GET /loggers — every logger registered in the running node.

Source

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.

Source

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).

Source

pub 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.

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

Source

pub async fn health(&self) -> Result<Health, Error>

GET /health — basic liveness + version info.

Source

pub async fn versions(&self) -> Result<BeeVersions, Error>

Structured version triple derived from /health.

Source

pub async fn is_supported_api_version(&self) -> Result<bool, Error>

True iff the Bee node’s reported API version equals SUPPORTED_API_VERSION.

Source

pub async fn is_supported_exact_version(&self) -> Result<bool, Error>

True iff the Bee node’s reported version equals SUPPORTED_BEE_VERSION_EXACT.

Source

pub async fn chain_state(&self) -> Result<ChainState, Error>

GET /chainstate — current price and total amount as bigints.

Source

pub async fn node_info(&self) -> Result<NodeInfo, Error>

GET /node — operator-mode flags.

Source

pub async fn status(&self) -> Result<Status, Error>

GET /status — operational snapshot (reserve size, sync, peers).

Source

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.

Source

pub async fn status_neighborhoods(&self) -> Result<Vec<Neighborhood>, Error>

GET /status/neighborhoods — reserve statistics per neighbourhood.

Source

pub async fn readiness(&self) -> Result<bool, Error>

GET /readiness — true if the node returns 2xx, false on 404, otherwise the underlying error.

Source

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.

Source

pub async fn is_connected(&self) -> bool

Ping the base URL — true on any 2xx response. Mirrors bee-js Bee.isConnected.

Source

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

Source

pub async fn peers(&self) -> Result<Vec<Peer>, Error>

GET /peers — list every peer this node is currently connected to.

Source

pub async fn blocklist(&self) -> Result<Vec<Peer>, Error>

GET /blocklist — peers currently blocklisted by this node.

Source

pub async fn remove_peer(&self, address: &str) -> Result<(), Error>

DELETE /peers/{address} — disconnect and forget a peer.

Source

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").

Source

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.

Source

pub async fn addresses(&self) -> Result<Addresses, Error>

GET /addresses — node overlay / underlay / ethereum / pubkeys.

Source

pub async fn topology(&self) -> Result<Topology, Error>

GET /topology — Kademlia topology snapshot.

Source

pub async fn reserve_state(&self) -> Result<ReserveState, Error>

GET /reservestate — current reserve radius/commitment.

Source

pub async fn welcome_message(&self) -> Result<String, Error>

GET /welcome-message — P2P welcome banner.

Source

pub async fn set_welcome_message(&self, message: &str) -> Result<(), Error>

POST /welcome-message — update the P2P welcome banner.

Source§

impl DebugApi

Source

pub async fn pending_transactions(&self) -> Result<Vec<TransactionInfo>, Error>

GET /transactions — every pending transaction Bee tracks.

Source

pub async fn pending_transaction( &self, tx_hash: &str, ) -> Result<TransactionInfo, Error>

GET /transactions/{hash} — info for one pending transaction.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for DebugApi

Source§

fn clone(&self) -> DebugApi

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DebugApi

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

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

fn in_current_span(self) -> Instrumented<Self>

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

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more