package
0.0.0-20230530162105-6dcdc0ec4805
Repository: https://github.com/consideritdone/landslidecore.git
Documentation: pkg.go.dev

# 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

# Functions

ConfirmationFunction option can be used to prompt to confirm an action.
HeaderExpired return true if the given header expired.
Logger option can be used to set a logger for the client.
MaxBlockLag represents the maximum time difference between the realtime that a block is received and the timestamp of that block.
MaxClockDrift defines how much new header's time can drift into the future relative to the light clients local time.
MaxRetryAttempts option can be used to set max attempts before replacing primary with a witness.
NewClient returns a new light client.
NewClientFromTrustedStore initializes existing client from the trusted store.
NewHTTPClient initiates an instance of a light client using HTTP addresses for both the primary provider and witnesses of the light client.
NewHTTPClientFromTrustedStore initiates an instance of a light client using HTTP addresses for both the primary provider and witnesses and uses a trusted store as the root of trust.
PruningSize option sets the maximum amount of light blocks that the light client stores.
SequentialVerification option configures the light client to sequentially check the blocks (every block, in ascending height order).
SkippingVerification option configures the light client to skip blocks as long as {trustLevel} of the old validator set signed the new header.
ValidateTrustLevel checks that trustLevel is within the allowed range [1/3, 1].
Verify combines both VerifyAdjacent and VerifyNonAdjacent functions.
VerifyAdjacent verifies directly adjacent untrustedHeader against trustedHeader.
VerifyBackwards verifies an untrusted header with a height one less than that of an adjacent trusted header.
VerifyNonAdjacent verifies non-adjacent untrustedHeader against trustedHeader.

# Variables

DefaultTrustLevel - new header can be trusted if at least one correct validator signed it.
ErrFailedHeaderCrossReferencing is returned when the detector was not able to cross reference the header with any of the connected witnesses.
ErrLightClientAttack is returned when the light client has detected an attempt to verify a false header and has sent the evidence to either a witness or primary.
ErrNoWitnesses means that there are not enough witnesses connected to continue running the light client.

# Structs

Client represents a light client, connected to a single chain, which gets light blocks from a primary provider, verifies them either sequentially or by skipping some and stores them in a trusted store (usually, a local FS).
ErrInvalidHeader means the header either failed the basic validation or commit is not signed by 2/3+.
ErrNewValSetCantBeTrusted means the new validator set cannot be trusted because < 1/3rd (+trustLevel+) of the old validator set has signed.
ErrOldHeaderExpired means the old (trusted) header has expired according to the given trustingPeriod and current time.
ErrVerificationFailed means either sequential or skipping verification has failed to verify from header #1 to header #2 due to some reason.
TrustOptions are the trust parameters needed when a new light client connects to the network or when an existing light client that has been offline for longer than the trusting period connects to the network.

# Type aliases

Option sets a parameter for the light client.