Goshen
  • Introduction
  • Get started
  • For Developers
    • Building on Goshen
    • Gas fee
    • L1/L2 differences
    • JSON RPC API
      • l2_getBatch
      • l2_getBatchIndex
      • l2_getBatchState
      • l2_getEnqueuedTxs
      • l2_getL2MMRProof
      • l2_getL2RelayMsgParams
      • l2_getPendingTxBatches
      • l2_globalInfo
      • l2_getState
      • l2_inputBatchNumber
      • l2_stateBatchNumber
      • debug_getReadStorageProofAtBlock
    • System contracts
    • Runing Goshen Node
  • Advanced Topics
    • L1/L2 Interoperability
      • Cross layer communication
      • Token Bridge
    • White Paper
  • other topics
    • Advantages and comparison
    • Roadmap
Powered by GitBook
On this page
  • Parameters
  • Returns
  • Example
  1. For Developers
  2. JSON RPC API

l2_getBatchState

Return the state of batch.

Parameters

  • batchIndex: uint64|QUANTITY - specified batch number, enable hex-encoded and original string.

Returns

Object - A batch state object with the following fields:

  • index: QUANTITY - batch number

  • blockHash: 32 bytes - the block hash that corresponding the batch

  • proposer: Address - sequencer address

  • timestamp: QUANTITY - the timestamp of the batch

Example

Request

{
    "jsonrpc": "2.0",
    "method": "l2_getBatchState",
    "id": 0,
    "params": [
        "0x21"
    ]
}

Result

{
    "jsonrpc": "2.0",
    "id": 0,
    "result": {
        "index": "0x21",
        "proposer": "0xc86cb1fdd29765dc1f2fe8029f7b36a823fa50e8",
        "timestamp": "0x62e0e6ac",
        "blockHash": "0x47fca9736145ab867d394192b3846848909e1b8ca122d8c4c252676ea1a7cdb7"
    }
}
Previousl2_getBatchIndexNextl2_getEnqueuedTxs

Last updated 2 years ago