aurora-is-near / aurora-relayer

[DEPRECATED] Web3-compatible relayer server for Aurora.
https://aurora-is-near.github.io/aurora-relayer/
Creative Commons Zero v1.0 Universal
26 stars 13 forks source link

Support non-standard RPC methods for indexing services #123

Closed rahul10puchd closed 2 years ago

rahul10puchd commented 2 years ago

Description

This PR covers the following RPC methods: eth_getTransactionsByBlockNumber and eth_getTransactionReceiptsByBlockNumber

Rational

The main reason for this PR is that our partners requested us to support these RPC methods.

Example

Examples are mocked up because we don't have a multiple transactions in the same block.

http post localhost:8545  jsonrpc=2.0 id=1 method=eth_getTransactionsByBlockNumber params:='["0x484be53"]'

Response:

{
    "id": "1",
    "jsonrpc": "2.0",
    "result": [
        {
            "blockHash": "0xf8d8f47ffc179ad75991aa98052db8b39216009a761062f1d7ea821e9fb08c08",
            "blockNumber": "0x483a621",
            "from": "0xecee8507d92b9ab9da0afbf794f1e6e137170899",
            "gas": "0xf4515",
            "gasPrice": "0x0",
            "hash": "0x5be7cf824629122669d3aa8153abf84faf4bd58dc9726f6ac7ea84915c60e5c2",
            "input": "0x7898e0c2000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000431b4421e750000000000000000000000000000000000000000000000000000000061c0c21900000000000000000000000000000000000000000000000000000000000000074254432f55534400000000000000000000000000000000000000000000000000",
            "nonce": "0x110b",
            "r": "0xc85926d9a08b5e0635db6a50e86ac3a2ca271cbd47f68aad2a8ed54403c5c8d9",
            "s": "0x6b5f4ffcdde56b53c2b85b6f76bebc01e5dd86778496845c3fdc328adbb8f686",
            "to": "0x230182ad3e21144cc091514b3ac0f5e94b8925a7",
            "transactionIndex": "0x0",
            "v": "0x9c8a82ca",
            "value": "0x0"
        },
        {
            "blockHash": "0xf8d8f47ffc179ad75991aa98052db8b39216009a761062f1d7ea821e9fb08c08",
            "blockNumber": "0x483a621",
            "from": "0xecee8507d92b9ab9da0afbf794f1e6e137170899",
            "gas": "0xf4515",
            "gasPrice": "0x0",
            "hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
            "input": "0x7898e0c2000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000431b4421e750000000000000000000000000000000000000000000000000000000061c0c21900000000000000000000000000000000000000000000000000000000000000074254432f55534400000000000000000000000000000000000000000000000000",
            "nonce": "0x110b",
            "r": "0xc85926d9a08b5e0635db6a50e86ac3a2ca271cbd47f68aad2a8ed54403c5c8d9",
            "s": "0x6b5f4ffcdde56b53c2b85b6f76bebc01e5dd86778496845c3fdc328adbb8f686",
            "to": "0x230182ad3e21144cc091514b3ac0f5e94b8925a7",
            "transactionIndex": "0x1",
            "v": "0x9c8a82ca",
            "value": "0x0"
        }
    ]
}

Ref: binance-chain#115

0x3bfc commented 2 years ago

I am closing this PR as it outdated with the new updates of the relayer codebase. Please feel free to reopen it, if it is needed in the future.