orchestration

package
v0.11.6 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotSet = errors.New("orchestration client not set")

ErrNotSet represents error when orchestration client is not set

Functions

This section is empty.

Types

type Cluster

type Cluster interface {
	AddNodeGroup(name string, o NodeGroupOptions)
	Addresses(ctx context.Context) (addrs map[string]NodeGroupAddresses, err error)
	Accounting(ctx context.Context) (accounting ClusterAccounting, err error)
	Balances(ctx context.Context) (balances ClusterBalances, err error)
	FlattenBalances(ctx context.Context) (balances NodeGroupBalances, err error)
	FlattenAccounting(ctx context.Context) (accounting NodeGroupAccounting, err error)
	GlobalReplicationFactor(ctx context.Context, a swarm.Address) (grf int, err error)
	Name() string
	NodeGroups() (l map[string]NodeGroup)
	NodeGroupsSorted() (l []string)
	NodeGroup(name string) (ng NodeGroup, err error)
	Nodes() map[string]Node
	NodeNames() (names []string)
	LightNodeNames() (names []string)
	FullNodeNames() (names []string)
	NodesClients(ctx context.Context) (map[string]*bee.Client, error)
	NodesClientsAll(ctx context.Context) (map[string]*bee.Client, error)
	Overlays(ctx context.Context, exclude ...string) (overlays ClusterOverlays, err error)
	FlattenOverlays(ctx context.Context, exclude ...string) (map[string]swarm.Address, error)
	Peers(ctx context.Context, exclude ...string) (peers ClusterPeers, err error)
	RandomNode(ctx context.Context, r *rand.Rand) (node Node, err error)
	Settlements(ctx context.Context) (settlements ClusterSettlements, err error)
	FlattenSettlements(ctx context.Context) (settlements NodeGroupSettlements, err error)
	Size() (size int)
	Topologies(ctx context.Context) (topologies ClusterTopologies, err error)
	FlattenTopologies(ctx context.Context) (topologies map[string]bee.Topology, err error)
}

type ClusterAccounting added in v0.11.4

type ClusterAccounting map[string]NodeGroupAccounting

ClusterAccounting represents accounting of all nodes in the cluster

type ClusterAddresses

type ClusterAddresses map[string]NodeGroupAddresses

ClusterAddresses represents addresses of all nodes in the cluster

type ClusterBalances

type ClusterBalances map[string]NodeGroupBalances

ClusterBalances represents balances of all nodes in the cluster

type ClusterOptions

type ClusterOptions struct {
	Annotations         map[string]string
	APIDomain           string
	APIInsecureTLS      bool
	APIScheme           string
	DebugAPIDomain      string
	DebugAPIInsecureTLS bool
	DebugAPIScheme      string
	K8SClient           *k8s.Client
	SwapClient          swap.Client
	Labels              map[string]string
	Namespace           string
	DisableNamespace    bool
	AdminPassword       string
}

ClusterOptions represents Bee cluster options

type ClusterOverlays

type ClusterOverlays map[string]NodeGroupOverlays

ClusterOverlays represents overlay addresses of all nodes in the cluster

func (ClusterOverlays) Random

func (c ClusterOverlays) Random(r *rand.Rand) (nodeGroup string, nodeName string, overlay swarm.Address)

RandomOverlay returns a random overlay from a random NodeGroup

type ClusterPeers

type ClusterPeers map[string]NodeGroupPeers

ClusterPeers represents peers of all nodes in the cluster

type ClusterSettlements

type ClusterSettlements map[string]NodeGroupSettlements

ClusterSettlements represents settlements of all nodes in the cluster

type ClusterTopologies

type ClusterTopologies map[string]NodeGroupTopologies

ClusterTopologies represents Kademlia topology of all nodes in the cluster

type Config

