Documentation ¶
Overview ¶
A light node that follows the blockchain and archives it.
How a Nyzo blockchain context works. See "interfaces" for a better understanding of the interfaces used.
1) Creation
Easiest way: call NewDefaultContext, the New... generators for the individual components called by this function are not supposed to do much except allocate the data structures they need later (and saving a reference to the context).
If you are feeling fancy, you can build your own context from scratch, or you can make a default one and then change some of the components in there, e.g. if you only need a "light" node manager, you can replace the one in the context you just created by a "light" one. Or, maybe, for a test, you just need a context with Configuration and whichever component you want to test.
2) Initialization
Easiest way: call ContextInitialize. Initialization functions are called in sequence, starting with the Configuration component, so they provide a deterministic way to set up basic stuff without having to worry about concurrency. Any error returned here will terminate the program.
3) Start
Easiest way: call ContextStart. Everything is started in parallel, so from here on we have to be threadsafe. Some components will do this via some kind of mutex locking, some will use a central messaging loop.
4) Graceful Shutdown
Whenever a goroutine is started anywhere in the blockchain context, it should be added to the context's WaitGroup `ctxt.WaitGroup.Add(1)`, and any routine called as a goroutine should `defer ctxt.WaitGroup.Done()`. The main loop (of the verifier, sentinel etc.) just has to `ctxt.WaitGroup.Wait()`. Wait for interrupt (here) waits for an interrupt signal and sends a shutdown message to any long-running messaging loops.
A node that protects in-cycle verifiers and cycle joins.
A Nyzo verifier.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextInitialize ¶
func ContextInitialize(ctxt *interfaces.Context)
func ContextStart ¶
func ContextStart(ctxt *interfaces.Context)
func NewDefaultContext ¶
func NewDefaultContext() *interfaces.Context
func WaitForInterrupt ¶
func WaitForInterrupt()
Waits for an interrupt signal to send an exit signal to any messaging loops or other stuff that needs to know it.
Types ¶
type ArchiveNodeInterface ¶
type ArchiveNodeInterface interface {
Start()
}
type SentinelInterface ¶
type SentinelInterface interface {
Start()
}
type VerifierInterface ¶
type VerifierInterface interface {
Start()
}
Directories ¶
Path | Synopsis |
---|---|
Handles block to block balance list updates, which includes processing of V2 cycle transactions, and emission of transactions if so desired.
|
Handles block to block balance list updates, which includes processing of V2 cycle transactions, and emission of transactions if so desired. |
The block authority handles task related to validating blocks and the blockchain.
|
The block authority handles task related to validating blocks and the blockchain. |
Used by the block file handler to periodically consolidate individual block files into 1000 block file units.
|
Used by the block file handler to periodically consolidate individual block files into 1000 block file units. |
Provides a reduced record of approved cycle transactions to store with the balance list.
|
Provides a reduced record of approved cycle transactions to store with the balance list. |
This package will eventually consolidate all data relevant to the genesis of one particular Nyzo chain: The amount of coins in the system, block time, the genesis block, the trusted entry points etc.
|
This package will eventually consolidate all data relevant to the genesis of one particular Nyzo chain: The amount of coins in the system, block time, the genesis block, the trusted entry points etc. |
The cycle authority is the ultimate arbiter over the cycle at the current frozen edge height.
|
The cycle authority is the ultimate arbiter over the cycle at the current frozen edge height. |
Receives messages emitted in archive mode and writes them to a database.
|
Receives messages emitted in archive mode and writes them to a database. |
Context summarizes the various components of a node.
|
Context summarizes the various components of a node. |
Key-value store to persist data to a file.
|
Key-value store to persist data to a file. |
Simple networking component that listens to the Nyzo mesh.
|
Simple networking component that listens to the Nyzo mesh. |
Internal messages used for data sharing between components, and locally, to avoid race conditions with data access.
|
Internal messages used for data sharing between components, and locally, to avoid race conditions with data access. |
message_content
TODO: the Java version sends V1 join messages during the startup process, but V2s in some other contexts.
|
TODO: the Java version sends V1 join messages during the startup process, but V2s in some other contexts. |
message_content/message_fields
Byte level message field sizes Byte level message field serialization.
|
Byte level message field sizes Byte level message field serialization. |
A small set of components related to peer connections.
|
A small set of components related to peer connections. |
A node in the mesh, this is how we keep track of an individual peer.
|
A node in the mesh, this is how we keep track of an individual peer. |
The node manager keeps track of all our peers's behavior.
|
The node manager keeps track of all our peers's behavior. |
A simple message router with multicasting.
|
A simple message router with multicasting. |
Handle pre-signed seed transactions bouncing through the Nyzo chain.
|
Handle pre-signed seed transactions bouncing through the Nyzo chain. |
Simple crypto utilities.
|
Simple crypto utilities. |