# README
Go Header
Go Header contains all services related to generating, requesting, syncing and storing Headers.
There are 4 main components in the header package:
- p2p.Subscriber listens for new Headers from the P2P network (via the HeaderSub)
- p2p.Exchange request Headers from other nodes
- Syncer manages syncing of historical and new Headers from the P2P network
- Store manages storing Headers and making them available for access by other dependent services.
Table of Contents
- Go Header
- Table of Contents
- Minimum requirements
- Installation
- Package-specific documentation
- Code of Conduct
Minimum requirements
Requirement | Notes |
---|---|
Go version | 1.20 or higher |
Installation
go get -u https://github.com/celestiaorg/go-header.git
For more information, go visit our docs at https://pkg.go.dev/github.com/celestiaorg/go-header.
Package-specific documentation
Code of Conduct
See our Code of Conduct here.
# Packages
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Functions
New is a generic Header constructor.
Verify verifies untrusted Header against trusted following general Header checks and custom user-specific checks defined in Header.Verify
If heightThreshold is zero, uses DefaultHeightThreshold.
WithTrustedHead sets the TrustedHead parameter to the given header.
# Constants
~ 14 days of 15 second headers.
MaxRangeRequestSize defines the max amount of headers that can be handled/requested at once.
# Variables
No description provided by the author
ErrHeadersLimitExceeded is returned when ExchangeServer receives header request for more than maxRequestSize headers.
No description provided by the author
No description provided by the author
ErrNoHead is returned when Store is empty (does not contain any known header).
ErrNotFound is returned when there is no requested header.
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
ErrNonAdjacent is returned when Store is appended with a header not adjacent to the stored head.
HeadParams contains options to be used for Head interface methods.
VerifyError is thrown if a Header failed verification.
# Interfaces
Broadcaster broadcasts a Header to the network.
Exchange encompasses the behavior necessary to request Headers from the network.
Getter contains the behavior necessary for a component to retrieve headers that have been processed during header sync.
Head contains the behavior necessary for a component to retrieve the chain head.
Header abstracts all methods required to perform header sync.
Store encompasses the behavior necessary to store and retrieve Headers from a node's local storage.
Subscriber encompasses the behavior necessary to subscribe/unsubscribe from new Header events from the network.
Subscription listens for new Headers.
# Type aliases
Hash represents cryptographic hash and provides basic serialization functions.
No description provided by the author