blockring

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2017 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) Get

func (r *RingReader) Get() (uint64, 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