Documentation ¶
Index ¶
- Constants
- Variables
- type Client
- type EthLightChainOracle
- func (oracle *EthLightChainOracle) CurrentHeader() *types.Header
- func (oracle *EthLightChainOracle) GetHeader(hash common.Hash) *types.Header
- func (oracle *EthLightChainOracle) InsertBlockHeaders(headers []*types.Header) (int, error)
- func (oracle *EthLightChainOracle) VerifyProof(receipt *types.Receipt, proof []byte) error
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 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
Click to show internal directories.
Click to hide internal directories.