Documentation
¶
Index ¶
- Constants
- type Announce
- type Bootstrap
- type Broadcast
- type ByteSize
- type Connections
- type Contract
- type Contracts
- type DockerContract
- type HTTP
- type Key
- type Keys
- type Logging
- type NetConsensus
- type Network
- type Node
- type NodeConsensus
- type NodeContracts
- type Peer
- type PeerKey
- type Pubsub
- type RateLimit
- type Registry
- type Shard
- type Storage
Constants ¶
const ( KB = 1024 MB = 1024 * KB GB = 1024 * MB TB = 1024 * GB )
Constants representing various SI multiples for bytes.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Announce ¶
type Announce struct {
MDNS bool `yaml:"mdns,omitempty"`
Registry bool `yaml:"registry,omitempty"`
}
Announce represents the configuration for announcing address to peers.
type Bootstrap ¶
type Bootstrap struct {
File string `yaml:",omitempty"`
MDNS bool `yaml:",omitempty"`
Registry bool `yaml:",omitempty"`
Static map[uint64]string `yaml:",omitempty"`
}
Bootstrap represents the configuration for bootstrapping peer addresses.
type Broadcast ¶
type Broadcast struct {
InitialBackoff time.Duration `yaml:"initial.backoff"`
MaxBackoff time.Duration `yaml:"max.backoff"`
}
Broadcast represents the configuration for maintaining the shard broadcast by a node.
type ByteSize ¶
type ByteSize uint64
ByteSize provides a YAML-serializable format for byte size definitions.
func (ByteSize) Int ¶
Int returns the ByteSize value as an int as long as it'd fit within the system's int limits.
func (ByteSize) MarshalYAML ¶
MarshalYAML implements the YAML encoding interface.
func (*ByteSize) UnmarshalYAML ¶
UnmarshalYAML implements the YAML decoding interface.
type Connections ¶
type Connections struct {
ReadTimeout time.Duration `yaml:"read.timeout"`
WriteTimeout time.Duration `yaml:"write.timeout"`
}
Connections represents the configuration for network connections. MaxPayload when used as part of the Network.NodeConnections configuration, also implicitly defines the maximum size of blocks.
type Contracts ¶
type Contracts struct {
DockerContracts []DockerContract `yaml:"contracts.docker"`
Contracts []Contract `yaml:"contracts"`
DockerMinimalVersion string `yaml:"docker.minimalversion"`
}
Contracts represent the global configuration for the contracts
func LoadContracts ¶
LoadContracts will read the YAML file at the given path and return the corresponding Contracts config.
type DockerContract ¶
type DockerContract struct {
Name string
Procedures []string
Image string
Addr string
Port string
HostPort string
HealthCheckURL string
}
DockerContract represent the configuration for a contract running inside a docker container
type Keys ¶
type Keys struct {
SigningKey *Key `yaml:"signing.key"`
TransportCert *Key `yaml:"transport.cert"`
}
Keys represents the configuration that individual nodes use for their various cryptographic keys.
type Logging ¶
type Logging struct {
ConsoleLevel log.Level `yaml:"console.level,omitempty"`
FileLevel log.Level `yaml:"file.level,omitempty"`
FilePath string `yaml:"file.path,omitempty"`
ServerHost string `yaml:"server.host,omitempty"`
ServerLevel log.Level `yaml:"server.level,omitempty"`
ServerToken string `yaml:"server.token,omitempty"`
}
Logging represents the logging configuration for individual nodes.
type NetConsensus ¶
type NetConsensus struct {
BlockReferencesSizeLimit ByteSize `yaml:"block.references.size.limit"`
BlockTransactionsSizeLimit ByteSize `yaml:"block.transactions.size.limit"`
NonceExpiration time.Duration `yaml:"nonce.expiration"`
RoundInterval time.Duration `yaml:"round.interval"`
ViewTimeout int `yaml:"view.timeout"`
}
NetConsensus represents the network-wide configuration for the consensus protocol.
type Network ¶
type Network struct {
ID string `yaml:",omitempty"`
Consensus *NetConsensus `yaml:"consensus"`
MaxPayload ByteSize `yaml:"max.payload"`
SeedNodes map[uint64]*Peer `yaml:"seed.nodes"`
Shard *Shard
}
Network represents the configuration of a Chainspace network as a whole.
func LoadNetwork ¶
LoadNetwork will read the YAML file at the given path and return the corresponding Network config.
type Node ¶
type Node struct {
Announce *Announce `yaml:"announce,omitempty"`
Bootstrap *Bootstrap `yaml:"bootstrap"`
Broadcast *Broadcast `yaml:"broadcast"`
Connections *Connections `yaml:"connections"`
Consensus *NodeConsensus `yaml:"consensus"`
Contracts *NodeContracts `yaml:"contracts"`
DisableSBAC bool `yaml:"disable.sbac,omitempty"`
HTTP HTTP `yaml:"http,omitempty"`
Logging *Logging `yaml:"logging"`
Pubsub *Pubsub `yaml:"pubsub"`
Registries []Registry `yaml:"registries,omitempty"`
Storage *Storage `yaml:"storage"`
}
Node represents the configuration of an individual node in a Chainspace network.
type NodeConsensus ¶
type NodeConsensus struct {
DriftTolerance time.Duration `yaml:"drift.tolerance"`
InitialWorkDuration time.Duration `yaml:"initial.work.duration"`
RateLimit *RateLimit `yaml:"rate.limit"`
}
NodeConsensus represents the node-specific configuration for the consensus protocol.
type NodeContracts ¶
Contracts represents the configuration for the contracts.
type Peer ¶
type Peer struct {
SigningKey *PeerKey `yaml:"signing.key"`
TransportCert *PeerKey `yaml:"transport.cert"`
}
Peer represents the cryptographic public keys of a node in a Chainspace network.
type Pubsub ¶
type Pubsub struct {
Enabled bool `yaml:"enabled"`
// if not specified choose random port and announce with mdns
Port *int `yaml:"port,omitempty"`
}
Pubsub represent the configuration for the pub sub system
type RateLimit ¶
type RateLimit struct {
InitialRate int `yaml:"initial.rate"`
RateDecrease float64 `yaml:"rate.decrease"`
RateIncrease int `yaml:"rate.increase"`
}
RateLimit represents the configuration for rate-limiting within the system.