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
- 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 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
- type Website
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").
String()
var PortOffsetMax = PortOffsetPrometheus
Functions ¶
func LoadFilePV ¶ added in v1.0.0
func MakeAbsolute ¶ added in v0.5.1
func StringToEnumHookFunc ¶ added in v1.0.0
func StringToEnumHookFunc() mapstructure.DecodeHookFuncType
StringToEnumHookFunc is a decode hook for mapstructure that will convert enums to strings
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 { // SentryDSN string `toml:"sentry-dsn" mapstructure:"sentry-dsn"` Describe `toml:"describe" mapstructure:"describe"` // 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"` API API `toml:"api" mapstructure:"api"` Website Website `toml:"website" mapstructure:"website"` AnalysisLog AnalysisLog `toml:"analysis" mapstructure:"analysis"` }
type AnalysisLog ¶ added in v1.0.0
type AnalysisLog struct { Directory string `toml:"directory" mapstructure:"directory"` Enabled bool `toml:"enabled" mapstructure:"enabled"` // contains filtered or unexported fields }
func (*AnalysisLog) Flush ¶ added in v1.0.0
func (a *AnalysisLog) Flush()
func (*AnalysisLog) GetDataSet ¶ added in v1.0.0
func (a *AnalysisLog) GetDataSet(dataSetName string) *logging.DataSet
func (*AnalysisLog) Init ¶ added in v1.0.0
func (a *AnalysisLog) Init(workingDir string, partitionId string)
func (*AnalysisLog) InitDataSet ¶ added in v1.0.0
func (a *AnalysisLog) InitDataSet(dataSetName string, opts logging.Options)
type Config ¶
type Config struct { tm.Config Accumulate Accumulate }
type Describe ¶ added in v1.0.0
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 ¶ added in v1.0.0
AnchorPool returns the URL of the partition's anchor pool.
func (*Describe) BlockLedger ¶ added in v1.0.0
BlockLedger returns the URL of a partition's ledger for a block.
func (*Describe) CopyAsInterface ¶ added in v1.0.0
func (v *Describe) CopyAsInterface() interface{}
func (*Describe) MarshalBinary ¶ added in v1.0.0
func (*Describe) MarshalJSON ¶ added in v1.0.0
func (*Describe) NodeUrl ¶ added in v1.0.0
NodeUrl returns the URL of the partition, optionally with a path appended.
func (*Describe) Operators ¶ added in v1.0.0
Operators returns the URL of the partition's operator key book.
func (*Describe) OperatorsPage ¶ added in v1.0.0
OperatorsPage returns the URL of the default page of the partition's operator key book.
func (*Describe) PartitionUrl ¶ added in v1.0.0
func (n *Describe) PartitionUrl() NetworkUrl
PartitionUrl returns a NetworkUrl for the local partition.
func (*Describe) Synthetic ¶ added in v1.0.0
Synthetic returns the URL of the partition's ledger account.
func (*Describe) UnmarshalBinary ¶ added in v1.0.0
func (*Describe) UnmarshalBinaryFrom ¶ added in v1.0.0
func (*Describe) UnmarshalJSON ¶ added in v1.0.0
type LogLevel ¶ added in v0.5.1
LogLevel defines the default and per-module log level for Accumulate's logging.
func (LogLevel) Parse ¶ added in v0.5.1
Parse parses a string such as "error;accumulate=info" into a LogLevel.
func (LogLevel) SetDefault ¶ added in v0.5.1
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 ¶ added in v1.0.0
func (v *Network) CopyAsInterface() interface{}
func (*Network) GetBvnNames ¶
func (*Network) GetPartitionByID ¶ added in v1.0.0
func (*Network) MarshalBinary ¶ added in v1.0.0
func (*Network) MarshalJSON ¶ added in v1.0.0
func (*Network) UnmarshalBinary ¶ added in v1.0.0
func (*Network) UnmarshalBinaryFrom ¶ added in v1.0.0
func (*Network) UnmarshalJSON ¶ added in v1.0.0
type NetworkType ¶
type NetworkType = protocol.PartitionType
type NetworkUrl ¶ added in v0.5.1
func (NetworkUrl) AnchorPool ¶ added in v0.5.1
func (u NetworkUrl) AnchorPool() *url.URL
AnchorPool returns the URL of the partition's anchor pool.
func (NetworkUrl) BlockLedger ¶ added in v1.0.0
func (u NetworkUrl) BlockLedger(i uint64) *url.URL
BlockLedger returns the URL of a partition's ledger for a block.
func (NetworkUrl) Identity ¶ added in v1.0.0
func (u NetworkUrl) Identity() *url.URL
Ledger returns the URL of the partition's identity.
func (NetworkUrl) Ledger ¶ added in v0.5.1
func (u NetworkUrl) Ledger() *url.URL
Ledger returns the URL of the partition's ledger account.
func (NetworkUrl) Operators ¶ added in v1.0.0
func (u NetworkUrl) Operators() *url.URL
Operators returns the URL of the partition's operator key book.
func (NetworkUrl) OperatorsPage ¶ added in v1.0.0
func (n NetworkUrl) OperatorsPage() *url.URL
OperatorsPage returns the URL of the default page of the partition's operator key book.
func (NetworkUrl) Synthetic ¶ added in v1.0.0
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 ¶ added in v1.0.0
func (v *Node) CopyAsInterface() interface{}
func (*Node) MarshalBinary ¶ added in v1.0.0
func (*Node) UnmarshalBinary ¶ added in v1.0.0
type NodeType ¶
type NodeType uint64
const NodeTypeFollower NodeType = 2
NodeTypeFollower .
const NodeTypeValidator NodeType = 1
NodeTypeValidator .
func NodeTypeByName ¶ added in v1.0.0
NodeTypeByName returns the named Node Type.
func (NodeType) GetEnumValue ¶ added in v1.0.0
GetEnumValue returns the value of the Node Type
func (NodeType) MarshalJSON ¶ added in v1.0.0
MarshalJSON marshals the Node Type to JSON as a string.
func (NodeType) MarshalTOML ¶ added in v1.0.0
MarshalTOML marshals the Node Type to Toml as a string.
func (*NodeType) SetEnumValue ¶ added in v1.0.0
SetEnumValue sets the value. SetEnumValue returns false if the value is invalid.
func (*NodeType) UnmarshalJSON ¶ added in v1.0.0
UnmarshalJSON unmarshals the Node Type from JSON as a string.
type Partition ¶ added in v1.0.0
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 ¶ added in v1.0.0
func (v *Partition) CopyAsInterface() interface{}
func (*Partition) MarshalBinary ¶ added in v1.0.0
func (*Partition) MarshalJSON ¶ added in v1.0.0
func (*Partition) UnmarshalBinary ¶ added in v1.0.0
func (*Partition) UnmarshalBinaryFrom ¶ added in v1.0.0
func (*Partition) UnmarshalJSON ¶ added in v1.0.0
type PortOffset ¶ added in v1.0.0
type PortOffset uint64
const PortOffsetAccumulateApi PortOffset = 4
PortOffsetAccumulateApi .
const PortOffsetPrometheus PortOffset = 3
PortOffsetPrometheus .
const PortOffsetTendermintP2P PortOffset = 0
PortOffsetTendermintP2P .
const PortOffsetTendermintRpc PortOffset = 1
PortOffsetTendermintRpc .
const PortOffsetWebsite PortOffset = 2
PortOffsetWebsite .
func PortOffsetByName ¶ added in v1.0.0
func PortOffsetByName(name string) (PortOffset, bool)
PortOffsetByName returns the named Port Offset.
func (PortOffset) GetEnumValue ¶ added in v1.0.0
func (v PortOffset) GetEnumValue() uint64
GetEnumValue returns the value of the Port Offset
func (PortOffset) MarshalJSON ¶ added in v1.0.0
func (v PortOffset) MarshalJSON() ([]byte, error)
MarshalJSON marshals the Port Offset to JSON as a string.
func (*PortOffset) SetEnumValue ¶ added in v1.0.0
func (v *PortOffset) SetEnumValue(id uint64) bool
SetEnumValue sets the value. SetEnumValue returns false if the value is invalid.
func (PortOffset) String ¶ added in v1.0.0
func (v PortOffset) String() string
String returns the name of the Port Offset.
func (*PortOffset) UnmarshalJSON ¶ added in v1.0.0
func (v *PortOffset) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals the Port Offset from JSON as a string.
type Snapshots ¶ added in v1.0.0
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 ¶ added in v0.5.1
type Storage struct { Type StorageType `toml:"type" mapstructure:"type"` Path string `toml:"path" mapstructure:"path"` Etcd *etcd.Config `toml:"etcd" mapstructure:"etcd"` }
type StorageType ¶ added in v0.5.1
type StorageType string
const ( MemoryStorage StorageType = "memory" BadgerStorage StorageType = "badger" EtcdStorage StorageType = "etcd" )