launchnet

package
v0.0.0-...-05bc493 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: MIT, Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HOST            = "http://localhost:"
	AdminPort       = "19002"
	PublicPort      = "19102"
	HostDebug       = "http://localhost:8001"
	TestAdminRPCUrl = "/admin-api/rpc"
)

Variables

View Source
var (
	AdminHostPort    = HOST + AdminPort
	TestRPCUrl       = HOST + AdminPort + TestAdminRPCUrl
	TestRPCUrlPublic = HOST + PublicPort + "/api/rpc"

	TestWalletHost = "INSOLAR_FUNC_TESTWALLET_HOST"
)

Functions

func CustomRunWithPulsar

func CustomRunWithPulsar(numVirtual, numLight, numHeavy int, cb func([]string) int) int

func CustomRunWithoutPulsar

func CustomRunWithoutPulsar(numVirtual, numLight, numHeavy int, cb func([]string) int) int

func DumpMetricsEnabled

func DumpMetricsEnabled() bool

LogRotateEnabled checks is log rotation enabled by environment variable.

func FetchAndSaveMetrics

func FetchAndSaveMetrics(iteration int) ([][]byte, error)

FetchAndSaveMetrics fetches all nodes metric endpoints and saves result to files in logs/metrics/$iteration/<node-addr>.txt files.

func GetDiscoveryNodesCount

func GetDiscoveryNodesCount() (int, error)

func GetNodesCount

func GetNodesCount() (int, error)

func GetPulseTime

func GetPulseTime() int

func GetPulseTimeEnv

func GetPulseTimeEnv() string

func LogRotateEnabled

func LogRotateEnabled() bool

LogRotateEnabled checks is log rotation enabled by environment variable.

func Path

func Path(a ...string) string

Path builds a path from either INSOLAR_FUNC_KEYS_PATH or LAUNCHNET_BASE_DIR

func RotateLogs

func RotateLogs(verbose bool)

RotateLogs rotates launchnet logs, verbose flag enables printing what happens.

func Run

func Run(cb func() int) int

Run starts launchnet before execution of callback function (cb) and stops launchnet after. Returns exit code as a result from calling callback function.

func RunCloudWithConsensus

func RunCloudWithConsensus(numVirtual, numLight, numHeavy uint, cb func() int) int

func RunOnlyWithLaunchnet

func RunOnlyWithLaunchnet(t *testing.T)

func SetVerbose

func SetVerbose(v bool)

func WithCloudFileLogging

func WithCloudFileLogging() func(runner *CloudRunner)

func WithDefaultLogLevel

func WithDefaultLogLevel(level log.Level) func(runner *CloudRunner)

func WithMajorityRule

func WithMajorityRule(num int) func(runner *CloudRunner)

func WithMinRoles

func WithMinRoles(virtual, light, heavy uint) func(runner *CloudRunner)

func WithPrepared

func WithPrepared(virtual, light, heavy uint) func(runner *CloudRunner)

func WithPulsarMode

func WithPulsarMode(mode PulsarMode) func(runner *CloudRunner)

func WithRunning

func WithRunning(virtual, light, heavy uint) func(runner *CloudRunner)

Types

type CloudRunner

type CloudRunner struct {
	MinRoles cloud.NodeConfiguration
	Prepared cloud.NodeConfiguration
	Running  cloud.NodeConfiguration

	ConfProvider *cloud.ConfigurationProvider
	// contains filtered or unexported fields
}

func PrepareCloudRunner

func PrepareCloudRunner(options ...cloudOption) *CloudRunner

func (*CloudRunner) ControlledRun

func (cr *CloudRunner) ControlledRun(cb func(helper *Helper) error) error

func (*CloudRunner) PrepareConfig

func (cr *CloudRunner) PrepareConfig()

func (*CloudRunner) Run

func (cr *CloudRunner) Run(cb func([]string) int) int

func (CloudRunner) SetupCloud

func (cr CloudRunner) SetupCloud() (func(), error)

func (CloudRunner) SetupCloudCustom

func (cr CloudRunner) SetupCloudCustom(pulsarMode PulsarMode) (func(), error)

func (CloudRunner) SetupControlledRun

func (cr CloudRunner) SetupControlledRun() (*Helper, func(), error)

type Helper

type Helper struct {
	NodeController    insapp.MultiController
	NetworkController *cloud.NetworkController

	ConfigurationProvider *cloud.ConfigurationProvider
	// contains filtered or unexported fields
}

func (*Helper) AddNode

func (h *Helper) AddNode(role member.PrimaryRole) reference.Global

func (*Helper) GetAPIAddresses

func (h *Helper) GetAPIAddresses() []string

func (*Helper) GetAdminAddresses

func (h *Helper) GetAdminAddresses() []string

func (*Helper) IncrementPulse

func (h *Helper) IncrementPulse(ctx context.Context)

func (*Helper) PartialPulse

func (h *Helper) PartialPulse(ctx context.Context, packet pulsar.PulsePacket, whiteList map[reference.Global]struct{})

func (*Helper) StopNode

func (h *Helper) StopNode(role member.PrimaryRole, nodeRef reference.Global)

func (*Helper) SyncPulse

func (h *Helper) SyncPulse(ctx context.Context)

type OneShotMode

type OneShotMode int
const (
	OneShotUndefined OneShotMode = iota
	OneShotTrue
	OneShotFalse
)

func (OneShotMode) ToValue

func (o OneShotMode) ToValue() string

type PulsarMode

type PulsarMode uint8
const (
	RegularPulsar PulsarMode = iota
	ManualPulsar
)

type User

type User struct {
	Ref              string
	PrivKey          string
	PubKey           string
	MigrationAddress string
}

Jump to

Keyboard shortcuts

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