Documentation
¶
Index ¶
- Constants
- func ConnectDb() (*gorm.DB, error)
- type EthHeaderWithProofCache
- type GetEthHeaderByHashParams
- type GetEthHeaderByHashResp
- type GetEthHeaderByNumberParams
- type GetEthHeaderByNumberResp
- type GetEthHeaderWithProofByHashParams
- type GetEthHeaderWithProofByNumberCodecResp
- type GetEthHeaderWithProofByNumberJSONResp
- type GetEthHeaderWithProofByNumberOptions
- type GetEthHeaderWithProofByNumberParams
- type GetEthHeaderWithProofByNumberRawResp
- type Shadow
- func (s *Shadow) GetEthHeaderByHash(params GetEthHeaderByHashParams, resp *GetEthHeaderByHashResp) error
- func (s *Shadow) GetEthHeaderByNumber(params GetEthHeaderByNumberParams, resp *GetEthHeaderByNumberResp) error
- func (s *Shadow) GetEthHeaderWithProofByHash(params GetEthHeaderWithProofByHashParams, resp *interface{}) error
- func (s *Shadow) GetEthHeaderWithProofByNumber(params GetEthHeaderWithProofByNumberParams, resp *interface{}) error
Constants ¶
View Source
const DB_PATH = ".darwinia/cache/shadow.db"
Same directory as `darwinia.js`
View Source
const GENESIS_ERROR = "The requested block number is too low, only support blocks heigher than %v"
Shadow genesis block error message
View Source
const PROOF_LOCK = "proof.lock"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EthHeaderWithProofCache ¶ added in v0.1.2
type EthHeaderWithProofCache struct { gorm.Model Number uint64 `json:"number" gorm:"unique_index"` Header string `json:"eth_header"` Proof string `json:"proof"` }
EthHeaderWithProof Cache
func (*EthHeaderWithProofCache) Fetch ¶ added in v0.1.2
func (c *EthHeaderWithProofCache) Fetch() (GetEthHeaderWithProofByNumberRawResp, error)
Fetch Eth Header by number
func (*EthHeaderWithProofCache) FromResp ¶ added in v0.1.2
func (c *EthHeaderWithProofCache) FromResp(resp GetEthHeaderWithProofByNumberRawResp) error
Save header to cache
func (*EthHeaderWithProofCache) IntoResp ¶ added in v0.1.2
func (c *EthHeaderWithProofCache) IntoResp() (GetEthHeaderWithProofByNumberRawResp, error)
Convert EthHeader
type GetEthHeaderByHashParams ¶ added in v0.1.2
type GetEthHeaderByHashParams struct {
Hash string `json:"hash"`
}
*
- GetEthHeaderByHash
type GetEthHeaderByHashResp ¶ added in v0.1.2
type GetEthHeaderByNumberParams ¶
type GetEthHeaderByNumberParams struct {
Number uint64 `json:"number"`
}
*
- GetEthHeaderByNumber
type GetEthHeaderWithProofByHashParams ¶ added in v0.1.2
type GetEthHeaderWithProofByHashParams struct { Hash string `json:"hash"` Options GetEthHeaderWithProofByNumberOptions `json:"options"` }
*
- GetEthHeaderWithProofByNumber
type GetEthHeaderWithProofByNumberCodecResp ¶ added in v0.1.1
type GetEthHeaderWithProofByNumberJSONResp ¶ added in v0.1.1
type GetEthHeaderWithProofByNumberJSONResp struct { Header util.DarwiniaEthHeaderHexFormat `json:"eth_header"` Proof []util.DoubleNodeWithMerkleProof `json:"proof"` }
type GetEthHeaderWithProofByNumberOptions ¶ added in v0.1.1
type GetEthHeaderWithProofByNumberOptions struct {
Format string `json:"format"`
}
*
- GetEthHeaderWithProofByNumber
type GetEthHeaderWithProofByNumberParams ¶
type GetEthHeaderWithProofByNumberParams struct { Number uint64 `json:"block_num"` Options GetEthHeaderWithProofByNumberOptions `json:"options"` }
type GetEthHeaderWithProofByNumberRawResp ¶ added in v0.1.1
type GetEthHeaderWithProofByNumberRawResp struct { Header util.DarwiniaEthHeader `json:"eth_header"` Proof []util.DoubleNodeWithMerkleProof `json:"proof"` }
type Shadow ¶
Dimmy shadow service
func (*Shadow) GetEthHeaderByHash ¶ added in v0.1.2
func (s *Shadow) GetEthHeaderByHash( params GetEthHeaderByHashParams, resp *GetEthHeaderByHashResp, ) error
func (*Shadow) GetEthHeaderByNumber ¶
func (s *Shadow) GetEthHeaderByNumber( params GetEthHeaderByNumberParams, resp *GetEthHeaderByNumberResp, ) error
func (*Shadow) GetEthHeaderWithProofByHash ¶ added in v0.1.2
func (s *Shadow) GetEthHeaderWithProofByHash( params GetEthHeaderWithProofByHashParams, resp *interface{}, ) error
func (*Shadow) GetEthHeaderWithProofByNumber ¶
func (s *Shadow) GetEthHeaderWithProofByNumber( params GetEthHeaderWithProofByNumberParams, resp *interface{}, ) error
Click to show internal directories.
Click to hide internal directories.