Documentation ¶
Index ¶
- Constants
- Variables
- func LoadFilePV(keyFilePath, stateFilePath string) (*privval.FilePV, error)
- func MakeAbsolute(root, path string) string
- func OffsetPort(addr string, basePort int, offset int) (*url.URL, error)
- func Store(config *Config) error
- func StringToEnumHookFunc() mapstructure.DecodeHookFuncType
- func StringToMultiaddrHookFunc() mapstructure.DecodeHookFuncType
- type API
- type Accumulate
- type AnalysisLog
- type Config
- type Describe
- func (n *Describe) AnchorPool() *url.URL
- func (n *Describe) BlockLedger(i uint64) *url.URL
- func (v *Describe) Copy() *Describe
- func (v *Describe) CopyAsInterface() interface{}
- func (v *Describe) Equal(u *Describe) bool
- func (v *Describe) IsValid() error
- func (n *Describe) Ledger() *url.URL
- func (v *Describe) MarshalBinary() ([]byte, error)
- func (v *Describe) MarshalJSON() ([]byte, error)
- func (n *Describe) NodeUrl(path ...string) *url.URL
- func (n *Describe) Operators() *url.URL
- func (n *Describe) OperatorsPage() *url.URL
- func (n *Describe) PartitionUrl() NetworkUrl
- func (n *Describe) Synthetic() *url.URL
- func (v *Describe) UnmarshalBinary(data []byte) error
- func (v *Describe) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *Describe) UnmarshalJSON(data []byte) error
- type LogLevel
- type Network
- func (v *Network) Copy() *Network
- func (v *Network) CopyAsInterface() interface{}
- func (v *Network) Equal(u *Network) bool
- func (n *Network) GetBvnNames() []string
- func (n *Network) GetPartitionByID(partitionID string) *Partition
- func (v *Network) IsValid() error
- func (v *Network) MarshalBinary() ([]byte, error)
- func (v *Network) MarshalJSON() ([]byte, error)
- func (v *Network) UnmarshalBinary(data []byte) error
- func (v *Network) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *Network) UnmarshalJSON(data []byte) error
- type NetworkType
- type NetworkUrl
- type Node
- type NodeType
- type P2P
- func (v *P2P) Copy() *P2P
- func (v *P2P) CopyAsInterface() interface{}
- func (v *P2P) Equal(u *P2P) bool
- func (v *P2P) IsValid() error
- func (v *P2P) MarshalBinary() ([]byte, error)
- func (v *P2P) MarshalJSON() ([]byte, error)
- func (v *P2P) UnmarshalBinary(data []byte) error
- func (v *P2P) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *P2P) UnmarshalJSON(data []byte) error
- type Partition
- func (v *Partition) Copy() *Partition
- func (v *Partition) CopyAsInterface() interface{}
- func (v *Partition) Equal(u *Partition) bool
- func (v *Partition) IsValid() error
- func (v *Partition) MarshalBinary() ([]byte, error)
- func (v *Partition) MarshalJSON() ([]byte, error)
- func (v *Partition) UnmarshalBinary(data []byte) error
- func (v *Partition) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *Partition) UnmarshalJSON(data []byte) error
- type PortOffset
- type Snapshots
- type Storage
- type StorageType
Constants ¶
const ( BlockValidator = protocol.PartitionTypeBlockValidator Directory = protocol.PartitionTypeDirectory NetworkTypeBlockValidator = protocol.PartitionTypeBlockValidator NetworkTypeDirectory = protocol.PartitionTypeDirectory )
const ( Validator = NodeTypeValidator Follower = NodeTypeFollower )
const DevNet = "devnet"
const PortOffsetBlockValidator = 100
const PortOffsetDirectory = 0
Variables ¶
var DefaultLogLevels = LogLevel{}.
SetDefault("error").
SetModule("statesync", "info").
SetModule("snapshot", "info").
SetModule("restore", "info").
SetModule("executor", "info").
SetModule("synthetic", "info").
SetModule("website", "info").
String()
var PortOffsetMax = PortOffsetPrometheus
Functions ¶
func MakeAbsolute ¶
func StringToEnumHookFunc ¶
func StringToEnumHookFunc() mapstructure.DecodeHookFuncType
StringToEnumHookFunc is a decode hook for mapstructure that converts enums to strings.
func StringToMultiaddrHookFunc ¶
func StringToMultiaddrHookFunc() mapstructure.DecodeHookFuncType
StringToMultiaddrHookFunc is a decode hook for mapstructure that converts strings to multiaddrs.
Types ¶
type API ¶
type API struct { TxMaxWaitTime time.Duration `toml:"tx-max-wait-time" mapstructure:"tx-max-wait-time"` PrometheusServer string `toml:"prometheus-server" mapstructure:"prometheus-server"` ListenAddress string `toml:"listen-address" mapstructure:"listen-address"` DebugJSONRPC bool `toml:"debug-jsonrpc" mapstructure:"debug-jsonrpc"` EnableDebugMethods bool `toml:"enable-debug-methods" mapstructure:"enable-debug-methods"` ConnectionLimit int `toml:"connection-limit" mapstructure:"connection-limit"` ReadHeaderTimeout time.Duration `toml:"read-header-timeout" mapstructure:"read-header-timeout"` }
type Accumulate ¶
type Accumulate struct { Describe `toml:"describe" mapstructure:"describe"` BatchReplayLimit int `toml:"batch-replay-limit" mapstructure:"batch-replay-limit"` // TODO: move network config to its own file since it will be constantly changing over time. // NetworkConfig string `toml:"network" mapstructure:"network"` Snapshots Snapshots `toml:"snapshots" mapstructure:"snapshots"` Storage Storage `toml:"storage" mapstructure:"storage"` P2P P2P `toml:"p2p" mapstructure:"p2p"` API API `toml:"api" mapstructure:"api"` AnalysisLog AnalysisLog `toml:"analysis" mapstructure:"analysis"` }
type AnalysisLog ¶
type AnalysisLog struct { Directory string `toml:"directory" mapstructure:"directory"` Enabled bool `toml:"enabled" mapstructure:"enabled"` // contains filtered or unexported fields }
func (*AnalysisLog) Flush ¶
func (a *AnalysisLog) Flush()
func (*AnalysisLog) GetDataSet ¶
func (a *AnalysisLog) GetDataSet(dataSetName string) *logging.DataSet
func (*AnalysisLog) Init ¶
func (a *AnalysisLog) Init(workingDir string, partitionId string)
func (*AnalysisLog) InitDataSet ¶
func (a *AnalysisLog) InitDataSet(dataSetName string, opts logging.Options)
type Config ¶
type Config struct { tm.Config Accumulate Accumulate }
type Describe ¶
type Describe struct { NetworkType NetworkType `json:"networkType,omitempty" form:"networkType" query:"networkType" validate:"required" toml:"type" mapstructure:"type"` PartitionId string `` /* 135-byte string literal not displayed */ LocalAddress string `` /* 140-byte string literal not displayed */ Network Network `json:"network,omitempty" form:"network" query:"network" validate:"required" toml:"network" mapstructure:"network"` // contains filtered or unexported fields }
func (*Describe) AnchorPool ¶
AnchorPool returns the URL of the partition's anchor pool.
func (*Describe) BlockLedger ¶
BlockLedger returns the URL of a partition's ledger for a block.
func (*Describe) CopyAsInterface ¶
func (v *Describe) CopyAsInterface() interface{}
func (*Describe) MarshalBinary ¶
func (*Describe) MarshalJSON ¶
func (*Describe) NodeUrl ¶
NodeUrl returns the URL of the partition, optionally with a path appended.
func (*Describe) OperatorsPage ¶
OperatorsPage returns the URL of the default page of the partition's operator key book.
func (*Describe) PartitionUrl ¶
func (n *Describe) PartitionUrl() NetworkUrl
PartitionUrl returns a NetworkUrl for the local partition.
func (*Describe) UnmarshalBinary ¶
func (*Describe) UnmarshalJSON ¶
type LogLevel ¶
LogLevel defines the default and per-module log level for Accumulate's logging.
func (LogLevel) SetDefault ¶
SetDefault sets the default log level.
type Network ¶
type Network struct { Id string `json:"id,omitempty" form:"id" query:"id" validate:"required" toml:"id" mapstructure:"id"` Partitions []Partition `` /* 128-byte string literal not displayed */ // contains filtered or unexported fields }
func (*Network) CopyAsInterface ¶
func (v *Network) CopyAsInterface() interface{}
func (*Network) GetBvnNames ¶
func (*Network) GetPartitionByID ¶
func (*Network) MarshalBinary ¶
func (*Network) MarshalJSON ¶
func (*Network) UnmarshalBinary ¶
func (*Network) UnmarshalJSON ¶
type NetworkType ¶
type NetworkType = protocol.PartitionType
type NetworkUrl ¶
func (NetworkUrl) AnchorPool ¶
func (u NetworkUrl) AnchorPool() *url.URL
AnchorPool returns the URL of the partition's anchor pool.
func (NetworkUrl) BlockLedger ¶
func (u NetworkUrl) BlockLedger(i uint64) *url.URL
BlockLedger returns the URL of a partition's ledger for a block.
func (NetworkUrl) Identity ¶
func (u NetworkUrl) Identity() *url.URL
Ledger returns the URL of the partition's identity.
func (NetworkUrl) Ledger ¶
func (u NetworkUrl) Ledger() *url.URL
Ledger returns the URL of the partition's ledger account.
func (NetworkUrl) Operators ¶
func (u NetworkUrl) Operators() *url.URL
Operators returns the URL of the partition's operator key book.
func (NetworkUrl) OperatorsPage ¶
func (n NetworkUrl) OperatorsPage() *url.URL
OperatorsPage returns the URL of the default page of the partition's operator key book.
func (NetworkUrl) Synthetic ¶
func (u NetworkUrl) Synthetic() *url.URL
Synthetic returns the URL of the partition's synthetic transaction ledger account.
type Node ¶
type Node struct { Address string `json:"address,omitempty" form:"address" query:"address" validate:"required" toml:"address" mapstructure:"address"` Type NodeType `json:"type,omitempty" form:"type" query:"type" validate:"required" toml:"type" mapstructure:"type"` // contains filtered or unexported fields }
func (*Node) CopyAsInterface ¶
func (v *Node) CopyAsInterface() interface{}
func (*Node) MarshalBinary ¶
func (*Node) UnmarshalBinary ¶
type NodeType ¶
type NodeType uint64
const NodeTypeFollower NodeType = 2
NodeTypeFollower .
const NodeTypeValidator NodeType = 1
NodeTypeValidator .
func NodeTypeByName ¶
NodeTypeByName returns the named Node Type.
func (NodeType) GetEnumValue ¶
GetEnumValue returns the value of the Node Type
func (NodeType) MarshalJSON ¶
MarshalJSON marshals the Node Type to JSON as a string.
func (NodeType) MarshalTOML ¶
MarshalTOML marshals the Node Type to Toml as a string.
func (*NodeType) SetEnumValue ¶
SetEnumValue sets the value. SetEnumValue returns false if the value is invalid.
func (*NodeType) UnmarshalJSON ¶
UnmarshalJSON unmarshals the Node Type from JSON as a string.
type P2P ¶
type P2P struct { Listen []p2p.Multiaddr `json:"listen,omitempty" form:"listen" query:"listen" validate:"required" toml:"listen" mapstructure:"listen"` BootstrapPeers []p2p.Multiaddr `` /* 150-byte string literal not displayed */ // contains filtered or unexported fields }
func (*P2P) CopyAsInterface ¶
func (v *P2P) CopyAsInterface() interface{}
func (*P2P) MarshalBinary ¶
func (*P2P) MarshalJSON ¶
func (*P2P) UnmarshalBinary ¶
func (*P2P) UnmarshalJSON ¶
type Partition ¶
type Partition struct { Id string `json:"id,omitempty" form:"id" query:"id" validate:"required" toml:"id" mapstructure:"id"` Type NetworkType `json:"type,omitempty" form:"type" query:"type" validate:"required" toml:"type" mapstructure:"type"` BasePort int64 `json:"basePort,omitempty" form:"basePort" query:"basePort" validate:"required" toml:"port" mapstructure:"port"` Nodes []Node `json:"nodes,omitempty" form:"nodes" query:"nodes" validate:"required" toml:"nodes" mapstructure:"nodes"` // contains filtered or unexported fields }
func (*Partition) CopyAsInterface ¶
func (v *Partition) CopyAsInterface() interface{}
func (*Partition) MarshalBinary ¶
func (*Partition) MarshalJSON ¶
func (*Partition) UnmarshalBinary ¶
func (*Partition) UnmarshalJSON ¶
type PortOffset ¶
type PortOffset uint64
const PortOffsetAccumulateApi PortOffset = 4
PortOffsetAccumulateApi .
const PortOffsetAccumulateP2P PortOffset = 2
PortOffsetAccumulateP2P .
const PortOffsetPrometheus PortOffset = 3
PortOffsetPrometheus .
const PortOffsetTendermintP2P PortOffset = 0
PortOffsetTendermintP2P .
const PortOffsetTendermintRpc PortOffset = 1
PortOffsetTendermintRpc .
func PortOffsetByName ¶
func PortOffsetByName(name string) (PortOffset, bool)
PortOffsetByName returns the named Port Offset.
func (PortOffset) GetEnumValue ¶
func (v PortOffset) GetEnumValue() uint64
GetEnumValue returns the value of the Port Offset
func (PortOffset) MarshalJSON ¶
func (v PortOffset) MarshalJSON() ([]byte, error)
MarshalJSON marshals the Port Offset to JSON as a string.
func (*PortOffset) SetEnumValue ¶
func (v *PortOffset) SetEnumValue(id uint64) bool
SetEnumValue sets the value. SetEnumValue returns false if the value is invalid.
func (PortOffset) String ¶
func (v PortOffset) String() string
String returns the name of the Port Offset.
func (*PortOffset) UnmarshalJSON ¶
func (v *PortOffset) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals the Port Offset from JSON as a string.
type Snapshots ¶
type Snapshots struct { // Directory is the directory to store snapshots in Directory string `toml:"directory" mapstructure:"directory"` // RetainCount is the number of snapshots to retain RetainCount int `toml:"retain" mapstructure:"retain"` // Schedule is the schedule for capturing snapshots. Schedule string `toml:"schedule" mapstructure:"schedule"` }
type Storage ¶
type Storage struct { Type StorageType `toml:"type" mapstructure:"type"` Path string `toml:"path" mapstructure:"path"` Etcd *etcd.Config `toml:"etcd" mapstructure:"etcd"` }
type StorageType ¶
type StorageType string
const ( MemoryStorage StorageType = "memory" BadgerStorage StorageType = "badger" EtcdStorage StorageType = "etcd" )