cardano-foundation / cardano-rosetta

An implementation of Rosetta for Cardano
https://www.rosetta-api.org
Apache License 2.0
98 stars 50 forks source link

mainnet rest api block #432

Open benjamintshi opened 3 years ago

benjamintshi commented 3 years ago

when i curl https://explorer.cardano.org/rosetta/block , it response block,other_transaction { "block": { "block_identifier": { "index": 6293600, "hash": "9cfc8b464f2d56563d5bab884f4eba869c90ea71a44568e43aac1110ede99f5c" }, "parent_block_identifier": { "index": 6293599, "hash": "f48eb2c329f9ebaa64bce2fb79bc71394751fa189b0280b18951a5d64091b096" }, "timestamp": 1632653811000, "transactions": [], "metadata": { "transactionsCount": 35, "createdBy": "Pool-23fe0d0e58b18df2", "size": 21888, "epochNo": 292, "slotNo": 41087520 } }, "other_transactions": [ { "hash": "ed79b2ee63ef69501cca9a628a18f754c504e4c92d16e474b262524d763f32ff" }, ] } but testnet response block transactions { "block": { "block_identifier": { "index": 2943467, "hash": "47f6d1e77e41ff2851c09db7455f4efb91f839884166801ee8594ad09acdb53b" }, "parent_block_identifier": { "index": 2943466, "hash": "564d5c673b1903328275c1cde6f287d9f27f947309db29a327e936af301bd65a" }, "timestamp": 1632652598000, "transactions": [ { "transaction_identifier": { "hash": "34e577729ccaedf3e3f1ca7ec9baa0d2fd86fc15dc76bc1d0cc347a7764ba5ad" }, "operations": [ { "operation_identifier": { "index": 0 }, "type": "input", "status": "success", "account": { "address": "addr_test1qqvhn42gxedlk9dkeg3kgsxvpnvwggk35cfwkntavhdglpqh790xa8tyssxwt98gdvzy0rzwwruyazu333wjgqej9qwqt7cjy2" }, "amount": { "value": "-731875123", "currency": { "symbol": "ADA", "decimals": 6 } }, "coin_change": { "coin_identifier": { "identifier": "f39e96cd40da5b5d9bbcef3bb11f333022caa1711d94b8892a7191071d3c9ac4:0" }, "coin_action": "coin_spent" } }, { "operation_identifier": { "index": 1, "network_index": 0 }, "related_operations": [ { "index": 0 } ], "type": "output", "status": "success", "account": { "address": "addr_test1qqvhn42gxedlk9dkeg3kgsxvpnvwggk35cfwkntavhdglpqh790xa8tyssxwt98gdvzy0rzwwruyazu333wjgqej9qwqt7cjy2" }, "amount": { "value": "731699282", "currency": { "symbol": "ADA", "decimals": 6 } }, "coin_change": { "coin_identifier": { "identifier": "34e577729ccaedf3e3f1ca7ec9baa0d2fd86fc15dc76bc1d0cc347a7764ba5ad:0" }, "coin_action": "coin_created" } } ], "metadata": { "size": 461, "scriptSize": 0 } }, { "transaction_identifier": { "hash": "874b7a565449b24d81fc47617217134949141fae90d25c65471b963dcf87d027" }, "operations": [ { "operation_identifier": { "index": 0 }, "type": "input", "status": "success", "account": { "address": "addr_test1qpmtp5t0t5y6cqkaz7rfsyrx7mld77kpvksgkwm0p7en7qum7a589n30e80tclzrrnj8qr4qvzj6al0vpgtnmrkkksnqd8upj0" }, "amount": { "value": "-235950871", "currency": { "symbol": "ADA", "decimals": 6 } }, "coin_change": { "coin_identifier": { "identifier": "831c441fe66bc6deebcbae3e05902b074deb535a3a41181ed259e26d76f0c70b:0" }, "coin_action": "coin_spent" } }, { "operation_identifier": { "index": 1, "network_index": 0 }, "related_operations": [ { "index": 0 } ], "type": "output", "status": "success", "account": { "address": "addr_test1qpmtp5t0t5y6cqkaz7rfsyrx7mld77kpvksgkwm0p7en7qum7a589n30e80tclzrrnj8qr4qvzj6al0vpgtnmrkkksnqd8upj0" }, "amount": { "value": "235779430", "currency": { "symbol": "ADA", "decimals": 6 } }, "coin_change": { "coin_identifier": { "identifier": "874b7a565449b24d81fc47617217134949141fae90d25c65471b963dcf87d027:0" }, "coin_action": "coin_created" } } ], "metadata": { "size": 361, "scriptSize": 0 } } ], "metadata": { "transactionsCount": 2, "createdBy": "Pool-302f5b7e8814ebd6", "size": 826, "epochNo": 158, "slotNo": 38283382 } } }

kraymond37 commented 3 years ago

It seems when transactionsCount > 25, transactions would be empty, and tx hashes would be put in other_transactions.

rosetta-api says

Get a block by its Block Identifier. If transactions are returned in the same call to the node as fetching the block, the response should include these transactions in the Block object. If not, an array of Transaction Identifiers should be returned so /block/transaction fetches can be done to get all transaction information.