I’m looking for the equivalent REST endpoints that correspond to the gRPC endpoints used to retrieve block events for older sporks. I need to access block events from historical blocks, but the current implementation relies on gRPC endpoints. Could someone please provide the REST API endpoints or alternative approaches to retrieve block events for specific block heights using REST? Any guidance or examples would be greatly appreciated!
access-001.mainnet21.nodes.onflow.org:9000 (gRPC) => ? (rest)
You can directly hit the REST port 8070
of the historical access node.
e.g.
$ curl access-001.mainnet21.nodes.onflow.org:8070/v1/blocks?height=final [ { "header": { "id": "cb4fcec7a2a2c957f5e4f657a9c5745f49b859ad95ee64802d5d409dd05f97ba", "parent_id": "ed55da587f0a4c364b1bd0b24ac682347172bd35a03bb1172b00848f303a12c7", "height": "47169691", "timestamp": "2023-02-22T15:59:08.845673589Z", "parent_voter_signature": "+G6KAAAAAAAAAAAAALCJwaesNJ04JdWI0WzWt22Cg/Kc2P2avaEx+jY3ilagdCpCo2z5zzACLxPfvS1F1R2AsKGkgt4NunoBOHSh42hSJGXaRTrb6615ZKmFkHrjmjlTnvxDF1B61QZJFtvE0Db4Aw==" }, "_expandable": { "payload": "/v1/blocks/cb4fcec7a2a2c957f5e4f657a9c5745f49b859ad95ee64802d5d409dd05f97ba/payload" }, "_links": { "_self": "/v1/blocks/cb4fcec7a2a2c957f5e4f657a9c5745f49b859ad95ee64802d5d409dd05f97ba" } }
thank you very much vishal, it works via curl but when I use it like
fcl.config()
.put("sdk.transport", require("@onflow/transport-grpc").send)
.put('accessNode.api', "https://access-001.mainnet21.nodes.onflow.org:8070");
let response= await fcl.block({ sealed: true });
it throw Error: Response closed without headers
Do you happen to know what could possibly be causing this issue?