config

package
v0.1.45 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package config provides configuration for GRPC and HTTP api servers

Index

Constants

View Source
const Account1Private = "" /* 130-byte string literal not displayed */

Account1Private is the private key for test account

View Source
const Account1Pub = "0x7be017a967db77fd10ac7c891b3d6d946dea7e3e14756e2f0f9e09b9663f0d9c"

Account1Pub is the public key for testing

View Source
const Account2Private = "" /* 130-byte string literal not displayed */

Account2Private is the private key for secode test account

View Source
const Account2Pub = "0x22a31a84ab876f82fcafba86e77910b4419a4ee0f1d5483d7dd3b5b6b6922ee9"

Account2Pub is the public key for second test account

Variables

This section is empty.

Functions

func SaveGenesisConfig

func SaveGenesisConfig(path string, config GenesisConfig) error

SaveGenesisConfig stores account data

Types

type Config

type Config struct {
	StartGrpcServer        bool     `mapstructure:"grpc-server"`
	StartGrpcServices      []string `mapstructure:"grpc"`
	GrpcServerPort         int      `mapstructure:"grpc-port"`
	NewGrpcServerPort      int      `mapstructure:"grpc-port-new"`
	NewGrpcServerInterface string   `mapstructure:"grpc-interface-new"`
	StartJSONServer        bool     `mapstructure:"json-server"`
	StartNewJSONServer     bool     `mapstructure:"json-server-new"`
	JSONServerPort         int      `mapstructure:"json-port"`
	NewJSONServerPort      int      `mapstructure:"json-port-new"`
	// no direct command line flags for these
	StartDebugService       bool
	StartGatewayService     bool
	StartGlobalStateService bool
	StartMeshService        bool
	StartNodeService        bool
	StartSmesherService     bool
	StartTransactionService bool
}

Config defines the api config params

func DefaultConfig

func DefaultConfig() Config

DefaultConfig defines the default configuration options for api

func (*Config) ParseServicesList added in v0.1.15

func (s *Config) ParseServicesList() error

ParseServicesList enables the requested services

type GenesisAccount

type GenesisAccount struct {
	Balance uint64 `json:"balance"`
	Nonce   uint64 `json:"nonce"`
}

GenesisAccount is the json representation of an account

type GenesisConfig

type GenesisConfig struct {
	InitialAccounts map[string]GenesisAccount
}

GenesisConfig defines accounts that will exist in state at genesis

func DefaultGenesisConfig

func DefaultGenesisConfig() *GenesisConfig

DefaultGenesisConfig is the default configuration for the node

func LoadGenesisConfig

func LoadGenesisConfig(path string) (*GenesisConfig, error)

LoadGenesisConfig loads config from file if exists

Jump to

Keyboard shortcuts

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