stacks

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckExists

func CheckExists(stackName string) (bool, error)

func GenerateIPFSPrivateNetInitScript

func GenerateIPFSPrivateNetInitScript() string

GenerateIPFSPrivateNetInitScript returns a container-init.d script that disables Kubo's AutoConf/public-network defaults, which are incompatible with a private swarm (swarm.key / LIBP2P_FORCE_PNET) and otherwise prevent the daemon from starting or from ever peering with other members.

Routing.Type is set to "none" rather than "dht": a small private swarm hits a long-standing upstream bug (https://github.com/ipfs/kubo/issues/8346) where bitswap finds a provider via the DHT but never sends it a WANT message if the swarm connection to that peer already existed, so content fetches hang even though the peers are connected. With routing disabled, bitswap has no choice but to broadcast wants directly to its connected peers, which is all a 2+ node private swarm actually needs.

func GenerateSwarmKey

func GenerateSwarmKey() (string, error)

func ListStacks

func ListStacks() ([]string, error)

Types

type DataExchangeListenerConfig

type DataExchangeListenerConfig struct {
	Hostname string `json:"hostname,omitempty"`
	Endpoint string `json:"endpoint,omitempty"`
	Port     int    `json:"port,omitempty"`
}

type DataExchangePeerConfig

type DataExchangePeerConfig struct {
	API   *DataExchangeListenerConfig `json:"api,omitempty"`
	P2P   *DataExchangeListenerConfig `json:"p2p,omitempty"`
	Peers []*PeerConfig               `json:"peers"`
}

type GlobalConfig

type GlobalConfig struct {
	ScrapeInterval string `yaml:"scrape_interval,omitempty"`
	ScrapeTimeout  string `yaml:"scrape_timeout,omitempty"`
}

type PeerConfig

type PeerConfig struct {
	ID       string `json:"id,omitempty"`
	Endpoint string `json:"endpoint,omitempty"`
}

type PrometheusConfig

type PrometheusConfig struct {
	Global        *GlobalConfig   `yaml:"global,omitempty"`
	ScrapeConfigs []*ScrapeConfig `yaml:"scrape_configs,omitempty"`
}

type ScrapeConfig

type ScrapeConfig struct {
	JobName       string          `yaml:"job_name,omitempty"`
	MetricsPath   string          `yaml:"metrics_path,omitempty"`
	StaticConfigs []*StaticConfig `yaml:"static_configs,omitempty"`
}

type StackManager

type StackManager struct {
	Log   log.Logger
	Stack *types.Stack

	IsOldFileStructure bool
	// contains filtered or unexported fields
}

func NewStackManager

func NewStackManager(ctx context.Context) *StackManager

func (*StackManager) CreateAccount

func (s *StackManager) CreateAccount(args []string) (string, error)

func (*StackManager) DeployContract

func (s *StackManager) DeployContract(filename, contractName string, memberIndex int, extraArgs []string) (string, error)

func (*StackManager) GenerateDataExchangeHTTPSConfig

func (s *StackManager) GenerateDataExchangeHTTPSConfig(memberID string) *DataExchangePeerConfig

func (*StackManager) GeneratePrometheusConfig

func (s *StackManager) GeneratePrometheusConfig() *PrometheusConfig

func (*StackManager) GetContracts

func (s *StackManager) GetContracts(filename string, extraArgs []string) ([]string, error)

func (*StackManager) InitStack

func (s *StackManager) InitStack(options *types.InitOptions) (err error)

func (*StackManager) IsRunning

func (s *StackManager) IsRunning() error

IsRunning prints to the stdout, the stack name and it status as "running" or "not_running".

func (*StackManager) LoadStack

func (s *StackManager) LoadStack(stackName string) error

func (*StackManager) PrintStackInfo

func (s *StackManager) PrintStackInfo() error

func (*StackManager) PullStack

func (s *StackManager) PullStack(options *types.PullOptions) error

func (*StackManager) RemoveStack

func (s *StackManager) RemoveStack() error

func (*StackManager) ResetStack

func (s *StackManager) ResetStack() error

func (*StackManager) StartStack

func (s *StackManager) StartStack(options *types.StartOptions) (messages []string, err error)

func (*StackManager) StopStack

func (s *StackManager) StopStack() error

func (*StackManager) UpgradeStack

func (s *StackManager) UpgradeStack(version string, forceUpgrade bool) error

type StaticConfig

type StaticConfig struct {
	Targets []string `yaml:"targets,omitempty"`
}

Jump to

Keyboard shortcuts

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