debugapi

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Copyright 2021 Ethersphere. Copyright 2022 Beezim Authors. All rights reserved. Use of this source code is originally governed by BSD 3-Clause and our modifications by GPLv3 license that can be found in the LICENSE file.

This code is based on the beekeeper beeclient api. The http client was split to its own package. The bee api and debug api were modified and simplified to fit the purposes of Beezim.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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"`
}

type DebugAPI

type DebugAPI struct {
	C       *httpclient.Client
	Node    *NodeService
	Postage *PostageService
}

func NewDebugAPI

func NewDebugAPI(beeURL *url.URL, o *httpclient.ClientOptions) (*DebugAPI, error)

type NodeService

type NodeService struct {
	// contains filtered or unexported fields
}

func (*NodeService) Addresses

func (ns *NodeService) Addresses(ctx context.Context) (Addresses, error)

func (*NodeService) Peers

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

type Peer

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

type Peers

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

type PostageOptions

type PostageOptions struct {
	GasPrice string
}

type PostageService

type PostageService struct {
	// contains filtered or unexported fields
}

func (*PostageService) CreatePostageBatch

func (ps *PostageService) CreatePostageBatch(ctx context.Context, amount int64, depth uint64, label string, o PostageOptions) (string, error)

CreatePostageBatch sends a create postage request to a node that returns the bactchID

func (*PostageService) PostageBatches

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

Fetches the list postage stamp batches

type PostageStampResponse

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"`
}

Jump to

Keyboard shortcuts

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