Documentation ¶
Index ¶
- type FairPosCalculatorV1
- func (calc *FairPosCalculatorV1) CalculateBaseTarget(targetBlockDelaySeconds uint64, confirmedHeight uint64, confirmedTarget uint64, ...) (types.BaseTarget, error)
- func (calc *FairPosCalculatorV1) CalculateDelay(hit *Hit, confirmedTarget types.BaseTarget, balance uint64) (uint64, error)
- func (calc *FairPosCalculatorV1) HeightForHit(height uint64) uint64
- type FairPosCalculatorV2
- func (calc *FairPosCalculatorV2) CalculateBaseTarget(targetBlockDelaySeconds uint64, confirmedHeight uint64, confirmedTarget uint64, ...) (types.BaseTarget, error)
- func (calc *FairPosCalculatorV2) CalculateDelay(hit *Hit, confirmedTarget types.BaseTarget, balance uint64) (uint64, error)
- func (calc *FairPosCalculatorV2) HeightForHit(height uint64) uint64
- type GenerationSignatureProvider
- type Hit
- type NXTGenerationSignatureProvider
- func (p *NXTGenerationSignatureProvider) GenerationSignature(key [crypto.KeySize]byte, msg []byte) ([]byte, error)
- func (p *NXTGenerationSignatureProvider) HitSource(key [crypto.KeySize]byte, msg []byte) ([]byte, error)
- func (p *NXTGenerationSignatureProvider) VerifyGenerationSignature(pk crypto.PublicKey, msg, sig []byte) (bool, []byte, error)
- type NxtPosCalculator
- func (calc *NxtPosCalculator) CalculateBaseTarget(targetBlockDelaySeconds uint64, prevHeight uint64, prevTarget uint64, ...) (types.BaseTarget, error)
- func (calc *NxtPosCalculator) CalculateDelay(hit *Hit, parentTarget types.BaseTarget, balance uint64) (uint64, error)
- func (calc *NxtPosCalculator) HeightForHit(height uint64) uint64
- type PosCalculator
- type VRFGenerationSignatureProvider
- func (p *VRFGenerationSignatureProvider) GenerationSignature(key [crypto.KeySize]byte, msg []byte) ([]byte, error)
- func (p *VRFGenerationSignatureProvider) HitSource(key [crypto.KeySize]byte, msg []byte) ([]byte, error)
- func (p *VRFGenerationSignatureProvider) VerifyGenerationSignature(pk crypto.PublicKey, msg, sig []byte) (bool, []byte, error)
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FairPosCalculatorV1 ¶ added in v0.6.0
type FairPosCalculatorV1 struct { }
func (*FairPosCalculatorV1) CalculateBaseTarget ¶ added in v0.6.0
func (calc *FairPosCalculatorV1) CalculateBaseTarget( targetBlockDelaySeconds uint64, confirmedHeight uint64, confirmedTarget uint64, confirmedTimestamp uint64, greatGrandParentTimestamp uint64, applyingBlockTimestamp uint64, ) (types.BaseTarget, error)
func (*FairPosCalculatorV1) CalculateDelay ¶ added in v0.6.0
func (calc *FairPosCalculatorV1) CalculateDelay(hit *Hit, confirmedTarget types.BaseTarget, balance uint64) (uint64, error)
func (*FairPosCalculatorV1) HeightForHit ¶ added in v0.6.0
func (calc *FairPosCalculatorV1) HeightForHit(height uint64) uint64
type FairPosCalculatorV2 ¶ added in v0.6.0
type FairPosCalculatorV2 struct { }
func (*FairPosCalculatorV2) CalculateBaseTarget ¶ added in v0.6.0
func (calc *FairPosCalculatorV2) CalculateBaseTarget( targetBlockDelaySeconds uint64, confirmedHeight uint64, confirmedTarget uint64, confirmedTimestamp uint64, greatGrandParentTimestamp uint64, applyingBlockTimestamp uint64, ) (types.BaseTarget, error)
func (*FairPosCalculatorV2) CalculateDelay ¶ added in v0.6.0
func (calc *FairPosCalculatorV2) CalculateDelay(hit *Hit, confirmedTarget types.BaseTarget, balance uint64) (uint64, error)
func (*FairPosCalculatorV2) HeightForHit ¶ added in v0.6.0
func (calc *FairPosCalculatorV2) HeightForHit(height uint64) uint64
type GenerationSignatureProvider ¶ added in v0.5.0
type GenerationSignatureProvider interface { // GenerationSignature calculates generation signature from given message using secret or public key of block's generator. GenerationSignature(key [crypto.KeySize]byte, msg []byte) ([]byte, error) // HitSource calculates hit source bytes for given message and key. HitSource(key [crypto.KeySize]byte, msg []byte) ([]byte, error) // VerifyGenerationSignature checks that generation signature is valid for given message and generator's public key. // It returns verification result and error if any. VerifyGenerationSignature(pk crypto.PublicKey, msg, sig []byte) (bool, []byte, error) }
type NXTGenerationSignatureProvider ¶ added in v0.5.0
type NXTGenerationSignatureProvider struct { }
NXTGenerationSignatureProvider implements the original NXT way to create generation signature using generator's public key and generation signature from the previous block.
func (*NXTGenerationSignatureProvider) GenerationSignature ¶ added in v0.5.0
func (p *NXTGenerationSignatureProvider) GenerationSignature(key [crypto.KeySize]byte, msg []byte) ([]byte, error)
GenerationSignature builds NXT generation signature using only generator's public key.
func (*NXTGenerationSignatureProvider) VerifyGenerationSignature ¶ added in v0.5.0
type NxtPosCalculator ¶
type NxtPosCalculator struct { }
func (*NxtPosCalculator) CalculateBaseTarget ¶
func (calc *NxtPosCalculator) CalculateBaseTarget( targetBlockDelaySeconds uint64, prevHeight uint64, prevTarget uint64, parentTimestamp uint64, greatGrandParentTimestamp uint64, currentTimestamp uint64, ) (types.BaseTarget, error)
func (*NxtPosCalculator) CalculateDelay ¶
func (calc *NxtPosCalculator) CalculateDelay(hit *Hit, parentTarget types.BaseTarget, balance uint64) (uint64, error)
func (*NxtPosCalculator) HeightForHit ¶ added in v0.5.0
func (calc *NxtPosCalculator) HeightForHit(height uint64) uint64
type PosCalculator ¶ added in v0.5.0
type PosCalculator interface { HeightForHit(height uint64) uint64 CalculateBaseTarget( targetBlockDelaySeconds uint64, prevHeight uint64, prevTarget uint64, parentTimestamp uint64, greatGrandParentTimestamp uint64, currentTimestamp uint64, ) (uint64, error) CalculateDelay(hit *big.Int, parentTarget, balance uint64) (uint64, error) }
type VRFGenerationSignatureProvider ¶ added in v0.5.0
type VRFGenerationSignatureProvider struct { }
VRFGenerationSignatureProvider implements generation of VRF pseudo-random value calculated from generation signature of previous block and generator's secret key.
func (*VRFGenerationSignatureProvider) GenerationSignature ¶ added in v0.5.0
func (*VRFGenerationSignatureProvider) VerifyGenerationSignature ¶ added in v0.5.0
func (p *VRFGenerationSignatureProvider) VerifyGenerationSignature(pk crypto.PublicKey, msg, sig []byte) (bool, []byte, error)
VerifyGenerationSignature checks that provided signature is valid against given generator's public key and message.
type Validator ¶ added in v0.9.0
type Validator struct {
// contains filtered or unexported fields
}
func NewValidator ¶ added in v0.9.0
func (*Validator) GenerateHitSource ¶ added in v0.9.0
func (*Validator) RangeForGeneratingBalanceByHeight ¶ added in v0.9.0
func (*Validator) ValidateHeaders ¶ added in v0.9.0
func (cv *Validator) ValidateHeaders(headers []proto.BlockHeader, startHeight uint64) error
Click to show internal directories.
Click to hide internal directories.