Documentation ¶
Index ¶
- Constants
- Variables
- func GetCurValidators(cli *ethclient.Client, number *big.Int) ([]byte, error)
- func GetLastReceipt(conn *ethclient.Client, latestBlock *big.Int) (*types.Receipt, error)
- func GetMapTransactionsHashByBlockNumber(conn *ethclient.Client, number *big.Int) ([]common.Hash, error)
- func GetZkProof(endpoint string, cid msg.ChainId, height uint64) ([]*big.Int, error)
- func HeaderHeight(to common.Address, input []byte) (*big.Int, error)
- func Init2GetEth22MapNumber(lightNode common.Address)
- func InitLightManager(lightNode common.Address)
- func InitOtherChain2MapHeight(lightManager common.Address)
- func PackInput(commonAbi abi.ABI, abiMethod string, params ...interface{}) ([]byte, error)
- func StatusEncoding(r *ethtypes.Receipt) []byte
- func UnpackHeaderHeightOutput(output []byte) (*big.Int, error)
- func UnpackVerifyRangeOutput(output []byte) (*big.Int, *big.Int, error)
- func VerifyRange(to common.Address, input []byte) (*big.Int, *big.Int, error)
- type AccessKey
- type Action
- type BlockHeader
- type BlockHeaderLite
- type BlockProof
- type ExecutionOutcomeView
- type ExecutionOutcomeWithIdView
- type G2
- type GasProfile
- type GetHeight
- type GetVerifyRange
- type IndexerChunkView
- type IndexerExecutionOutcomeWithOptionalReceipt
- type IndexerExecutionOutcomeWithReceipt
- type IndexerShard
- type IndexerTransactionWithOutcome
- type InnerLite
- type IstanbulAggregatedSeal
- type IstanbulExtra
- type MapTxReceipt
- type MerklePath
- type MerklePathItem
- type Metadata
- type NearNeedHeader
- type NearReceiptProof
- type NewMapReceiptProof
- type NewReceiptProof
- type Outcome
- type OutcomeProof
- type OutcomeRootProof
- type Proof
- type Receipt
- type ReceiptProof
- type ReceiptView
- type Role
- type SignedTransactionView
- type StateChangeCauseView
- type StateChangeView
- type StateChangeWithCauseView
- type StateChangesView
- type Status
- type StreamerMessage
- type TxLog
- type TxProve
- type TxReceipt
- type TxReceiptRlp
- type TypeOfStateChange
- type Zk
Constants ¶
View Source
const ( NearAbiJson = `` /* 259-byte string literal not displayed */ McsAbi = `` /* 4643-byte string literal not displayed */ LightMangerAbi = `` /* 1776-byte string literal not displayed */ BscAbiJson = `` /* 3340-byte string literal not displayed */ KlaytnAbiJson = `` /* 2993-byte string literal not displayed */ HeightAbiJson = `` /* 146-byte string literal not displayed */ VerifiableHeaderRangeAbiJson = `` /* 218-byte string literal not displayed */ Map2OtherAbi = `` /* 5188-byte string literal not displayed */ MaticAbiJson = `` /* 3340-byte string literal not displayed */ Eth2AbiJson = `` /* 6528-byte string literal not displayed */ PlatonAbiJson = `` /* 4321-byte string literal not displayed */ ConfluxAbiJson = `` /* 3644-byte string literal not displayed */ OracleAbiJson = `` /* 2006-byte string literal not displayed */ )
View Source
const ( TransferOut = "transfer out" DepositOut = "deposit out" )
View Source
const ( MethodVerifyProofData = "verifyProofData" MethodUpdateBlockHeader = "updateBlockHeader" MethodVerifiableHeaderRange = "verifiableHeaderRange" MethodOfHeaderHeight = "headerHeight" MethodOfTransferIn = "transferIn" MethodOfDepositIn = "depositIn" MethodOfSwapIn = "swapIn" MethodOfOrderList = "orderList" MethodOfIsUsedEvent = "is_used_event" MethodOfGetBytes = "getBytes" MethodOfGetFinalBytes = "getFinalBytes" MethodOfGetHeadersBytes = "getHeadersBytes" MethodOfGetBlockHeadersBytes = "getBlockHeaderBytes" MethodOfGetUpdatesBytes = "getUpdateBytes" MethodUpdateLightClient = "updateLightClient" MethodClientState = "clientState" MethodClientStateAnalysis = "clientStateAnalysis" MethodOfState = "state" MethodOfNearestPivot = "nearestPivot" MethodOFinalizedState = "finalizedState" MethodOfVerifyReceiptProof = "verifyReceiptProof" MethodOfOrderStatus = "getOrderStatus" MethodOfPropose = "propose" MethodOfVerifyAndStore = "swapInVerify" MethodOfSwapInVerified = "swapInVerified" EventOfSwapInVerified = "mapSwapInVerified" )
View Source
const ( NearVerifyRange = "get_verifiable_header_range" NearHeaderHeight = "get_header_height" )
View Source
const ( EpochOfMap = 50000 EpochOfBsc = 200 HeaderCountOfBsc = 12 HeaderCountOfMatic = 16 HeaderCountOfPlaton = 430 EpochOfKlaytn = 3600 HeaderOneCount = 1 HeaderCountOfBttc = 64 )
Variables ¶
View Source
var ( MapId string GlobalMapConn *ethclient.Client SyncOtherMap = make(map[msg.ChainId]*big.Int) // map to other chain init height Map2OtherHeight = make(map[msg.ChainId]GetHeight) // get map to other height function collect ContractMapping = make(map[msg.ChainId]*contract.Call) Get2MapHeight = func(chainId msg.ChainId) (*big.Int, error) { return nil, nil } // get other chain to map height GetEth22MapNumber = func(chainId msg.ChainId) (*big.Int, *big.Int, error) { return nil, nil, nil } // can reform, return data is []byte GetDataByManager = func(string, ...interface{}) ([]byte, error) { return nil, nil } )
View Source
var ( HashOfDepositIn = common.HexToHash("0xb7100086a8e13ebae772a0f09b07046e389a6b036406d22b86f2d2e5b860a8d9") HashOfSwapIn = common.HexToHash("0xca1cf8cebf88499429cca8f87cbca15ab8dafd06702259a5344ddce89ef3f3a5") NearOfDepositIn = "150bd848adaf4e3e699dcac82d75f111c078ce893375373593cc1b9208998377" NearOfSwapIn = "ca1cf8cebf88499429cca8f87cbca15ab8dafd06702259a5344ddce89ef3f3a5" )
View Source
var (
Mcs, _ = abi.JSON(strings.NewReader(McsAbi))
Bsc, _ = abi.JSON(strings.NewReader(BscAbiJson))
Conflux, _ = abi.JSON(strings.NewReader(ConfluxAbiJson))
Klaytn, _ = abi.JSON(strings.NewReader(KlaytnAbiJson))
Near, _ = abi.JSON(strings.NewReader(NearAbiJson))
LightManger, _ = abi.JSON(strings.NewReader(LightMangerAbi))
Map2Other, _ = abi.JSON(strings.NewReader(Map2OtherAbi))
Height, _ = abi.JSON(strings.NewReader(HeightAbiJson))
Verify, _ = abi.JSON(strings.NewReader(VerifiableHeaderRangeAbiJson))
Matic, _ = abi.JSON(strings.NewReader(MaticAbiJson))
Eth2, _ = abi.JSON(strings.NewReader(Eth2AbiJson))
Platon, _ = abi.JSON(strings.NewReader(PlatonAbiJson))
Other, _ = abi.JSON(strings.NewReader(otherAbi))
Bttc, _ = abi.JSON(strings.NewReader(bttcAbi))
OracleAbi, _ = abi.JSON(strings.NewReader(OracleAbiJson))
)
View Source
var ( ConfirmsOfMatic = big.NewInt(10) HeaderLenOfBttc int64 = 10 HeaderLengthOfEth2 = 20 HeaderLengthOfConflux = 20 )
View Source
var (
Big0 = big.NewInt(0)
)
View Source
var (
OnlineChaId = map[msg.ChainId]string{}
)
View Source
var (
PUBLENGTH = 128
)
Functions ¶
func GetCurValidators ¶ added in v1.2.0
func GetLastReceipt ¶
func GetZkProof ¶ added in v1.2.0
func Init2GetEth22MapNumber ¶
func InitLightManager ¶ added in v1.2.0
func StatusEncoding ¶
func UnpackVerifyRangeOutput ¶
Types ¶
type Action ¶
type Action struct { Actions []interface{} `json:"actions"` // //Actions []map[string]interface{} `json:"actions"` // GasPrice string `json:"gas_price"` InputDataIds []interface{} `json:"input_data_ids"` OutputDataReceivers []interface{} `json:"output_data_receivers"` SignerID string `json:"signer_id"` SignerPublicKey string `json:"signer_public_key"` }
type BlockHeader ¶
type BlockHeader struct { ParentHash []byte Coinbase common.Address Root []byte TxHash []byte ReceiptHash []byte Bloom []byte Number *big.Int GasLimit *big.Int GasUsed *big.Int Time *big.Int ExtraData []byte MixDigest []byte Nonce []byte BaseFee *big.Int }
func ConvertHeader ¶
func ConvertHeader(header *types.Header) *BlockHeader
type BlockHeaderLite ¶
type BlockProof ¶
type ExecutionOutcomeView ¶
type ExecutionOutcomeView struct { ExecutorID types.AccountID `json:"executor_id"` GasBurnt types.Gas `json:"gas_burnt"` Logs []string `json:"logs"` Metadata Metadata `json:"metadata"` ReceiptIDs []hash.CryptoHash `json:"receipt_ids"` Status client.TransactionStatus `json:"status"` TokensBurnt string `json:"tokens_burnt"` // "242953087248000000000" }
type ExecutionOutcomeWithIdView ¶
type ExecutionOutcomeWithIdView struct { BlockHash hash.CryptoHash `json:"block_hash"` ID hash.CryptoHash `json:"id"` Outcome ExecutionOutcomeView `json:"outcome"` Proof MerklePath `json:"proof"` }
type GasProfile ¶
type GetHeight ¶
func Map2EthHeight ¶
func Map2NearHeight ¶
func Map2NearHeight(lightNode string, client *nearclient.Client) GetHeight
type GetVerifyRange ¶
func Map2EthVerifyRange ¶
func Map2NearVerifyRange ¶
func Map2NearVerifyRange(lightNode string, client *nearclient.Client) GetVerifyRange
type IndexerChunkView ¶
type IndexerChunkView struct { Author types.AccountID `json:"author"` Header client.ChunkHeaderView `json:"header"` Receipts []ReceiptView `json:"receipts"` }
type IndexerExecutionOutcomeWithOptionalReceipt ¶
type IndexerExecutionOutcomeWithOptionalReceipt struct { ExecutionOutcome ExecutionOutcomeWithIdView `json:"execution_outcome"` Receipt *client.ReceiptView `json:"receipt"` }
type IndexerExecutionOutcomeWithReceipt ¶
type IndexerExecutionOutcomeWithReceipt struct { ExecutionOutcome ExecutionOutcomeWithIdView `json:"execution_outcome"` Receipt ReceiptView `json:"receipt"` }
type IndexerShard ¶
type IndexerShard struct { Chunk *IndexerChunkView `json:"chunk"` ReceiptExecutionOutcomes []IndexerExecutionOutcomeWithReceipt `json:"receipt_execution_outcomes"` ShardID types.ShardID `json:"shard_id"` StateChanges StateChangesView `json:"state_changes"` }
type IndexerTransactionWithOutcome ¶
type IndexerTransactionWithOutcome struct { Outcome IndexerExecutionOutcomeWithOptionalReceipt `json:"outcome"` Transaction SignedTransactionView `json:"transaction"` }
type InnerLite ¶
type InnerLite struct { BlockMerkleRoot string `json:"block_merkle_root"` EpochID string `json:"epoch_id"` Height int `json:"height"` NextBpHash string `json:"next_bp_hash"` NextEpochID string `json:"next_epoch_id"` OutcomeRoot string `json:"outcome_root"` PrevStateRoot string `json:"prev_state_root"` Timestamp int64 `json:"timestamp"` TimestampNanosec string `json:"timestamp_nanosec"` }
type IstanbulAggregatedSeal ¶
type IstanbulExtra ¶
type IstanbulExtra struct { // Validators are the validators that have been added in the block Validators []common.Address // AddedPubKey are the BLS public keys for the validators added in the block AddedPubKey [][]byte // AddedG1PubKey are the BLS public keys for the validators added in the block AddedG1PubKey [][]byte // RemoveList is a bitmap having an active bit for each removed validator in the block RemoveList *big.Int // Seal is an ECDSA signature by the proposer Seal []byte // AggregatedSeal contains the aggregated BLS signature created via IBFT consensus. AggregatedSeal IstanbulAggregatedSeal // ParentAggregatedSeal contains and aggregated BLS signature for the previous block. ParentAggregatedSeal IstanbulAggregatedSeal }
func ConvertIstanbulExtra ¶
func ConvertIstanbulExtra(istanbulExtra *types.IstanbulExtra) *IstanbulExtra
type MapTxReceipt ¶
type MerklePath ¶
type MerklePath = []MerklePathItem
type MerklePathItem ¶
type MerklePathItem struct { Hash hash.CryptoHash `json:"hash"` Direction string `json:"direction"` }
type Metadata ¶
type Metadata struct { GasProfile []GasProfile `json:"gas_profile"` Version int `json:"version"` }
type NearNeedHeader ¶
type NearNeedHeader struct { ParentHash common.Hash `json:"parentHash" gencodec:"required"` Coinbase common.Address `json:"coinbase" gencodec:"required"` Root common.Hash `json:"root" gencodec:"required"` TxHash common.Hash `json:"txHash" gencodec:"required"` ReceiptHash common.Hash `json:"receiptHash" gencodec:"required"` Bloom types.Bloom `json:"bloom" gencodec:"required"` Number *hexutil.Big `json:"number" gencodec:"required"` GasLimit hexutil.Uint64 `json:"gasLimit" gencodec:"required"` GasUsed hexutil.Uint64 `json:"gasUsed" gencodec:"required"` Time hexutil.Uint64 `json:"time" gencodec:"required"` Extra hexutil.Bytes `json:"extra" gencodec:"required"` MixDigest common.Hash `json:"mixDigest"` Nonce types.BlockNonce `json:"nonce"` BaseFee *hexutil.Big `json:"baseFee" rlp:"optional"` Hash common.Hash `json:"hash"` }
func ConvertNearNeedHeader ¶
func ConvertNearNeedHeader(h *types.Header) *NearNeedHeader
type NearReceiptProof ¶
type NearReceiptProof struct { BlockHeaderLite BlockHeaderLite `json:"block_header_lite"` BlockProof []BlockProof `json:"block_proof"` OutcomeProof OutcomeProof `json:"outcome_proof"` OutcomeRootProof []OutcomeRootProof `json:"outcome_root_proof"` }
type NewMapReceiptProof ¶
type NewMapReceiptProof struct { Header *BlockHeader AggPk *G2 KeyIndex []byte Proof [][]byte Ist IstanbulExtra TxReceiptRlp TxReceiptRlp }
type NewReceiptProof ¶
type OutcomeProof ¶
type OutcomeRootProof ¶
type ReceiptProof ¶
type ReceiptProof struct { Header *BlockHeader AggPk *G2 Receipt *TxReceipt KeyIndex []byte Proof [][]byte }
type ReceiptView ¶
type SignedTransactionView ¶
type SignedTransactionView struct { SignerID types.AccountID `json:"signer_id"` PublicKey key.Base58PublicKey `json:"public_key"` Nonce types.Nonce `json:"nonce"` ReceiverID types.AccountID `json:"receiver_id"` Actions []interface{} `json:"actions"` Signature signature.Base58Signature `json:"signature"` Hash hash.CryptoHash `json:"hash"` }
type StateChangeCauseView ¶
type StateChangeView ¶
type StateChangeWithCauseView ¶
type StateChangeWithCauseView struct { Type TypeOfStateChange `json:"type"` Cause StateChangeCauseView `json:"cause"` Change StateChangeView `json:"change"` }
type StateChangesView ¶
type StateChangesView []StateChangeWithCauseView
type StreamerMessage ¶
type StreamerMessage struct { Block client.BlockView `json:"block"` Shards []IndexerShard `json:"shards"` }
type TxReceipt ¶
type TxReceiptRlp ¶
type TypeOfStateChange ¶
type TypeOfStateChange string
type Zk ¶ added in v1.2.0
type Zk struct { Code int `json:"code"` Msg string `json:"msg"` Data struct { Height string `json:"height"` Status int `json:"status"` Result struct { Proof struct { PiA []string `json:"pi_a"` PiB [][]string `json:"pi_b"` PiC []string `json:"pi_c"` Protocol string `json:"protocol"` } `json:"proof"` PublicInput []string `json:"public_input"` } `json:"result"` ErrorMsg string `json:"error_msg"` } `json:"data"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.