debugapi

package
v0.10.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2022 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(v bool) (p *bool)

Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.

func IsHTTPStatusErrorCode added in v0.8.5

func IsHTTPStatusErrorCode(err error, code int) bool

IsHTTPStatusErrorCode return whether the error is HTTPStatusError with a specific HTTP status code.

Types

type Addresses

type Addresses struct {
	Ethereum     string        `json:"ethereum"`
	Overlay      swarm.Address `json:"overlay"`
	PublicKey    string        `json:"public_key"`
	Underlay     []string      `json:"underlay"`
	PSSPublicKey string        `json:"pss_public_key"`
}

Addresses represents node's addresses

type Balance added in v0.8.5

type Balance struct {
	Balance *bigint.BigInt `json:"balance"`
	Peer    string         `json:"peer"`
}

Balance represents node's balance with a peer

type Balances added in v0.8.5

type Balances struct {
	Balances []Balance `json:"balances"`
}

Balances represents node's balances with all peers

type Bin added in v0.8.5

type Bin struct {
	Population        int             `json:"population"`
	Connected         int             `json:"connected"`
	DisconnectedPeers []swarm.Address `json:"disconnectedPeers"`
	ConnectedPeers    []swarm.Address `json:"connectedPeers"`
}

Bin represents Kademlia bin

type CashoutStatusResponse added in v0.8.5

type CashoutStatusResponse struct {
	Peer            swarm.Address        `json:"peer"`
	Cheque          *Cheque              `json:"lastCashedCheque"`
	TransactionHash *string              `json:"transactionHash"`
	Result          *CashoutStatusResult `json:"result"`
	UncashedAmount  *bigint.BigInt       `json:"uncashedAmount"`
}

type CashoutStatusResult added in v0.8.5

type CashoutStatusResult struct {
	Recipient  string         `json:"recipient"`
	LastPayout *bigint.BigInt `json:"lastPayout"`
	Bounced    bool           `json:"bounced"`
}

type Cheque added in v0.8.5

type Cheque struct {
	Beneficiary string         `json:"beneficiary"`
	Chequebook  string         `json:"chequebook"`
	Payout      *bigint.BigInt `json:"payout"`
}

type ChequebookBalanceResponse added in v0.8.5

type ChequebookBalanceResponse struct {
	TotalBalance     *bigint.BigInt `json:"totalBalance"`
	AvailableBalance *bigint.BigInt `json:"availableBalance"`
}

type ChunksService added in v0.8.5

type ChunksService service

ChunksService represents Bee's debug Chunks service

func (*ChunksService) Remove added in v0.8.5

func (c *ChunksService) Remove(ctx context.Context, a swarm.Address) (err error)

Remove removed the chunk from the node's local store

type Client

type Client struct {

	// Services that API provides.
	Node     *NodeService
	PingPong *PingPongService
	Postage  *PostageService
	// contains filtered or unexported fields
}

Client manages communication with the Bee Debug API.

func NewClient

func NewClient(baseURL *url.URL, o *ClientOptions) (c *Client)

NewClient constructs a new Client.

type ClientOptions

type ClientOptions struct {
	HTTPClient *http.Client
	Restricted bool
}

ClientOptions holds optional parameters for the Client.

type HTTPStatusError added in v0.8.5

type HTTPStatusError struct {
	Code int
}

HTTPStatusError represents the error derived from the HTTP response status code.

func NewHTTPStatusError added in v0.8.5

func NewHTTPStatusError(code int) *HTTPStatusError

NewHTTPStatusError creates a new instance of HTTPStatusError based on the provided code.

func (*HTTPStatusError) Error added in v0.8.5

func (e *HTTPStatusError) Error() string

type Health added in v0.8.5

type Health struct {
	Status string `json:"status"`
}

Health represents node's health

type NodeService

type NodeService service

NodeService represents Bee's Node service

func (*NodeService) Addresses

func (n *NodeService) Addresses(ctx context.Context) (resp Addresses, err error)

Addresses returns node's addresses

func (*NodeService) Balance added in v0.8.5

func (n *NodeService) Balance(ctx context.Context, a swarm.Address) (resp Balance, err error)

Balance returns node's balance with a given peer

func (*NodeService) Balances added in v0.8.5

func (n *NodeService) Balances(ctx context.Context) (resp Balances, err error)

Balances returns node's balances with all peers

func (*NodeService) Cashout added in v0.8.5

func (n *NodeService) Cashout(ctx context.Context, a swarm.Address) (resp TransactionHashResponse, err error)

func (*NodeService) CashoutStatus added in v0.8.5

func (n *NodeService) CashoutStatus(ctx context.Context, a swarm.Address) (resp CashoutStatusResponse, err error)

func (*NodeService) ChequebookBalance added in v0.8.5

func (n *NodeService) ChequebookBalance(ctx context.Context) (resp ChequebookBalanceResponse, err error)

func (*NodeService) HasChunk added in v0.1.3

func (n *NodeService) HasChunk(ctx context.Context, a swarm.Address) (bool, error)

HasChunk returns true/false if node has a chunk

func (*NodeService) Health added in v0.8.5

func (n *NodeService) Health(ctx context.Context) (resp Health, err error)

Health returns node's health

