{"modulePath":"github.com/ethersphere/beekeeper","version":"v0.15.9","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package debugapi\n\n## Functions\n\n```go\nfunc Bool(v bool) (p *bool)\n```\nBool is a helper routine that allocates a new bool value to store v and returns a pointer to it.\n\n```go\nfunc IsHTTPStatusErrorCode(err error, code int) bool\n```\nIsHTTPStatusErrorCode return whether the error is HTTPStatusError with a specific HTTP status code.\n\n## Types\n\n```go\ntype Account struct {\n\tBalance                  *bigint.BigInt `json:\"balance\"`\n\tConsumedBalance          *bigint.BigInt `json:\"consumedBalance\"`\n\tGhostBalance             *bigint.BigInt `json:\"ghostBalance\"`\n\tReservedBalance          *bigint.BigInt `json:\"reservedBalance\"`\n\tShadowReservedBalance    *bigint.BigInt `json:\"shadowReservedBalance\"`\n\tSurplusBalance           *bigint.BigInt `json:\"surplusBalance\"`\n\tThresholdReceived        *bigint.BigInt `json:\"thresholdReceived\"`\n\tThresholdGiven           *bigint.BigInt `json:\"thresholdGiven\"`\n\tCurrentThresholdReceived *bigint.BigInt `json:\"currentThresholdReceived\"`\n\tCurrentThresholdGiven    *bigint.BigInt `json:\"currentThresholdGiven\"`\n}\n```\nAccount represents node's account with a given peer\n\n```go\ntype Accounting struct {\n\tAccounting map[string]Account `json:\"peerData\"`\n}\n```\nAccounting represents node's accounts with all peers\n\n```go\ntype Addresses struct {\n\tEthereum     string        `json:\"ethereum\"`\n\tOverlay      swarm.Address `json:\"overlay\"`\n\tPublicKey    string        `json:\"public_key\"`\n\tUnderlay     []string      `json:\"underlay\"`\n\tPSSPublicKey string        `json:\"pss_public_key\"`\n}\n```\nAddresses represents node's addresses\n\n```go\ntype Balance struct {\n\tBalance *bigint.BigInt `json:\"balance\"`\n\tPeer    string         `json:\"peer\"`\n}\n```\nBalance represents node's balance with a peer\n\n```go\ntype Balances struct {\n\tBalances []Balance `json:\"balances\"`\n}\n```\nBalances represents node's balances with all peers\n\n```go\ntype Bin struct {\n\tPopulation        int        `json:\"population\"`\n\tConnected         int        `json:\"connected\"`\n\tDisconnectedPeers []PeerInfo `json:\"disconnectedPeers\"`\n\tConnectedPeers    []PeerInfo `json:\"connectedPeers\"`\n}\n```\nBin represents Kademlia bin\n\n```go\ntype CashoutStatusResponse struct {\n\tPeer            swarm.Address        `json:\"peer\"`\n\tCheque          *Cheque              `json:\"lastCashedCheque\"`\n\tTransactionHash *string              `json:\"transactionHash\"`\n\tResult          *CashoutStatusResult `json:\"result\"`\n\tUncashedAmount  *bigint.BigInt       `json:\"uncashedAmount\"`\n}\n```\n\n```go\ntype CashoutStatusResult struct {\n\tRecipient  string         `json:\"recipient\"`\n\tLastPayout *bigint.BigInt `json:\"lastPayout\"`\n\tBounced    bool           `json:\"bounced\"`\n}\n```\n\n```go\ntype Cheque struct {\n\tBeneficiary string         `json:\"beneficiary\"`\n\tChequebook  string         `json:\"chequebook\"`\n\tPayout      *bigint.BigInt `json:\"payout\"`\n}\n```\n\n```go\ntype ChequebookBalanceResponse struct {\n\tTotalBalance     *bigint.BigInt `json:\"totalBalance\"`\n\tAvailableBalance *bigint.BigInt `json:\"availableBalance\"`\n}\n```\n\n```go\ntype Client struct {\n\n\t// Services that API provides.\n\tNode     *NodeService\n\tPingPong *PingPongService\n\tPostage  *PostageService\n\tStake    *StakingService\n\t// contains filtered or unexported fields\n}\n```\nClient manages communication with the Bee Debug API.\n\n```go\nfunc NewClient(baseURL *url.URL, o *ClientOptions) (c *Client)\n```\nNewClient constructs a new Client.\n\n```go\ntype ClientOptions struct {\n\tHTTPClient *http.Client\n\tRestricted bool\n}\n```\nClientOptions holds optional parameters for the Client.\n\n```go\ntype DebugStore map[string]int\n```\nDebugStore represents DebugStore's response\n\n```go\ntype DebugStoreService service\n```\nDebugStoreService represents Bee's debug store service\n\n```go\nfunc (d *DebugStoreService) GetDebugStore(ctx context.Context) (DebugStore, error)\n```\nGetDebugStore gets db indices\n\n```go\ntype HTTPStatusError struct {\n\tCode int\n}\n```\nHTTPStatusError represents the error derived from the HTTP response status code.\n\n```go\nfunc NewHTTPStatusError(code int) *HTTPStatusError\n```\nNewHTTPStatusError creates a new instance of HTTPStatusError based on the provided code.\n\n```go\nfunc (e *HTTPStatusError) Error() string\n```\n\n```go\ntype Health struct {\n\tStatus string `json:\"status\"`\n}\n```\nHealth represents node's health\n\n```go\ntype MetricSnapshotView struct {\n\tLastSeenTimestamp          int64   `json:\"lastSeenTimestamp\"`\n\tSessionConnectionRetry     uint64  `json:\"sessionConnectionRetry\"`\n\tConnectionTotalDuration    float64 `json:\"connectionTotalDuration\"`\n\tSessionConnectionDuration  float64 `json:\"sessionConnectionDuration\"`\n\tSessionConnectionDirection string  `json:\"sessionConnectionDirection\"`\n\tLatencyEWMA                int64   `json:\"latencyEWMA\"`\n\tReachability               string  `json:\"reachability\"`\n}\n```\nMetricSnapshotView represents snapshot of metrics counters in more human readable form.\n\n```go\ntype NodeService service\n```\nNodeService represents Bee's Node service\n\n```go\nfunc (n *NodeService) Accounting(ctx context.Context) (resp Accounting, err error)\n```\nAccounting returns node's accounts with all peers\n\n```go\nfunc (n *NodeService) Addresses(ctx context.Context) (resp Addresses, err error)\n```\nAddresses returns node's addresses\n\n```go\nfunc (n *NodeService) Balance(ctx context.Context, a swarm.Address) (resp Balance, err error)\n```\nBalance returns node's balance with a given peer\n\n```go\nfunc (n *NodeService) Balances(ctx context.Context) (resp Balances, err error)\n```\nBalances returns node's balances with all peers\n\n```go\nfunc (n *NodeService) Cashout(ctx context.Context, a swarm.Address) (resp TransactionHashResponse, err error)\n```\n\n```go\nfunc (n *NodeService) CashoutStatus(ctx context.Context, a swarm.Address) (resp CashoutStatusResponse, err error)\n```\n\n```go\nfunc (n *NodeService) ChequebookBalance(ctx context.Context) (resp ChequebookBalanceResponse, err error)\n```\n\n```go\nfunc (n *NodeService) HasChunk(ctx context.Context, a swarm.Address) (bool, error)\n```\nHasChunk returns true/false if node has a chunk\n\n```go\nfunc (n *NodeService) Health(ctx context.Context) (resp Health, err error)\n```\nHealth returns node's health\n\n```go\nfunc (n *NodeService) Peers(ctx context.Context) (resp Peers, err error)\n```\nPeers returns node's peers\n\n```go\nfunc (n *NodeService) Readiness(ctx context.Context) (resp Readiness, err error)\n```\nReadiness returns node's readiness\n\n```go\nfunc (n *NodeService) Settlement(ctx context.Context, a swarm.Address) (resp Settlement, err error)\n```\nSettlement returns node's settlement with a given peer\n\n```go\nfunc (n *NodeService) Settlements(ctx context.Context) (resp Settlements, err error)\n```\nSettlements returns node's settlements with all peers\n\n```go\nfunc (n *NodeService) Topology(ctx context.Context) (resp Topology, err error)\n```\nTopology returns Kademlia topology\n\n```go\nfunc (n *NodeService) Wallet(ctx context.Context) (resp Wallet, err error)\n```\nWallet returns the wallet state\n\n```go\nfunc (n *NodeService) Withdraw(ctx context.Context, token, addr string, amount int64) (tx common.Hash, err error)\n```\nWithdraw calls wallet withdraw endpoint\n\n```go\ntype Peer struct {\n\tAddress swarm.Address `json:\"address\"`\n}\n```\nPeer represents node's peer\n\n```go\ntype PeerInfo struct {\n\tAddress swarm.Address       `json:\"address\"`\n\tMetrics *MetricSnapshotView `json:\"metrics,omitempty\"`\n}\n```\nPeerInfo is a view of peer information exposed to a user.\n\n```go\ntype Peers struct {\n\tPeers []Peer `json:\"peers\"`\n}\n```\nPeers represents node's peers\n\n```go\ntype PingPongService service\n```\nPingPongService represents Bee's PingPong service\n\n```go\nfunc (p *PingPongService) Ping(ctx context.Context, a swarm.Address) (resp Pong, err error)\n```\nPing pings given node\n\n```go\ntype Pong struct {\n\tRTT string `json:\"rtt\"`\n}\n```\nPong represents Ping's response\n\n```go\ntype PostageService service\n```\nPostageService represents Bee's Postage service\n\n```go\nfunc (p *PostageService) CreatePostageBatch(ctx context.Context, amount int64, depth uint64, label string) (batchID string, err error)\n```\nSends a create postage request to a node that returns the batchID\n\n```go\nfunc (p *PostageService) DilutePostageBatch(ctx context.Context, batchID string, newDepth uint64, gasPrice string) (err error)\n```\nSends a dilute batch request to a node that returns the batchID\n\n```go\nfunc (p *PostageService) PostageBatches(ctx context.Context) ([]PostageStampResponse, error)\n```\nFetches the list postage stamp batches\n\n```go\nfunc (p *PostageService) PostageStamp(ctx context.Context, batchID string) (PostageStampResponse, error)\n```\n\n```go\nfunc (p *PostageService) ReserveState(ctx context.Context) (ReserveState, error)\n```\nReturns the batchstore reservestate of the node\n\n```go\nfunc (p *PostageService) TopUpPostageBatch(ctx context.Context, batchID string, amount int64, gasPrice string) (err error)\n```\nSends a topup batch request to a node that returns the batchID\n\n```go\ntype PostageStampResponse struct {\n\tBatchID       string         `json:\"batchID\"`\n\tUtilization   uint32         `json:\"utilization\"`\n\tUsable        bool           `json:\"usable\"`\n\tLabel         string         `json:\"label\"`\n\tDepth         uint8          `json:\"depth\"`\n\tAmount        *bigint.BigInt `json:\"amount\"`\n\tBucketDepth   uint8          `json:\"bucketDepth\"`\n\tBlockNumber   uint64         `json:\"blockNumber\"`\n\tImmutableFlag bool           `json:\"immutableFlag\"`\n\tExists        bool           `json:\"exists\"`\n\tBatchTTL      int64          `json:\"batchTTL\"`\n}\n```\n\n```go\ntype Readiness struct {\n\tStatus string `json:\"status\"`\n}\n```\nReadiness represents node's readiness\n\n```go\ntype ReserveState struct {\n\tRadius        uint8 `json:\"radius\"`\n\tStorageRadius uint8 `json:\"storageRadius\"`\n}\n```\n\n```go\nfunc (rs ReserveState) String() string\n```\n\n```go\ntype Settlement struct {\n\tPeer     string         `json:\"peer\"`\n\tReceived *bigint.BigInt `json:\"received\"`\n\tSent     *bigint.BigInt `json:\"sent\"`\n}\n```\nSettlement represents node's settlement with a peer\n\n```go\ntype Settlements struct {\n\tSettlements   []Settlement   `json:\"settlements\"`\n\tTotalReceived *bigint.BigInt `json:\"totalReceived\"`\n\tTotalSent     *bigint.BigInt `json:\"totalSent\"`\n}\n```\nSettlements represents node's settlements with all peers\n\n```go\ntype StakingService service\n```\nStakingService represents Bee's staking service\n\n```go\nfunc (s *StakingService) DepositStake(ctx context.Context, amount *big.Int) (txHash string, err error)\n```\nDepositStake deposits stake\n\n```go\nfunc (s *StakingService) GetStakedAmount(ctx context.Context) (stakedAmount *big.Int, err error)\n```\nGetStakedAmount gets stake\n\n```go\nfunc (s *StakingService) WithdrawStake(ctx context.Context) (txHash string, err error)\n```\nWithdrawStake withdraws stake\n\n```go\ntype Topology struct {\n\tBaseAddr            swarm.Address  `json:\"baseAddr\"`\n\tPopulation          int            `json:\"population\"`\n\tConnected           int            `json:\"connected\"`\n\tTimestamp           time.Time      `json:\"timestamp\"`\n\tNnLowWatermark      int            `json:\"nnLowWatermark\"`\n\tDepth               int            `json:\"depth\"`\n\tBins                map[string]Bin `json:\"bins\"`\n\tLightNodes          Bin            `json:\"lightNodes\"`\n\tReachability        string         `json:\"reachability\"`        // current reachability status\n\tNetworkAvailability string         `json:\"networkAvailability\"` // network availability\n}\n```\nTopology represents Kademlia topology\n\n```go\ntype TransactionHashResponse struct {\n\tTransactionHash string `json:\"transactionHash\"`\n}\n```\n\n```go\ntype Wallet struct {\n\tBZZ         *bigint.BigInt `json:\"bzzBalance\"`\n\tNativeToken *bigint.BigInt `json:\"nativeTokenBalance\"`\n}\n```\n\n","path":"github.com/ethersphere/beekeeper/pkg/bee/debugapi","name":"debugapi","synopsis":"","isRedistributable":true}
