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_getState

Return the state hash corresponding to batch.

Parameters

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

Returns

DATA: 32 Bytes - hash of a batch state.

Example

Request

{
    "jsonrpc": "2.0",
    "method": "l2_getState",
    "params": [
        1
    ],
    "id": 0
}

params maybe ["1"] or ["0x1"]

Result

{
    "jsonrpc": "2.0",
    "id": 0,
    "result": "0x186eaa2ae7aa57ef77ee1f0792880758ef5bec776c48c5e4b6bca09440845e6c"
}
Previousl2_globalInfoNextl2_inputBatchNumber

Last updated 2 years ago