blockring

package
v0.8.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2018 License: ISC Imports: 7 Imported by: 0

Documentation

Overview

uses crc64 of recent blocks to produce a deterministic number for the issue hashing verification system

Index

Constants

View Source
const (
	Size = 20 // size of ring buffer
)

internal constants

Variables

This section is empty.

Functions

func CRC

func CRC(height uint64, packed []byte) uint64

crc a block digest

func Clear added in v0.3.2

func Clear(log *logger.L) error

func DigestForBlock

func DigestForBlock(number uint64) *blockdigest.Digest

fetch a digest from the ring if present

func Finalise

func Finalise() error

shudown the block system

func GetLatestCRC

func GetLatestCRC() uint64

fetch latest crc value

func Initialise

func Initialise() error

setup the current block data

func Put

func Put(number uint64, digest blockdigest.Digest, packedBlock []byte)

store a block ant its digest

Types

type RingReader

type RingReader struct {
	// contains filtered or unexported fields
}

to iterate though the ring

func NewRingReader

func NewRingReader() *RingReader

start of ring iterator

func (*RingReader) GetCRC added in v0.5.7

func (r *RingReader) GetCRC() uint64

read the fetched value

func (*RingReader) Next added in v0.5.7

func (r *RingReader) Next() bool

fetch item from ring works in reverse, fetching older items

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL