stacks

package
v0.0.27-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2021 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DBSelectionStrings = []string{"postgres", "sqlite3"}
View Source
var StacksDir = filepath.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, options *InitOptions) 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 AdminServerConfig added in v0.0.17

type AdminServerConfig struct {
	Port      int    `yaml:"port,omitempty"`
	Address   string `yaml:"address,omitempty"`
	Enabled   bool   `yaml:"enabled,omitempty"`
	PreInit   bool   `yaml:"preinit,omitempty"`
	PublicURL string `yaml:"publicURL,omitempty"`
}

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 CommonDBConfig added in v0.0.21

type CommonDBConfig struct {
	URL        string            `yaml:"url,omitempty"`
	Migrations *MigrationsConfig `yaml:"migrations,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"`
	PostgreSQL *CommonDBConfig `yaml:"postgres,omitempty"`
	SQLite3    *CommonDBConfig `yaml:"sqlite3,omitempty"`
}

type DatabaseSelection added in v0.0.21

type DatabaseSelection int
const (
	PostgreSQL DatabaseSelection = iota
	SQLite3
)

func DatabaseSelectionFromString added in v0.0.21

func DatabaseSelectionFromString(s string) (DatabaseSelection, error)

func (DatabaseSelection) String added in v0.0.21

func (db DatabaseSelection) String() string

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"`
	Volumes  map[string]struct{} `yaml:"volumes,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"`
	Admin        *AdminServerConfig   `yaml:"admin,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"`
	PublicURL string `yaml:"publicURL,omitempty"`
}

type InitOptions added in v0.0.16

type InitOptions struct {
	FireFlyBasePort   int
	ServicesBasePort  int
	DatabaseSelection string
	Verbose           bool
	ExternalProcesses int
}

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"`
	ExposedFireflyAdminPort int    `json:"exposedFireflyAdminPort,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"`
	External                bool   `json:"external,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 PublicStorageConfig

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

type Service

type Service struct {
	Image       string                       `yaml:"image,omitempty"`
	Build       string                       `yaml:"build,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"`
	ExposedGethPort int       `json:"exposedGethPort,omitempty"`
	Database        string    `json:"database"`
}

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) StackHasRunBefore added in v0.0.17

func (s *Stack) StackHasRunBefore() (bool, error)

func (*Stack) StartStack

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

func (*Stack) StopStack

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

func (*Stack) UnlockAccounts added in v0.0.28

func (s *Stack) UnlockAccounts(spin *spinner.Spinner) error

func (*Stack) UpgradeStack added in v0.0.13

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

type StartOptions added in v0.0.16

type StartOptions struct {
	NoPull     bool
	NoRollback bool
}

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