func (*NodeService) Peers

func (n *NodeService) Peers(ctx context.Context) (resp Peers, err error)

Peers returns node's peers

func (*NodeService) Readiness added in v0.8.5

func (n *NodeService) Readiness(ctx context.Context) (resp Readiness, err error)

Readiness returns node's readiness

func (*NodeService) RemoveChunk added in v0.8.5

func (n *NodeService) RemoveChunk(ctx context.Context, a swarm.Address) error

RemoveChunk removes chunk from the node

func (*NodeService) Settlement added in v0.8.5

func (n *NodeService) Settlement(ctx context.Context, a swarm.Address) (resp Settlement, err error)

Settlement returns node's settlement with a given peer

func (*NodeService) Settlements added in v0.8.5

func (n *NodeService) Settlements(ctx context.Context) (resp Settlements, err error)

Settlements returns node's settlements with all peers

func (*NodeService) Topology added in v0.8.5

func (n *NodeService) Topology(ctx context.Context) (resp Topology, err error)

Topology returns Kademlia topology

type Peer

type Peer struct {
	Address swarm.Address `json:"address"`
}

Peer represents node's peer

type Peers

type Peers struct {
	Peers []Peer `json:"peers"`
}

Peers represents node's peers

type PingPongService added in v0.8.5

type PingPongService service

PingPongService represents Bee's PingPong service

func (*PingPongService) Ping added in v0.8.5

func (p *PingPongService) Ping(ctx context.Context, a swarm.Address) (resp Pong, err error)

Ping pings given node

type Pong added in v0.8.5

type Pong struct {
	RTT string `json:"rtt"`
}

Pong represents Ping's response

type PostageService added in v0.8.5

type PostageService service

PostageService represents Bee's Postage service

func (*PostageService) CreatePostageBatch added in v0.8.5

func (p *PostageService) CreatePostageBatch(ctx context.Context, amount int64, depth uint64, gasPrice, label string) (batchID string, err error)

Sends a create postage request to a node that returns the batchID

func (*PostageService) DilutePostageBatch added in v0.8.5

func (p *PostageService) DilutePostageBatch(ctx context.Context, batchID string, newDepth uint64, gasPrice string) (err error)

Sends a dilute batch request to a node that returns the batchID

func (*PostageService) PostageBatch added in v0.8.5

func (p *PostageService) PostageBatch(ctx context.Context, batchID string) (PostageStampResponse, error)

func (*PostageService) PostageBatches added in v0.8.5

func (p *PostageService) PostageBatches(ctx context.Context) ([]PostageStampResponse, error)

Fetches the list postage stamp batches

func (*PostageService) ReserveState added in v0.8.5

func (p *PostageService) ReserveState(ctx context.Context) (ReserveState, error)

Returns the batchstore reservestate of the node

func (*PostageService) TopUpPostageBatch added in v0.8.5

func (p *PostageService) TopUpPostageBatch(ctx context.Context, batchID string, amount int64, gasPrice string) (err error)

Sends a topup batch request to a node that returns the batchID

type PostageStampResponse added in v0.8.5

type PostageStampResponse struct {
	BatchID       string         `json:"batchID"`
	Utilization   uint32         `json:"utilization"`
	Usable        bool           `json:"usable"`
	Label         string         `json:"label"`
	Depth         uint8          `json:"depth"`
	Amount        *bigint.BigInt `json:"amount"`
	BucketDepth   uint8          `json:"bucketDepth"`
	BlockNumber   uint64         `json:"blockNumber"`
	ImmutableFlag bool           `json:"immutableFlag"`
	Exists        bool           `json:"exists"`
	BatchTTL      int64          `json:"batchTTL"`
}

type Readiness added in v0.8.5

type Readiness struct {
	Status string `json:"status"`
}

Readiness represents node's readiness

type ReserveState added in v0.8.5

type ReserveState struct {
	Radius        uint8 `json:"radius"`
	StorageRadius uint8 `json:"storageRadius"`
}

func (ReserveState) String added in v0.8.5

func (rs ReserveState) String() string

type Settlement added in v0.8.5

type Settlement struct {
	Peer     string         `json:"peer"`
	Received *bigint.BigInt `json:"received"`
	Sent     *bigint.BigInt `json:"sent"`
}

Settlement represents node's settlement with a peer

type Settlements added in v0.8.5

type Settlements struct {
	Settlements   []Settlement   `json:"settlements"`
	TotalReceived *bigint.BigInt `json:"totalReceived"`
	TotalSent     *bigint.BigInt `json:"totalSent"`
}

Settlements represents node's settlements with all peers

type Topology added in v0.8.5

type Topology struct {
	BaseAddr       swarm.Address  `json:"baseAddr"`
	Population     int            `json:"population"`
	Connected      int            `json:"connected"`
	Timestamp      time.Time      `json:"timestamp"`
	NnLowWatermark int            `json:"nnLowWatermark"`
	Depth          int            `json:"depth"`
	Bins           map[string]Bin `json:"bins"`
	LightNodes     Bin            `json:"lightNodes"`
}

Topology represents Kademlia topology

type TransactionHashResponse added in v0.8.5

type TransactionHashResponse struct {
	TransactionHash string `json:"transactionHash"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL