appchain

package
v1.24.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RinkebyHeader1 = "" /* 1558-byte string literal not displayed */
	RinkebyHeader2 = "" /* 1558-byte string literal not displayed */
	RinkebyHeader3 = "" /* 1558-byte string literal not displayed */

	RopstenHeader1 = "" /* 1426-byte string literal not displayed */
	RopstenHeader2 = "" /* 1425-byte string literal not displayed */
)

block headers from infura api server

View Source
const (
	// block 10105112
	RopstenHeader = "" /* 1425-byte string literal not displayed */
)

Variables

View Source
var MinConfirmNum uint64 = 15

Functions

This section is empty.

Types

type Client

type Client struct {
	EthOracle *EthLightChainOracle
}

func NewAppchainClient

func NewAppchainClient(ropsten string, path string, logger logrus.FieldLogger) (*Client, error)

type EthLightChainOracle

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

func NewRinkebyOracle

func NewRinkebyOracle(storagePath string, logger logrus.FieldLogger) (*EthLightChainOracle, error)

TODO: need to start with special header height

func NewRopstenOracle

func NewRopstenOracle(ropstenPath string, storagePath string, readOnly bool, logger logrus.FieldLogger) (*EthLightChainOracle, error)

NewRopstenOracle inits with ropsten block 10105112, receives above the 10105112 headers

func (*EthLightChainOracle) CurrentHeader

func (oracle *EthLightChainOracle) CurrentHeader() *types.Header

CurrentHeader retrieves the current head header of the canonical chain.

func (*EthLightChainOracle) GetHeader

func (oracle *EthLightChainOracle) GetHeader(hash common.Hash) *types.Header

GetHeader retrieves a block header by hash

func (*EthLightChainOracle) InsertBlockHeaders

func (oracle *EthLightChainOracle) InsertBlockHeaders(headers []*types.Header) (int, error)

InsertBlockHeaders attempts to insert the given header chain in to the local chain, possibly creating a reorg. If an error is returned, it will return the index number of the failing header as well an error describing what went wrong. Ropsten receives the block header after the height of 10105112

func (*EthLightChainOracle) VerifyProof

func (oracle *EthLightChainOracle) VerifyProof(receipt *types.Receipt, proof []byte) error

Jump to

Keyboard shortcuts

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