Somnia

Somnia is a high-performance, cost-efficient EVM-compatible Layer 1 blockchain capable of processing over 400,000 transactions per second (TPS) with sub-second finality. Built by Improbable and MSquared, Somnia features innovative MultiStream consensus, compiled EVM execution, and its custom IceDB database to achieve unprecedented scalability. The network is designed for real-time mass-consumer applications including gaming, social platforms, metaverses, and DeFi—all running fully on-chain.

Key Features

  • Full EVM Compatibility: Deploy Ethereum smart contracts without modification using existing tooling
  • MultiStream Consensus: Novel architecture where each validator maintains independent data chains, aggregated via modified PBFT
  • Ultra-High Throughput: Over 400,000 TPS (1M+ TPS achieved in stress tests)
  • Sub-Second Finality: ~100ms block times with sub-second transaction finality
  • IceDB Database: Custom database with 15-100 nanosecond read/write operations for deterministic performance
  • Compiled EVM: Bytecode compiled to native CPU code achieving near C++ execution speeds
  • Sub-Cent Fees: Extremely low transaction costs enabling complex on-chain logic
  • SOMI Native Token: Used for gas fees, staking (5M SOMI for validators), and governance
  • Deflationary Tokenomics: 50% of all gas fees are burned

TECHNICAL DISCLAIMER: AUTHORITATIVE JSON-RPC API SPECIFICATION.

GetBlock's RPC API reference documentation is provided exclusively for informational purposes and streamlined developer experience optimization. The canonical and normative specification for Ethereum Virtual Machine (EVM) JSON-RPC methods is solely maintained and published through the official Ethereum Foundation documentation portal at ethereum.org. This resource constitutes the sole authoritative reference implementation of the JSON-RPC 2.0 protocol interface across EVM-compatible execution clients.

Network Information

PropertyValue
Network NameSomnia Mainnet
Chain ID5031
Native CurrencySOMI
Decimals18
RPC URLhttps://api.infra.mainnet.somnia.network/
EVM CompatibilityFull bytecode compatibility
ConsensusMultiStream (Autobahn BFT)
Block Time~100ms
FinalitySub-second

Base URL

bashhttps://shared.eu-central-1.getblock.io
bashhttps://shared.us-east-1.getblock.io
bashhttps://shared.ap-southeast-1.getblock.io

Supported Networks

NetworkChain IDJSON RPCWSS
Mainnet5031✅✅

Quickstart

In this section, you will learn how to make your first call with either:

  • Axios
  • Python

Before you begin, you must have already installed npm or yarn on your local machine (for the Axios example) or Python and pip (for the Python example).

Refer to:

Quickstart with Axios

  1. Setup project

    Create and initialize a new project:

    bashmkdir somnia-api-quickstart
    cd somnia-api-quickstart
    npm init --yes
  2. Install Axios

    bashnpm install axios
  3. Create file

    Create a new file named index.js. This is where you will make your first call.

  4. Set ES module type

    Set the ES module "type": "module" in your package.json.

  5. Add code

    Add the following code to index.js:

    index.js

    javascriptimport axios from 'axios';
    
    const data = JSON.stringify({
        "jsonrpc": "2.0",
        "method": "eth_blockNumber",
        "params": [],
        "id": "getblock.io"
    });
    
    const config = {
        method: 'post',
        url: 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/',
        headers: {
            'Content-Type': 'application/json'
        },
        data: data
    };
    
    axios(config)
        .then(response => console.log(JSON.stringify(response.data)))
        .catch(error => console.log(error));

    Replace <ACCESS-TOKEN> with your actual access token from GetBlock.

  6. Run the script

    bashnode index.js

    Expected output (example):

    json{
        "jsonrpc": "2.0",
        "id": "getblock.io",
        "result": "0xc3ce9d5"
    }

Quickstart with Python and Requests

  1. Setup the project directory

    bashmkdir somnia-api-quickstart
    cd somnia-api-quickstart
  2. Create and activate a virtual environment

    bashpython -m venv venv
    source venv/bin/activate
    
    # On Windows, use 
    venv\Scripts\activate
  3. Install requests

    bashpip install requests
  4. Create script

    Create a file called main.py with the following content:

    main.py

    pythonimport requests
    import json
    
    url = "https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/"
    
    payload = json.dumps({
        "jsonrpc": "2.0",
        "method": "eth_blockNumber",
        "params": [],
        "id": "getblock.io"
    })
    
    headers = {
        'Content-Type': 'application/json'
    }
    
    response = requests.post(url, headers=headers, data=payload)
    print(response.text)

    Replace <ACCESS-TOKEN> with your actual access token from GetBlock.

  5. Run the script

    bashpython main.py

Available API Methods

GetBlock provides access to standard Ethereum JSON-RPC methods for the Somnia network.

Transaction Methods

MethodDescription
eth_getTransactionByHashReturns transaction by hash
eth_getTransactionByBlockHashAndIndexReturns transaction by block hash and index
eth_getTransactionByBlockNumberAndIndexReturns transaction by block number and index
eth_getTransactionCountReturns the transaction count (nonce)
eth_getTransactionReceiptReturns the receipt of a transaction
eth_sendRawTransactionSubmits a signed transaction

Block Methods

MethodDescription
eth_blockNumberReturns the current block number
eth_getBlockByHashReturns block by hash
eth_getBlockByNumberReturns block by number
eth_getBlockReceiptsReturns all receipts for a block
eth_getBlockTransactionCountByHashReturns transaction count by block hash
eth_getBlockTransactionCountByNumberReturns transaction count by block number

Account/State Methods

MethodDescription
eth_getBalanceReturns the balance of an address
eth_getStorageAtReturns the value at a storage position
eth_getCodeReturns the code at an address
eth_callExecutes a call without creating a transaction
eth_getProofReturns account and storage proof
eth_accountsReturns a list of addresses owned by client

Gas and Fee Methods

MethodDescription
eth_gasPriceReturns the current gas price
eth_estimateGasEstimates gas for a transaction
eth_feeHistoryReturns historical gas information
eth_maxPriorityFeePerGasReturns current max priority fee

Filter Methods

MethodDescription
eth_getLogsReturns logs matching filter criteria
eth_newFilterCreates a log filter
eth_newBlockFilterCreates a block filter
eth_getFilterChangesReturns filter changes since last poll
eth_getFilterLogsReturns all logs matching filter
eth_uninstallFilterRemoves a filter

Subscription Methods (WebSocket)

MethodDescription
eth_subscribeCreates a subscription for events
eth_unsubscribeCancels an existing subscription

Network/Chain Methods

MethodDescription
eth_chainIdReturns the chain ID
eth_syncingReturns sync status
net_versionReturns the network ID
net_listeningReturns listening status
net_peerCountReturns number of connected peers
web3_clientVersionReturns client version
web3_sha3Returns Keccak-256 hash of data

Debug Methods

MethodDescription
debug_traceBlockByHashTraces all transactions in a block by hash
debug_traceBlockByNumberTraces block by number
debug_traceTransactionTraces a specific transaction
debug_traceCallTraces a call without creating transaction

Support

For technical support and questions:

  • Support: support@getblock.io

See Also