config

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2018 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bootstrap

func Bootstrap(configFile string)

func CreateConfigFile

func CreateConfigFile(args map[string]interface{}) (*viper.Viper, error)

CreateConfigFile creates minimum config file with arguments

Types

type AccountConfig

type AccountConfig struct {
	Address  string
	Key      string
	Password string
}

type Bootstrapper

type Bootstrapper struct {
}

func (*Bootstrapper) Bootstrap

func (*Bootstrapper) Bootstrap(context map[string]interface{}) error

type Configuration

type Configuration struct {
	V *viper.Viper
	// contains filtered or unexported fields
}
var Config *Configuration

func NewConfiguration

func NewConfiguration(configFile string) *Configuration

Configuration Implementation

func (*Configuration) GetBootstrapPeers

func (c *Configuration) GetBootstrapPeers() []string

GetBootstrapPeers returns the list of configured bootstrap nodes for the given network.

func (*Configuration) GetContractAddress

func (c *Configuration) GetContractAddress(contract string) (address common.Address)

GetContractAddress returns the deployed contract address for a given contract.

func (*Configuration) GetContractAddressString

func (c *Configuration) GetContractAddressString(contract string) (address string)

GetContractAddressString returns the deployed contract address for a given contract.

func (*Configuration) GetEthAuthKeyPair

func (c *Configuration) GetEthAuthKeyPair() (pub, priv string)

func (*Configuration) GetEthereumAccount

func (c *Configuration) GetEthereumAccount(accountName string) (account *AccountConfig, err error)

func (*Configuration) GetEthereumContextWaitTimeout

func (c *Configuration) GetEthereumContextWaitTimeout() time.Duration

func (*Configuration) GetEthereumDefaultAccountName

func (c *Configuration) GetEthereumDefaultAccountName() string

func (*Configuration) GetEthereumGasLimit

func (c *Configuration) GetEthereumGasLimit() uint64

func (*Configuration) GetEthereumGasPrice

func (c *Configuration) GetEthereumGasPrice() *big.Int

func (*Configuration) GetEthereumIntervalRetry

func (c *Configuration) GetEthereumIntervalRetry() time.Duration

func (*Configuration) GetEthereumMaxRetries

func (c *Configuration) GetEthereumMaxRetries() int

func (*Configuration) GetEthereumNodeURL

func (c *Configuration) GetEthereumNodeURL() string

////////////////////////////////////////////////////////////////////////////// Ethereum //////////////////////////////////////////////////////////////////////////////

func (*Configuration) GetIdentityID

func (c *Configuration) GetIdentityID() ([]byte, error)

GetIdentityID returns the self centID

func (*Configuration) GetNetworkID

func (c *Configuration) GetNetworkID() uint32

GetNetworkID returns the numerical network id.

func (*Configuration) GetNetworkKey

func (c *Configuration) GetNetworkKey(k string) string

func (*Configuration) GetNetworkString

func (c *Configuration) GetNetworkString() string

////////////////////////////////////////////////////////////////////////////// Network Configuration //////////////////////////////////////////////////////////////////////////////

func (*Configuration) GetNumWorkers

func (c *Configuration) GetNumWorkers() int

func (*Configuration) GetP2PExternalIP

func (c *Configuration) GetP2PExternalIP() string

P2P External IP

func (*Configuration) GetP2PPort

func (c *Configuration) GetP2PPort() int

P2P Port

func (*Configuration) GetReceiveEventNotificationEndpoint

func (c *Configuration) GetReceiveEventNotificationEndpoint() string

////////////////////////////////////////////////////////////////////////////// Notifications //////////////////////////////////////////////////////////////////////////////

func (*Configuration) GetServerAddress

func (c *Configuration) GetServerAddress() string

func (*Configuration) GetServerPort

func (c *Configuration) GetServerPort() int

func (*Configuration) GetSigningKeyPair

func (c *Configuration) GetSigningKeyPair() (pub, priv string)

func (*Configuration) GetStoragePath

func (c *Configuration) GetStoragePath() string

Storage backend

func (*Configuration) GetTxPoolAccessEnabled

func (c *Configuration) GetTxPoolAccessEnabled() bool

Important flag for concurrency handling. Disable if Ethereum client doesn't support txpool API (INFURA)

func (*Configuration) GetWorkerWaitTimeMS

func (c *Configuration) GetWorkerWaitTimeMS() int

func (*Configuration) InitializeViper

func (c *Configuration) InitializeViper()

func (*Configuration) ReadConfigFile

func (c *Configuration) ReadConfigFile(path string) error

func (*Configuration) SetConfigFile

func (c *Configuration) SetConfigFile(path string) error

SetConfigFile returns an error if viper was already initialized.

type IdentityConfig

type IdentityConfig struct {
	ID         []byte
	PublicKey  []byte
	PrivateKey []byte
}

IdentityConfig holds ID, public and private key of a single entity

Jump to

Keyboard shortcuts

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