type Config struct {
	AllowPrivateCIDRs          bool          // allow to advertise private CIDRs to the public network
	APIAddr                    string        // HTTP API listen address
	BlockTime                  uint64        // chain block time
	Bootnodes                  string        // initial nodes to connect to
	BootnodeMode               bool          // cause the node to always accept incoming connections
	CacheCapacity              uint64        // cache capacity in chunks, multiply by 4096 (MaxChunkSize) to get approximate capacity in bytes
	ClefSignerEnable           bool          // enable clef signer
	ClefSignerEndpoint         string        // clef signer endpoint
	CORSAllowedOrigins         string        // origins with CORS headers enabled
	DataDir                    string        // data directory
	DbOpenFilesLimit           int           // number of open files allowed by database
	DbBlockCacheCapacity       int           // size of block cache of the database in bytes
	DbWriteBufferSize          int           // size of the database write buffer in bytes
	DbDisableSeeksCompaction   bool          // disables DB compactions triggered by seeks
	DebugAPIAddr               string        // debug HTTP API listen address
	DebugAPIEnable             bool          // enable debug HTTP API
	FullNode                   bool          // cause the node to start in full mode
	GatewayMode                bool          // disable a set of sensitive features in the api
	Mainnet                    bool          // enable mainnet
	NATAddr                    string        // NAT exposed address
	NetworkID                  uint64        // ID of the Swarm network
	P2PAddr                    string        // P2P listen address
	P2PQUICEnable              bool          // enable P2P QUIC transport
	P2PWSEnable                bool          // enable P2P WebSocket transport
	Password                   string        // password for decrypting keys
	PaymentEarly               uint64        // amount in BZZ below the peers payment threshold when we initiate settlement
	PaymentThreshold           uint64        // threshold in BZZ where you expect to get paid from your peers
	PaymentTolerance           uint64        // excess debt above payment threshold in BZZ where you disconnect from your peer
	PostageStampAddress        string        // postage stamp address
	PriceOracleAddress         string        // price Oracle address
	ResolverOptions            string        // ENS compatible API endpoint for a TLD and with contract address, can be repeated, format [tld:][contract-addr@]url
	Restricted                 bool          // start node in restricted mode
	TokenEncryptionKey         string        // username for API authentication
	AdminPassword              string        // password hash for API authentication
	Standalone                 bool          // whether we want the node to start with no listen addresses for p2p
	ChequebookEnable           bool          // enable chequebook
	SwapEnable                 bool          // enable swap
	SwapEndpoint               string        // swap ethereum blockchain endpoint
	SwapDeploymentGasPrice     string        // gas price in wei to use for deployment and funding
	SwapFactoryAddress         string        // swap factory address
	SwapLegacyFactoryAddresses string        // swap legacy factory addresses
	SwapInitialDeposit         uint64        // initial deposit if deploying a new chequebook
	TracingEnabled             bool          // enable tracing
	TracingEndpoint            string        // endpoint to send tracing data
	TracingServiceName         string        // service name identifier for tracing
	Transaction                string        // proof-of-identity transaction hash
	Verbosity                  uint64        // log verbosity level 0=silent, 1=error, 2=warn, 3=info, 4=debug, 5=trace
	WelcomeMessage             string        // send a welcome message string during handshakes
	WarmupTime                 time.Duration // warmup time pull/pushsync protocols
}

Config represents Bee configuration

type CreateOptions

type CreateOptions struct {
	// Bee configuration
	Config Config
	// Kubernetes configuration
	Name                      string
	Namespace                 string
	Annotations               map[string]string
	ClefImage                 string
	ClefImagePullPolicy       string
	ClefKey                   string
	ClefPassword              string
	Labels                    map[string]string
	Image                     string
	ImagePullPolicy           string
	ImagePullSecrets          []string
	IngressAnnotations        map[string]string
	IngressClass              string
	IngressHost               string
	IngressDebugAnnotations   map[string]string
	IngressDebugClass         string
	IngressDebugHost          string
	LibP2PKey                 string
	NodeSelector              map[string]string
	PersistenceEnabled        bool
	PersistenceStorageClass   string
	PersistenceStorageRequest string
	PodManagementPolicy       string
	RestartPolicy             string
	ResourcesLimitCPU         string
	ResourcesLimitMemory      string
	ResourcesRequestCPU       string
	ResourcesRequestMemory    string
	Selector                  map[string]string
	SwarmKey                  string
	UpdateStrategy            string
}

CreateOptions represents available options for creating node

type FundingOptions

type FundingOptions struct {
	Eth  float64
	Bzz  float64
	GBzz float64
}

type Node

type Node interface {
	Name() string
	Client() *bee.Client
	ClefKey() string
	ClefPassword() string
	Config() *Config
	Create(ctx context.Context, o CreateOptions) (err error)
	Delete(ctx context.Context, namespace string) (err error)
	LibP2PKey() string
	Ready(ctx context.Context, namespace string) (ready bool, err error)
	Start(ctx context.Context, namespace string) (err error)
	Stop(ctx context.Context, namespace string) (err error)
	SwarmKey() string
	SetSwarmKey(key string) Node
	SetClefKey(key string) Node
	SetClefPassword(key string) Node
}

