Documentation
¶
Index ¶
- func GetBlockFromJson(json string) (*collect.Block, []*collect.Tx)
- func GetReceiptFromJson(js string) *collect.Receipt
- func GetReceiptListFromJson(js string) []*collect.Receipt
- func GetTxFromJson(json string) *collect.Tx
- func HexToInt(hex string) (string, error)
- func NewService(c *config.Chain, x *xlog.XLog, store collect.StoreTaskInterface, nodeId string, ...) collect.BlockChainInterface
- type Service
- func (s *Service) CheckAddress(tx []byte, addrList map[string]int64) bool
- func (s *Service) GetBlockByHash(blockHash string, eLog *logrus.Entry, flag bool) (*collect.BlockInterface, []*collect.TxInterface)
- func (s *Service) GetBlockByNumber(blockNumber string, eLog *logrus.Entry, flag bool) (*collect.BlockInterface, []*collect.TxInterface)
- func (s *Service) GetMultiBlockByNumber(blockNumber string, log *logrus.Entry, flag bool) ([]*collect.BlockInterface, []*collect.TxInterface)
- func (s *Service) GetReceipt(txHash string, eLog *logrus.Entry) (*collect.ReceiptInterface, error)
- func (s *Service) GetReceiptByBlock(blockHash, number string, eLog *logrus.Entry) ([]*collect.ReceiptInterface, error)
- func (s *Service) GetTx(txHash string, eLog *logrus.Entry) *collect.TxInterface
- func (s *Service) Monitor()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBlockFromJson ¶
GetBlockFromJson
*
{
"number": "0xf3f088",
"hash": "0xb49d607f5b80890531e3e1d57798a7573cf8e18048ec0df34e3c81d48115078f",
"transactions":[
{
"blockHash": "0xb49d607f5b80890531e3e1d57798a7573cf8e18048ec0df34e3c81d48115078f",
"blockNumber": "0xf3f088",
"hash": "0x66db3e5d338a7c4e62a5e93c91cdadfa3137f192a492397abdc986eb3b42bdb9",
"accessList": [
{
"address": "0xe37009f6a756e8997fac8da44da7b5b87731fc22",
"storageKeys": [
"0xc4ba43fad33cbfd83623af6a18d276f51e6983dfa3b7cbdfca86c9d20686f31a",
"0xda08f9c72fdaacc1a51cab773779619b140e9591e39b9b47cb79ad0c3fcbdbc1"
]
},
{
"address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"storageKeys": [
"0x74ca828535d35a5b1358536ee1cd8c04d06a7c9414e4288c637fc0440236a8c4",
"0xe82d4ace14a34d99367f5c69eb6b54767615f9cc44834d5cf79494c9672644a9"
]
},
{
"address": "0x6fa870fc1f1d206f689621990bacf31fde420367",
"storageKeys": [
"0x0000000000000000000000000000000000000000000000000000000000000006",
"0x0000000000000000000000000000000000000000000000000000000000000007",
"0x0000000000000000000000000000000000000000000000000000000000000009",
"0x000000000000000000000000000000000000000000000000000000000000000a",
"0x000000000000000000000000000000000000000000000000000000000000000c",
"0x0000000000000000000000000000000000000000000000000000000000000008"
]
}
],
"chainId": "0x1",
"from": "0x4321d28bb600e85400e5658e0530c457e2f03250",
"gas": "0x2d8b2",
"gasPrice": "0x2aedb2837",
"input": "0x066fa870fc1f1d206f689621990bacf31fde420367000000840968310ee5",
"maxFeePerGas": "0x2aedb2837",
"maxPriorityFeePerGas": "0x0",
"nonce": "0x5d1",
"r": "0xf0589386446e1e4e08987c981483b4ea987e3cca166d61fe900f9f24fcdcf7fe",
"s": "0x38b1f53807a6da002f1ee62e41403e00f08bc6d25576b7becdea7c99d4ed57aa",
"to": "0xe9e83e5bf3d200e48059085b780031002200c100",
"transactionIndex": "0x0",
"type": "0x2",
"v": "0x0",
"value": "0x150f"
}
],
"difficulty": "0x0",
"extraData": "0x627920406275696c64657230783639",
"gasLimit": "0x1c9c380",
"gasUsed": "0xc3fd9d",
"logsBloom": "0xcff73416c8861815909c01c9b99bf32c5952375919140225d08114d4d912895576d64b2985ce445860d3b270028d07ced68209624e2829a1a2f312aa1a7ff40ef886a0dd69888f6ce913a43eeb5632228e80092798604742004b3cc1cd443d01929491a50efa2604ca76ff880ae4c9624a22d960415a6d5490dad592a08e40000a06931052271016954e0e2045121cce9450d091c3cc04582ea924dd2018099d8fd94577a9096ef23a2341d0dc9496100154860229c4afeb795d94ec0291acf5031ef40b26092958559850042436c28b5c3b364a5d1e4a1d7280b923547c360030b6ab9d40a03c68a0848f6088050e0a3456604c00c80e5ddd9eb8d0920bda86",
"miner": "0x690b9a9e9aa1c9db991c7721a92d351db4fac990",
"mixHash": "0x3d7e8678c2c523c20e27e2a024a277a4b4bdcd6315f2d51a38bfa5cf6a1dc654",
"nonce": "0x0000000000000000",
"parentHash": "0x73b66f8d4a99efe315b3a2bb82787c93693ef3e7f23a232c245f402f69576bcf",
"receiptsRoot": "0x59adae8e952f90e9653e71a866a90b051b9307636698f6aa4eeb07ba820709d0",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": "0xe610",
"stateRoot": "0x46d87b856a87ec0f9a4dd5dd1fbb4ca00d7210b2f58c63a5187d2ebdb3d0f478",
"timestamp": "0x63759f6b",
"totalDifficulty": "0xc70d815d562d3cfa955",
"transactionsRoot": "0xf25865fe021fa09e3d5dbbcc215430e3556a72f4f577c982e968570171f26e4a",
"uncles": [],
"baseFeePerGas": "0x2aedb2837"
}
func GetReceiptFromJson ¶
func GetReceiptListFromJson ¶
func GetTxFromJson ¶
GetTxFromJson *
{
"blockHash": "0xb49d607f5b80890531e3e1d57798a7573cf8e18048ec0df34e3c81d48115078f",
"blockNumber": "0xf3f088",
"hash": "0x5917da4788cdc1383215541744beb93fd804c1902e221d2c5555ce99d9bfff42",
"accessList": [],
"chainId": "0x1",
"from": "0xf4e07370db628044ee8556d1dedb0417bd518970",
"gas": "0x186a0",
"gasPrice": "0x2ea75f237",
"input": "0x095ea7b3000000000000000000000000a152f8bb749c55e9943a3a0a3111d18ee2b3f94effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"maxFeePerGas": "0x45ecedb30",
"maxPriorityFeePerGas": "0x3b9aca00",
"nonce": "0x0",
"r": "0x5db86fbd5caf3b3a0896762e90cf99502671b856d8912c059facd2cf9fb1504b",
"s": "0x43f6c37ea28057e3768fdc1504dee4e362237c26a0582aad57fe94e504372248",
"to": "0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce",
"transactionIndex": "0x9a",
"type": "0x2",
"v": "0x0",
"value": "0x0"
}
func NewService ¶
func NewService(c *config.Chain, x *xlog.XLog, store collect.StoreTaskInterface, nodeId string, transferTopic, nftTransferSingleTopic string) collect.BlockChainInterface
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) CheckAddress ¶
func (*Service) GetBlockByHash ¶
func (s *Service) GetBlockByHash(blockHash string, eLog *logrus.Entry, flag bool) (*collect.BlockInterface, []*collect.TxInterface)
func (*Service) GetBlockByNumber ¶
func (s *Service) GetBlockByNumber(blockNumber string, eLog *logrus.Entry, flag bool) (*collect.BlockInterface, []*collect.TxInterface)
func (*Service) GetMultiBlockByNumber ¶
func (s *Service) GetMultiBlockByNumber(blockNumber string, log *logrus.Entry, flag bool) ([]*collect.BlockInterface, []*collect.TxInterface)
func (*Service) GetReceipt ¶
func (*Service) GetReceiptByBlock ¶
Click to show internal directories.
Click to hide internal directories.