Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PrimaryTree ¶ added in v0.7.0
type PrimaryTree interface { GetTreeHead(context.Context) (types.TreeHead, error) GetConsistencyProof(context.Context, *requests.ConsistencyProof) (types.ConsistencyProof, error) }
Subset of the db/client interface.
type ReplicationState ¶ added in v0.7.0
type ReplicationState struct {
// contains filtered or unexported fields
}
func (ReplicationState) ReplicatedTreeHead ¶ added in v0.7.0
func (r ReplicationState) ReplicatedTreeHead(ctx context.Context, minSize uint64) (types.TreeHead, error)
Identifies the latest tree head replicated by the secondary, and with size >= minSize, or fails if priamry or secondary is in a bad or too old state.
type StartupMode ¶ added in v0.9.0
type StartupMode int
const ( // Use previously saved sth file. StartupSaved StartupMode = iota // Create sth file representing an empty tree StartupEmpty // Create sth file representing latest local tree head. StartupLocalTree StartupFileSuffix = ".startup" )
type StateManager ¶
type StateManager interface { // Treehead that we have committed to publishing, i.e., // properly replicated, and distributed to witnesses. SignedTreeHead() types.SignedTreeHead // Currently published tree. CosignedTreeHead() types.CosignedTreeHead // Run periodically rotates the node's tree heads and queries witnesses. Run(context.Context, []policy.Entity, time.Duration) }
StateManager coordinates access to a nodes tree heads and (co)signatures.
type StateManagerSingle ¶
type StateManagerSingle struct { // Lock-protected access to tree heads. All endpoints are readers. sync.RWMutex // contains filtered or unexported fields }
StateManagerSingle implements a single-instance StateManagerPrimary for primary nodes
func NewStateManagerSingle ¶
func NewStateManagerSingle(primary PrimaryTree, signer crypto.Signer, timeout time.Duration, secondary api.Secondary, secondaryPub *crypto.PublicKey, sthFileName string) (*StateManagerSingle, error)
NewStateManagerSingle() sets up a new state manager, in particular its signedTreeHead. An optional secondary node can be used to ensure that a newer primary tree is not signed unless it has been replicated.
func (*StateManagerSingle) CosignedTreeHead ¶
func (sm *StateManagerSingle) CosignedTreeHead() types.CosignedTreeHead
func (*StateManagerSingle) Run ¶
func (*StateManagerSingle) SignedTreeHead ¶ added in v0.9.0
func (sm *StateManagerSingle) SignedTreeHead() types.SignedTreeHead
Click to show internal directories.
Click to hide internal directories.