genesis

package
v0.7.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2019 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenFile added in v0.7.5

func OpenFile(dir string, name string) (*os.File, error)

func PrependGoPath added in v0.7.5

func PrependGoPath(path string) string

PrependGoPath prepends `path` to GOPATH environment variable accounting for possibly for default value. Returns new value. NOTE: that environment is not changed

func WriteFile added in v0.7.5

func WriteFile(dir string, name string, text string) error

WriteFile dumps `text` into file named `name` into directory `dir`. Creates directory if needed as well as file

Types

type Config added in v0.7.5

type Config struct {
	RootKeysFile string `mapstructure:"root_keys_file"`
	RootBalance  uint   `mapstructure:"root_balance"`
	MajorityRule int    `mapstructure:"majority_rule"`
	MinRoles     struct {
		Virtual       uint `mapstructure:"virtual"`
		HeavyMaterial uint `mapstructure:"heavy_material"`
		LightMaterial uint `mapstructure:"light_material"`
	} `mapstructure:"min_roles"`
	PulsarPublicKeys []string    `mapstructure:"pulsar_public_keys"`
	DiscoveryNodes   []Discovery `mapstructure:"discovery_nodes"`
}

Config contains all genesis config

func ParseGenesisConfig added in v0.7.5

func ParseGenesisConfig(path string) (*Config, error)

ParseGenesisConfig parse genesis config

type ContractsBuilder added in v0.7.5

type ContractsBuilder struct {
	ArtifactManager core.ArtifactManager
	Prototypes      map[string]*core.RecordRef
	Codes           map[string]*core.RecordRef
	// contains filtered or unexported fields
}

ContractsBuilder for tests

func NewContractBuilder added in v0.7.5

func NewContractBuilder(am core.ArtifactManager) *ContractsBuilder

NewContractBuilder returns a new `ContractsBuilder`, takes in: path to tmp directory, artifact manager, ...

func (*ContractsBuilder) Build added in v0.7.5

func (cb *ContractsBuilder) Build(ctx context.Context, contracts map[string]*preprocessor.ParsedFile, domain *core.RecordID) error

Build ...

func (*ContractsBuilder) Clean added in v0.7.5

func (cb *ContractsBuilder) Clean()

Clean deletes tmp directory used for contracts building

type Discovery added in v0.7.5

type Discovery struct {
	Host     string `mapstructure:"host"`
	Role     string `mapstructure:"role"`
	KeysFile string `mapstructure:"keys_file"`
	CertName string `mapstructure:"cert_name"`
}

Discovery contains info about discovery nodes

type Genesis

type Genesis struct {
	ArtifactManager core.ArtifactManager `inject:""`
	MBLock          messageBusLocker     `inject:""`
	// contains filtered or unexported fields
}

Genesis is a component for precreation core contracts types and RootDomain instance

func NewGenesis

func NewGenesis(isGenesis bool, genesisConfigPath string, genesisKeyOut string) (*Genesis, error)

NewGenesis creates new Genesis

func (*Genesis) Start

func (g *Genesis) Start(ctx context.Context) error

Start creates types and RootDomain instance

Jump to

Keyboard shortcuts

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