global

package
v0.8.2 Latest Latest
Warning

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

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

Documentation

Overview

Copyright 2017-2018 OneLedger

The overall running context. Initialized right away, but is mutable.

Contains the main variables.

Precedence:

  • Default values
  • Environment variables (like $OLROOT)
  • Configuration files
  • Command line arguments
  • Overrides

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConsensusDir added in v0.7.1

func ConsensusDir() string

func DatabaseDir added in v0.8.0

func DatabaseDir() string

Types

type Context

type Context struct {
	Application persist.Access // Global Access to the application when it is running

	Debug            bool // DEBUG flag
	DisablePasswords bool // DEBUG flag

	ConfigName      string // The Name of the config file (without extension)
	NodeName        string // Name of this instance
	NodeAccountName string // TODO: Should be a list of accounts
	PaymentAccount  string
	NodeIdentity    string
	RootDir         string // Working directory for this instance

	RpcAddress string // rpc address
	Transport  string // socket vs grpc

	AppAddress string // app address

	BTCAddress string // Bitcoin node Address port
	ETHAddress string // Ethereum node Address port

	SDKAddress string // SDK RPC address

	OLVMProtocol string // Config for the OLVM
	OLVMAddress  string

	Sequence int64 // replay protection

	TendermintRoot    string
	TendermintAddress string
	TendermintPubKey  string

	PersistentPeers string
	Seeds           string
	SeedMode        bool
	P2PAddress      string

	ConsensusNode *tmnode.Node

	//Minimum Fees
	MinSendFee     float64
	MinSwapFee     float64
	MinContractFee float64
	MinRegisterFee float64
}
var Current *Context

func NewContext

func NewContext(name string) *Context

Set the default values for any context variables here (and no where else)

func (*Context) GetApplication

func (context *Context) GetApplication() persist.Access

func (*Context) SetApplication

func (context *Context) SetApplication(app persist.Access) persist.Access

func (*Context) SetConsensusNode added in v0.7.1

func (context *Context) SetConsensusNode(node *tmnode.Node)

Jump to

Keyboard shortcuts

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