kas

package
v1.8.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Anchor

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

func NewKASAnchor

func NewKASAnchor(kasConfig *KASConfig, db AnchorDB, bc BlockChain) *Anchor

func (*Anchor) AnchorBlock

func (anchor *Anchor) AnchorBlock(block *types.Block) error

AnchorBlock converts given block to payload and anchor the payload via KAS anchor API.

func (*Anchor) AnchorPeriodicBlock

func (anchor *Anchor) AnchorPeriodicBlock(block *types.Block)

AnchorPeriodicBlock periodically anchor blocks to KAS. if given block is invalid, it does nothing.

type AnchorDB

type AnchorDB interface {
	WriteAnchoredBlockNumber(blockNum uint64)
	ReadAnchoredBlockNumber() uint64
}

type BlockChain

type BlockChain interface {
	GetBlockByNumber(number uint64) *types.Block
}

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type KASConfig

type KASConfig struct {
	Url, XChainId, User, Pwd string

	Operator     common.Address
	Anchor       bool
	AnchorPeriod uint64
}

type Payload

type Payload struct {
	Id string `json:"id"`
	types.AnchoringDataInternalType0
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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