stacks

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StacksDir = path.Join(homeDir, ".firefly", "stacks")

Functions

func CheckExists

func CheckExists(stackName string) (bool, error)

func GenerateKeyAndPeerId

func GenerateKeyAndPeerId() (privateKey string, peerId string)

func GenerateSwarmKey

func GenerateSwarmKey() string

func InitStack

func InitStack(stackName string, memberCount int) error

func ListStacks added in v0.0.13

func ListStacks() ([]string, error)

func NewFireflyConfigs

func NewFireflyConfigs(stack *Stack) map[string]*FireflyConfig

func WriteFireflyConfig

func WriteFireflyConfig(config *FireflyConfig, filePath string) error

Types

type BasicAuth

type BasicAuth struct {
	Username string `yaml:"username,omitempty"`
	Password string `yaml:"password,omitempty"`
}

type BlockchainConfig

type BlockchainConfig struct {
	Type     string          `yaml:"type,omitempty"`
	Ethereum *EthereumConfig `yaml:"ethereum,omitempty"`
}

type DataExchangeConfig

type DataExchangeConfig struct {
	Type  string              `yaml:"type,omitempty"`
	HTTPS *HttpEndpointConfig `yaml:"https,omitempty"`
}

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 DatabaseConfig

type DatabaseConfig struct {
	Type     string          `yaml:"type,omitempty"`
	Postgres *PostgresConfig `yaml:"postgres,omitempty"`
}

type DependsOn

type DependsOn map[string]map[string]string

type DockerComposeConfig

type DockerComposeConfig struct {
	Version  string              `yaml:"version,omitempty"`
	Services map[string]*Service `yaml:"services,omitempty"`
}

func CreateDockerCompose

func CreateDockerCompose(stack *Stack) *DockerComposeConfig

type EthconnectConfig

type EthconnectConfig struct {
	URL                 string     `yaml:"url,omitempty"`
	Instance            string     `yaml:"instance,omitempty"`
	Topic               string     `yaml:"topic,omitempty"`
	SkipEventStreamInit bool       `yaml:"skipEventstreamInit,omitempty"`
	Auth                *BasicAuth `yaml:"auth,omitempty"`
}

type EthereumConfig

type EthereumConfig struct {
	Ethconnect *EthconnectConfig `yaml:"ethconnect,omitempty"`
}

type FireflyConfig

type FireflyConfig struct {
	Log          *LogConfig           `yaml:"log,omitempty"`
	Debug        *HttpServerConfig    `yaml:"debug,omitempty"`
	HTTP         *HttpServerConfig    `yaml:"http,omitempty"`
	UI           *UIConfig            `yaml:"ui,omitempty"`
	Node         *NodeConfig          `yaml:"node,omitempty"`
	Org          *OrgConfig           `yaml:"org,omitempty"`
	Blockchain   *BlockchainConfig    `yaml:"blockchain,omitempty"`
	Database     *DatabaseConfig      `yaml:"database,omitempty"`
	P2PFS        *PublicStorageConfig `yaml:"publicstorage,omitempty"`
	DataExchange *DataExchangeConfig  `yaml:"dataexchange,omitempty"`
}

func ReadFireflyConfig

func ReadFireflyConfig(filePath string) (*FireflyConfig, error)

type FireflyIPFSConfig

type FireflyIPFSConfig struct {
	API     *HttpEndpointConfig `yaml:"api,omitempty"`
	Gateway *HttpEndpointConfig `yaml:"gateway,omitempty"`
}

type HealthCheck

type HealthCheck struct {
	Test     []string `yaml:"test,omitempty"`
	Interval string   `yaml:"interval,omitempty"`
	Timeout  string   `yaml:"timeout,omitempty"`
	Retries  int      `yaml:"retries,omitempty"`
}

type HttpEndpointConfig

type HttpEndpointConfig struct {
	URL  string    `yaml:"url,omitempty"`
	Auth BasicAuth `yaml:"auth,omitempty"`
}

