Skip to content

Instantly share code, notes, and snippets.

@ligi
Created September 12, 2021 18:43
Show Gist options
  • Save ligi/f22bec74d191b1e4f4bc410e117d63c4 to your computer and use it in GitHub Desktop.
Save ligi/f22bec74d191b1e4f4bc410e117d63c4 to your computer and use it in GitHub Desktop.
✓ ~ curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x1854d7","latest"],"id":1}' https://mainnet.optimism.io
{"jsonrpc":"2.0","id":1,"error":{"code":-32602,"message":"invalid argument 1: json: cannot unmarshal string into Go value of type bool"}}
✓ ~ curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x1854d7",true],"id":1}' https://mainnet.optimism.io
{"jsonrpc":"2.0","id":1,"result":{"difficulty":"0x2","extraData":"0xd98301090a846765746889676f312e31352e3133856c696e7578000000000000de1b1e6e36b36c622af41489904a3187513c173aad0e9bd0708d7c6a3efa9e4f20220cd4d55dd89f595a7b885347f5af0eb6f77df62ca99c181a4db826218ae800","gasLimit":"0xa7d8c0","gasUsed":"0x2c024f","hash":"0xc365ee0054387dfcdb78f103634c0e99ac83df9949093cae7a80bc1c361ab9af","logsBloom":"0x00000002000000000000000000000000000000000000000000040000200000000000000000000100000080100000000100000000000020000080004000000000000000000000000881000008000000000000000000400000000800400000000000000000008000000000100000000000000000000000040008000010000800000000000000000000000100000000000000000000002000000000000000000000000000000800000000000000800000000400000000000000010000000000000000000002000000000000000000000000200000000000000000000002000000000000000828000008100100000000000000000000000008000000000000000000","miner":"0x0000000000000000000000000000000000000000","mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000","nonce":"0x0000000000000000","number":"0x1854d7","parentHash":"0xf60afec9675770d4e4820003516ff3bc227e67ef9a95d57df2f0b5fe75e8c86a","receiptsRoot":"0x0751ca5d48b909e694397434cdcd4147715716672089f622bb92720fac48c097","sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","size":"0x553","stateRoot":"0x60a4dda58f00d62a5151a77fe8fe283ea5271c7dcb7b63322ea2db88c9c4f1a7","timestamp":"0x613e4805","totalDifficulty":"0x30a9af","transactions":[{"blockHash":"0xc365ee0054387dfcdb78f103634c0e99ac83df9949093cae7a80bc1c361ab9af","blockNumber":"0x1854d7","from":"0x0c735a02b7daedeaa5e66f943fda022497b0ad0d","gas":"0x53f6321","gasPrice":"0xe4e1c0","hash":"0x2d7940a4a43b62ace0cb0e0f2766f817e1b7ed0c365e72a1a6d2f8905304cb4c","input":"0xac9650d800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000144c04b8d59000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000613e49310000000000000000000000000000000000000000000000057435f7652d5bad38000000000000000000000000000000000000000000000000006a3caf359d316f0000000000000000000000000000000000000000000000000000000000000042da10009cbd5d07dd0cecc66161fc93d7c9000da10001f494b008aa00579c1307b0ef2c499ad98a8ce58e580001f4420000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004449404b7c000000000000000000000000000000000000000000000000006a3caf359d316f0000000000000000000000000c735a02b7daedeaa5e66f943fda022497b0ad0d00000000000000000000000000000000000000000000000000000000","nonce":"0x2","to":"0xe592427a0aece92de3edee1f18e0157c05861564","transactionIndex":"0x0","value":"0x0","v":"0x38","r":"0x502e0fe82a9019b9427c45d86b588969fb69d73417caba9602262e3f33b6b372","s":"0x5a074311a263635313a27e872b51725bc4e0e83327a5232afbc17dc3b2f02f65","queueOrigin":"sequencer","txType":"","l1TxOrigin":null,"l1BlockNumber":"0xc99bb1","l1Timestamp":"0x613e4805","index":"0x1854d6","queueIndex":null,"rawTransaction":"0xf902ea0283e4e1c084053f632194e592427a0aece92de3edee1f18e0157c0586156480b90284ac9650d800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000144c04b8d59000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000613e49310000000000000000000000000000000000000000000000057435f7652d5bad38000000000000000000000000000000000000000000000000006a3caf359d316f0000000000000000000000000000000000000000000000000000000000000042da10009cbd5d07dd0cecc66161fc93d7c9000da10001f494b008aa00579c1307b0ef2c499ad98a8ce58e580001f4420000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004449404b7c000000000000000000000000000000000000000000000000006a3caf359d316f0000000000000000000000000c735a02b7daedeaa5e66f943fda022497b0ad0d0000000000000000000000000000000000000000000000000000000038a0502e0fe82a9019b9427c45d86b588969fb69d73417caba9602262e3f33b6b372a05a074311a263635313a27e872b51725bc4e0e83327a5232afbc17dc3b2f02f65"}],"transactionsRoot":"0x86b87b473d21c539c059ac213e3901344921b5bb1ed571ae1651c378ac93a3ed","uncles":[]}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment