Documentation ¶
Index ¶
Constants ¶
const ( // GreenAssessment is the overall assessment when everything checks out GreenAssessment = "ok" // YellowAssessment is the overall assessment for a warning YellowAssessment = "warning" // RedAssessment is the overall assessment when Steady detects something bad RedAssessment = "evil" )
Variables ¶
This section is empty.
Functions ¶
func WriteCollectorConfig ¶
Types ¶
type Assessment ¶
type Assessment struct { // ID is the identifier of the assessment, linked to by all events. ID uint64 // Overall is the overall assessment, see constants above. Overall string // Finding is one or more findings. Finding []Finding // Relay is the URL of the queried relay. Relay string // Time is the local time when performing the query. Time uint64 // RequestIndex is the requested starting index in the query. RequestIndex uint64 // TotalBlocks is the total number of blocks returned by the relay, where // TotalBlocks = ValidBlocks + InvalidBlocks + DuplicateBlocks. TotalBlocks uint64 // ValidBlocks is the number of blocks with a valid signature and index. ValidBlocks uint64 // InvalidBlocks is the number of blocks with an invalid signature and/or index. InvalidBlocks uint64 // DuplicateBlocks is the number of duplicate (by index) blocks. DuplicateBlocks uint64 // MissedBlocks is the number of missed blocks (see Description for details). MissedBlocks uint64 // Blockheads is a map index->blockhead with the signed root of each block and // associated data needed to verify the signature on the root. Use together with // the path of each event from a valid block as a publicly verifiable proof of // event origin. Blockheads map[uint64]BlockHead }
Assessment is the assessment made by Steady for each run of the collector loop.
type Block ¶
type Block struct { BlockHeader steady.BlockHeader Payload []byte }
type BlockHead ¶
type BlockHead struct {
PayloadHash, RootHash, Root, IV, Signature []byte
BlockID, Time, TreeSize uint64
}
BlockHead is the minimal representation of a block for use with proofs.
type Collector ¶
Collector is a Steady collector.
func NewCollector ¶
func NewCollector(address string, config Config, frequency time.Duration, delta uint64) (*Collector, error)
NewCollector attempts to create a new collector connected to a relay.
func (*Collector) Close ¶
func (c *Collector) Close()
Close closes the underlying connection to the relay.
func (*Collector) CollectLoop ¶
CollectLoop is the main collect loop of the collector
type Config ¶
func ReadCollectorConfig ¶
type Finding ¶
type Finding struct {
Label, Description string
}
Finding describes a finding as part of an assessment. The description is a freetext description (see formatstrings above) while the label is one of three possible assessments.
type Output ¶
Output is the output function for the collector. Possible labels: evil, warning, unverified, and verified. Evil = network/relay bad, warning unclear who is doing what and potentially evil, unverified is data we got but cannot verify, and verified is verified data.
type Proof ¶
Proof is an audit path that proves membership to a root in a block, and the head of the block is part of the assessment.
type Unverified ¶
Unverified is the meta output description for unverifiable blocks and events.