type HttpServerConfig

type HttpServerConfig struct {
	Port    int    `yaml:"port,omitempty"`
	Address string `yaml:"address,omitempty"`
}

type LogConfig

type LogConfig struct {
	Level string `yaml:"level,omitempty"`
}

type LoggingConfig

type LoggingConfig struct {
	Driver  string            `yaml:"driver,omitempty"`
	Options map[string]string `yaml:"options,omitempty"`
}

type Member

type Member struct {
	ID                      string `json:"id,omitempty"`
	Index                   *int   `json:"index,omitempty"`
	Address                 string `json:"address,omitempty"`
	PrivateKey              string `json:"privateKey,omitempty"`
	ExposedFireflyPort      int    `json:"exposedFireflyPort,omitempty"`
	ExposedEthconnectPort   int    `json:"exposedEthconnectPort,omitempty"`
	ExposedPostgresPort     int    `json:"exposedPostgresPort,omitempty"`
	ExposedDataexchangePort int    `json:"exposedDataexchangePort,omitempty"`
	ExposedIPFSApiPort      int    `json:"exposedIPFSApiPort,omitempty`
	ExposedIPFSGWPort       int    `json:"exposedIPFSGWPort,omitempty`
	ExposedUIPort           int    `json:"exposedUiPort ,omitempty"`
}

type MigrationsConfig

type MigrationsConfig struct {
	Auto      bool   `yaml:"auto,omitempty"`
	Directory string `yaml:"directory,omitempty"`
}

type NodeConfig

type NodeConfig struct {
	Name string `yaml:"name,omitempty"`
}

type OrgConfig

type OrgConfig struct {
	Name     string `yaml:"name,omitempty"`
	Identity string `yaml:"identity,omitempty"`
}

type PeerConfig

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

type PostgresConfig

type PostgresConfig struct {
	URL        string            `yaml:"url,omitempty"`
	Migrations *MigrationsConfig `yaml:"migrations,omitempty"`
}

type PublicStorageConfig

type PublicStorageConfig struct {
	Type string             `yaml:"type,omitempty"`
	IPFS *FireflyIPFSConfig `yaml:"ipfs,omitempty"`
}

type Service

type Service struct {
	Image       string                       `yaml:"image,omitempty"`
	Command     string                       `yaml:"command,omitempty"`
	Environment map[string]string            `yaml:"environment,omitempty"`
	Volumes     []string                     `yaml:"volumes,omitempty"`
	Ports       []string                     `yaml:"ports,omitempty"`
	DependsOn   map[string]map[string]string `yaml:"depends_on,omitempty"`
	HealthCheck *HealthCheck                 `yaml:"healthcheck,omitempty"`
	Logging     *LoggingConfig               `yaml:"logging,omitempty"`
}

type Stack

type Stack struct {
	Name     string    `json:"name,omitempty"`
	Members  []*Member `json:"members,omitempty"`
	SwarmKey string    `json:"swarmKey,omitempty"`
}

func LoadStack

func LoadStack(stackName string) (*Stack, error)

func (*Stack) GenerateDataExchangeHTTPSConfig

func (s *Stack) GenerateDataExchangeHTTPSConfig(memberId string) *DataExchangePeerConfig

func (*Stack) PrintStackInfo added in v0.0.13

func (s *Stack) PrintStackInfo(verbose bool) error

func (*Stack) RemoveStack

func (s *Stack) RemoveStack(verbose bool) error

func (*Stack) ResetStack

func (s *Stack) ResetStack(verbose bool) error

func (*Stack) StartStack

func (s *Stack) StartStack(fancyFeatures bool, verbose bool) error

func (*Stack) StopStack

func (s *Stack) StopStack(verbose bool) error

func (*Stack) UpgradeStack added in v0.0.13

func (s *Stack) UpgradeStack(verbose bool) error

type UIConfig

type UIConfig struct {
	Path string `yaml:"path,omitempty"`
}

Jump to

Keyboard shortcuts

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