type NodeGroup

type NodeGroup interface {
	AddNode(ctx context.Context, name string, o NodeOptions) (err error)
	Addresses(ctx context.Context) (addrs NodeGroupAddresses, err error)
	Accounting(ctx context.Context) (infos NodeGroupAccounting, err error)
	Balances(ctx context.Context) (balances NodeGroupBalances, err error)
	CreateNode(ctx context.Context, name string) (err error)
	DeleteNode(ctx context.Context, name string) (err error)
	Fund(ctx context.Context, name string, o FundingOptions) (err error)
	GroupReplicationFactor(ctx context.Context, a swarm.Address) (grf int, err error)
	Name() string
	Nodes() map[string]Node
	NodesClients(ctx context.Context) (map[string]*bee.Client, error)
	NodesClientsAll(ctx context.Context) map[string]*bee.Client
	NodesSorted() (l []string)
	Node(name string) (Node, error)
	NodeClient(name string) (*bee.Client, error)
	Overlays(ctx context.Context) (overlays NodeGroupOverlays, err error)
	Peers(ctx context.Context) (peers NodeGroupPeers, err error)
	NodeReady(ctx context.Context, name string) (ok bool, err error)
	RunningNodes(ctx context.Context) (running []string, err error)
	SetupNode(ctx context.Context, name string, o NodeOptions, f FundingOptions) (err error)
	Settlements(ctx context.Context) (settlements NodeGroupSettlements, err error)
	Size() int
	StartNode(ctx context.Context, name string) (err error)
	StopNode(ctx context.Context, name string) (err error)
	StoppedNodes(ctx context.Context) (stopped []string, err error)
	Topologies(ctx context.Context) (topologies NodeGroupTopologies, err error)
}

type NodeGroupAccounting added in v0.11.4

type NodeGroupAccounting map[string]map[string]bee.Account

NodeGroupAccounting represents accounting of all nodes in the node group

type NodeGroupAddresses

type NodeGroupAddresses map[string]bee.Addresses

NodeGroupAddresses represents addresses of all nodes in the node group

type NodeGroupBalances

type NodeGroupBalances map[string]map[string]int64

NodeGroupBalances represents balances of all nodes in the node group

type NodeGroupOptions

type NodeGroupOptions struct {
	Annotations               map[string]string
	ClefImage                 string
	ClefImagePullPolicy       string
	BeeConfig                 *Config
	Image                     string
	ImagePullPolicy           string
	ImagePullSecrets          []string
	IngressAnnotations        map[string]string
	IngressClass              string
	IngressDebugAnnotations   map[string]string
	IngressDebugClass         string
	Labels                    map[string]string
	NodeSelector              map[string]string
	PersistenceEnabled        bool
	PersistenceStorageClass   string
	PersistenceStorageRequest string
	PodManagementPolicy       string
	RestartPolicy             string
	ResourcesLimitCPU         string
	ResourcesLimitMemory      string
	ResourcesRequestCPU       string
	ResourcesRequestMemory    string
	UpdateStrategy            string
}

NodeGroupOptions represents node group options

type NodeGroupOverlays

type NodeGroupOverlays map[string]swarm.Address

NodeGroupOverlays represents overlay addresses of all nodes in the node group

type NodeGroupPeers

type NodeGroupPeers map[string][]swarm.Address

NodeGroupPeers represents peers of all nodes in the node group

type NodeGroupSettlements

type NodeGroupSettlements map[string]map[string]SentReceived

NodeGroupSettlements represents settlements of all nodes in the node group

type NodeGroupTopologies

type NodeGroupTopologies map[string]bee.Topology

NodeGroupTopologies represents Kademlia topology of all nodes in the node group

type NodeOptions

type NodeOptions struct {
	ClefKey      string
	ClefPassword string
	Client       *bee.Client
	Config       *Config
	K8S          *k8s.Client
	LibP2PKey    string
	SwarmKey     string
}

NodeOptions holds optional parameters for the Node.

type SentReceived

type SentReceived struct {
	Received int64
	Sent     int64
}

SentReceived object

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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