Documentation ¶
Index ¶
- Constants
- Variables
- func MakeAbsolute(root, path string) string
- func OffsetPort(addr string, offset int) (*url.URL, error)
- func Store(config *Config) error
- type API
- type Accumulate
- type Config
- type LogLevel
- type Network
- func (n *Network) AnchorPool() *url.URL
- func (v *Network) Copy() *Network
- func (v *Network) CopyAsInterface() interface{}
- func (n *Network) DefaultOperatorPage() *url.URL
- func (n *Network) DefaultValidatorPage() *url.URL
- func (v *Network) Equal(u *Network) bool
- func (n *Network) GetBvnNames() []string
- func (n *Network) GetSubnetByID(subnetID string) Subnet
- func (n *Network) Ledger() *url.URL
- func (v *Network) MarshalJSON() ([]byte, error)
- func (n *Network) NodeUrl(path ...string) *url.URL
- func (n *Network) OperatorBook() *url.URL
- func (n *Network) OperatorPage(index uint64) *url.URL
- func (n *Network) Synthetic() *url.URL
- func (v *Network) UnmarshalJSON(data []byte) error
- func (n *Network) ValidatorBook() *url.URL
- func (n *Network) ValidatorPage(index uint64) *url.URL
- type NetworkType
- type NetworkUrl
- func (u NetworkUrl) AnchorPool() *url.URL
- func (u NetworkUrl) Ledger() *url.URL
- func (u NetworkUrl) OperatorBook() *url.URL
- func (u NetworkUrl) OperatorPage(index uint64) *url.URL
- func (u NetworkUrl) Synthetic() *url.URL
- func (u NetworkUrl) ValidatorBook() *url.URL
- func (u NetworkUrl) ValidatorPage(index uint64) *url.URL
- type Node
- type NodeType
- type Snapshots
- type Storage
- type StorageType
- type Subnet
- type Website
Constants ¶
const ( BlockValidator = NetworkTypeBlockValidator Directory = NetworkTypeDirectory )
const ( Validator = NodeTypeValidator Follower = NodeTypeFollower )
const DevNet = "devnet"
Variables ¶
var DefaultLogLevels = LogLevel{}.
SetDefault("error").
SetModule("snapshot", "info").
SetModule("executor", "info").
String()
Functions ¶
func MakeAbsolute ¶ added in v0.5.1
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"` }
type Accumulate ¶
type Accumulate struct { SentryDSN string `toml:"sentry-dsn" mapstructure:"sentry-dsn"` Network Network `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"` }
type Config ¶
type Config struct { tm.Config Accumulate Accumulate }
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 { NetworkName string `` /* 135-byte string literal not displayed */ Type NetworkType `json:"type,omitempty" form:"type" query:"type" validate:"required" toml:"type" mapstructure:"type"` LocalSubnetID string `` /* 141-byte string literal not displayed */ LocalAddress string `` /* 140-byte string literal not displayed */ Subnets []Subnet `json:"subnets,omitempty" form:"subnets" query:"subnets" validate:"required" toml:"subnets" mapstructure:"subnets"` // contains filtered or unexported fields }
func (*Network) AnchorPool ¶ added in v0.5.1
AnchorPool returns the URL of the subnet's anchor pool.
func (*Network) CopyAsInterface ¶ added in v1.0.0
func (v *Network) CopyAsInterface() interface{}
func (*Network) DefaultOperatorPage ¶
DefaultOperatorPage returns the URL of the default page of the subnet operator key book.
func (*Network) DefaultValidatorPage ¶
DefaultValidatorPage returns the URL of the default page of the subnet operator key book.
func (*Network) GetBvnNames ¶
func (*Network) GetSubnetByID ¶
func (*Network) MarshalJSON ¶ added in v1.0.0
func (*Network) OperatorBook ¶
OperatorBook returns the URL of the subnet's operator key book.
func (*Network) OperatorPage ¶
OperatorPage returns the URL of the page of the subnet's operator key book.
func (*Network) UnmarshalJSON ¶ added in v1.0.0
func (*Network) ValidatorBook ¶ added in v0.5.1
ValidatorBook returns the URL of the subnet's validator key book.
type NetworkType ¶
type NetworkType uint64
const NetworkTypeBlockValidator NetworkType = 2
NetworkTypeBlockValidator .
const NetworkTypeDirectory NetworkType = 1
NetworkTypeDirectory .
func NetworkTypeByName ¶
func NetworkTypeByName(name string) (NetworkType, bool)
NetworkTypeByName returns the named Network Type.
func (NetworkType) GetEnumValue ¶
func (v NetworkType) GetEnumValue() uint64
GetEnumValue returns the value of the Network Type
func (NetworkType) MarshalJSON ¶
func (v NetworkType) MarshalJSON() ([]byte, error)
MarshalJSON marshals the Network Type to JSON as a string.
func (*NetworkType) SetEnumValue ¶
func (v *NetworkType) SetEnumValue(id uint64) bool
SetEnumValue sets the value. SetEnumValue returns false if the value is invalid.
func (NetworkType) String ¶
func (v NetworkType) String() string
String returns the name of the Network Type
func (*NetworkType) UnmarshalJSON ¶
func (v *NetworkType) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals the Network Type from JSON as a string.
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 subnet's anchor pool.
func (NetworkUrl) Ledger ¶ added in v0.5.1
func (u NetworkUrl) Ledger() *url.URL
Ledger returns the URL of the subnet's ledger account.
func (NetworkUrl) OperatorBook ¶
func (u NetworkUrl) OperatorBook() *url.URL
OperatorBook returns the URL of the subnet's operator key book.
func (NetworkUrl) OperatorPage ¶
func (u NetworkUrl) OperatorPage(index uint64) *url.URL
OperatorPage returns the URL of the page of the subnet's operator key book.
func (NetworkUrl) Synthetic ¶ added in v1.0.0
func (u NetworkUrl) Synthetic() *url.URL
Synthetic returns the URL of the subnet's synthetic transaction ledger account.
func (NetworkUrl) ValidatorBook ¶ added in v0.5.1
func (u NetworkUrl) ValidatorBook() *url.URL
ValidatorBook returns the URL of the subnet's validator key book.
func (NetworkUrl) ValidatorPage ¶ added in v0.5.1
func (u NetworkUrl) ValidatorPage(index uint64) *url.URL
ValidatorPage returns the URL of the page of the subnet's validator key book.
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{}
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) 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 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" )
type Subnet ¶
type Subnet 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"` Nodes []Node `json:"nodes,omitempty" form:"nodes" query:"nodes" validate:"required" toml:"nodes" mapstructure:"nodes"` // contains filtered or unexported fields }
func (*Subnet) CopyAsInterface ¶
func (v *Subnet) CopyAsInterface() interface{}