JSON-RPC API Methods
Pharos Network is a fully EVM-equivalent Layer 1 blockchain, supporting a JSON-RPC interface for seamless blockchain interactions. This RPC API is fully compatible with existing Ethereum JSON-RPC API while also providing richer semantics and enhanced services.
Standard Ethereum Methods
eth_gasPrice
Returns the current gas price in Wei.
Input: None
Output:
String- Gas price in Wei
Example:
// Request
{
"jsonrpc": "2.0",
"method": "eth_gasPrice",
"params": [],
"id": 1
}
// Response
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x2540be400"
}eth_maxPriorityFeePerGas
Returns the priority fee needed to be included in a block (EIP-1559).
Input: None
Output:
String- Priority fee in Wei
Example:
eth_feeHistory
Returns historical gas information for fee estimation (EIP-1559).
Input:
String- Number of blocks in the requested rangeString- Highest block of the requested rangeArray- Reward percentiles to sample from each block
Output:
Object- Fee history data including baseFeePerGas, gasUsedRatio, and reward
Example:
eth_blockNumber
Returns the number of the most recent block.
Input: None
Output:
String- Block number in hexadecimal
Example:
eth_chainId
Returns the chain ID of the current network.
Input: None
Output:
String- Chain ID as a hexadecimal string
Example:
eth_syncing
Returns the sync status of the node.
Input: None
Output:
Object|Boolean- Sync status object, orfalseif not syncing
Example:
eth_getBalance
Returns the balance of an address at a given block.
Input:
String- Address to queryString- Block number or tag (latest,earliest,pending,safe,finalized)
Output:
String- Balance in Wei as hexadecimal
Example:
eth_getTransactionCount
Returns the number of transactions sent from an address (nonce).
Input:
String- Address to queryString- Block number or tag
Output:
String- Transaction count as hexadecimal
Example:
eth_getStorageAt
Returns the value from a storage position at a given address.
Input:
String- Address of the contractString- Position in storageString- Block number or tag
Output:
String- Storage value as hexadecimal
Example:
eth_getCode
Returns the contract code at a given address.
Input:
String- Address to queryString- Block number or tag
Output:
String- Contract bytecode as hexadecimal
Example:
eth_getProof
Returns the account and storage values with Merkle proof (EIP-1186). Pharos supports Simplified Payment Verification (SPV) using these proofs.
Input:
String- AddressArray- Array of storage keysString- Block number or tag
Output:
Object- Account proof including balance, codeHash, nonce, storageHash, and proofs
Example:
eth_sendRawTransaction
Submits a signed transaction to the network. Supports legacy, EIP-2930 (access list), and EIP-1559 transaction types.
Input:
String- Signed transaction data
Output:
String- Transaction hash
Example:
eth_call
Executes a message call without creating a transaction. Useful for reading contract state.
Input:
Object- Transaction call object (from, to, gas, gasPrice, value, data)String- Block number or tag
Output:
String- Return data as hexadecimal
Example:
eth_estimateGas
Estimates the gas needed to execute a transaction.
Input:
Object- Transaction call objectString- Block number or tag (optional)
Output:
String- Estimated gas as hexadecimal
Example:
eth_createAccessList
Creates an EIP-2930 access list for a transaction.
Note: This method is still under debugging and may return null values.
Input:
Object- Transaction call objectString- Block number or tag
Output:
Object- Access list and estimated gas
Example:
eth_getBlockByHash
Returns information about a block by its hash.
Input:
String- Block hashBoolean- Iftrue, returns full transaction objects; iffalse, returns transaction hashes
Output:
Object- Block information
Example:
eth_getBlockByNumber
Returns information about a block by its number.
Input:
String- Block number or tagBoolean- Iftrue, returns full transaction objects
Output:
Object- Block information
Example:
eth_getBlockReceipts
Returns all transaction receipts for a given block.
Input:
String- Block number or tag
Output:
Array- List of transaction receipts
Example:
eth_getBlockTransactionCountByHash
Returns the number of transactions in a block by block hash.
Input:
String- Block hash
Output:
String- Transaction count as hexadecimal
Example:
eth_getBlockTransactionCountByNumber
Returns the number of transactions in a block by block number.
Input:
String- Block number or tag
Output:
String- Transaction count as hexadecimal
Example:
eth_getTransactionByHash
Returns information about a transaction by its hash.
Input:
String- Transaction hash
Output:
Object- Transaction details
Example:
eth_getTransactionByBlockHashAndIndex
Returns a transaction by block hash and index position.
Input:
String- Block hashString- Transaction index (hexadecimal)
Output:
Object- Transaction details
Example:
eth_getTransactionByBlockNumberAndIndex
Returns a transaction by block number and index position.
Input:
String- Block number or tagString- Transaction index (hexadecimal)
Output:
Object- Transaction details
Example:
eth_getTransactionReceipt
Returns the receipt of a transaction by transaction hash.
Input:
String- Transaction hash
Output:
Object- Transaction receipt
Example:
eth_getLogs
Returns logs matching a given filter object.
Input:
Object- Filter parameters (fromBlock, toBlock, address, topics)
Output:
Array- List of log entries
Note: Block range is limited to 100 blocks when rate limiting is enabled, or 10,000 blocks as a fallback cap.
Example:
eth_subscribe
Creates a subscription for real-time events (WebSocket only).
Input:
String- Subscription type:newHeadsorlogsObject- Filter parameters (forlogstype only)
Output:
String- Subscription ID
Note: Only available over WebSocket connections. HTTP calls will fail.
Example:
eth_unsubscribe
Cancels an existing subscription (WebSocket only).
Input:
String- Subscription ID
Output:
Boolean-trueif successfully unsubscribed
Example:
Network Methods
net_version
Returns the current network ID.
Input: None
Output:
String- Network ID
Example:
net_listening
Returns whether the node is actively listening for network connections.
Input: None
Output:
Boolean- Returnstrueif the node is listening for connections (hardcoded totruein current implementation)
Note: This method is not available on the public RPC endpoint.
net_peerCount
Returns the number of connected peers.
Input: None
Output:
String- Number of peers as hexadecimal
Note: This method is not available on the public RPC endpoint.
Web3 Methods
web3_clientVersion
Returns the current client version.
Input: None
Output:
String- Client version string
Example:
web3_sha3
Returns the Keccak-256 hash of the given data.
Input:
String- Data to hash (hexadecimal)
Output:
String- Keccak-256 hash
Note: This method is not available on the public RPC endpoint.
Debug Methods
debug_traceTransaction
Returns the execution trace of a transaction.
Input:
String- Transaction hashObject- Tracer options (optional). Currently only"callTracer"is supported.
Output:
Object- Execution trace
Example:
debug_traceCall
Executes a call and returns the execution trace without creating a transaction.
Input:
Object- Transaction call objectString- Block number or tagObject- Tracer options (optional). Currently only"callTracer"is supported.
Output:
Object- Execution trace
Example:
debug_traceBlockByHash
Returns traces for all transactions in a block by block hash.
Input:
String- Block hashObject- Tracer options (optional). Currently only"callTracer"is supported as the tracer type.
Output:
Array- Array of execution traces
Example:
debug_traceBlockByNumber
Returns traces for all transactions in a block by block number.
Input:
String- Block number or tagObject- Tracer options (optional). Currently only"callTracer"is supported as the tracer type.
Output:
Array- Array of execution traces
Example:
debug_getRawBlock
Returns the RLP-encoded block data.
Input:
String- Block number, block hash, or tag
Output:
String- RLP-encoded block data
Example:
debug_getRawHeader
Returns the RLP-encoded block header.
Input:
String- Block number, block hash, or tag
Output:
String- RLP-encoded header data
Example:
debug_getRawReceipts
Returns the raw receipts for a block.
Input:
String- Block number, block hash, or tag
Output:
Array- Raw receipt data
Example:
debug_getRawTransaction
Returns the raw transaction data by hash.
Input:
String- Transaction hash
Output:
String- Raw transaction data
Example:
debug_protocolVersion
Returns detailed protocol and version information.
Input: None
Output:
Object- Version information including:binaryVersion- Node binary versioncurrentSpecVersion- Current spec versioncurrentStableBlock- Current stable block numberhigherSpecVersions- Available higher spec versionsprotocolVersion- Protocol version string
Note: This method is not available on the public RPC endpoint.
Trace Methods
trace_filter
Returns traces matching a given filter.
Input:
Object- Filter parameters:fromBlock- Start block (hexadecimal)toBlock- End block (hexadecimal)fromAddress- Array of sender addresses (optional)toAddress- Array of receiver addresses (optional)count- Maximum number of traces to return (optional)after- Offset for pagination (optional)
Output:
Array- Matching traces
Note: Block range is limited to 500 blocks.
Example:
Transaction Pool Methods
txpool_nonceFrom
Returns the next nonce for an address from the transaction pool.
Input:
String- Address
Output:
String- Nonce as hexadecimal
Note: This method is not available on the public RPC endpoint.
Pharos Extension Methods
eth_getAccount
Returns account information at a given address (EIP-7587).
Input:
String- Address to queryString- Block number or tag
Output:
Object- Account details including balance, nonce, codeHash, and storageRoot
Example:
eth_getProposerByTxHash
Returns the block proposer for a given transaction.
Input:
String- Transaction hash
Output:
Object- Proposer information
Note: This method is not available on the public RPC endpoint.
eth_getProposersByBlockNumber
Returns the list of proposers for a given block.
Input:
String- Block number or tag
Output:
Array- List of proposer addresses
Note: This method is not available on the public RPC endpoint.
Pharos Debug Extensions
These are Pharos-specific debug methods that extend the standard debug namespace.
debug_getValidatorInfo
Returns validator information for the consensus layer.
Input:
String- Block number or tag (optional)
Output:
Object- Validator details
Example:
debug_getBlockProof
Returns the block proof data for BLS signature verification. See the BLS Verification Demo for usage examples.
Input:
String- Block number or tag
Output:
Object- Block proof including BLS signatures
Example:
debug_getBlockReadStates
Returns the read state set for a block.
Input:
String- Block number or tag
Output:
Object- Read state data
Note: This method is only available on internal debug endpoints.
debug_getBlockWriteStates
Returns the write state set for a block.
Input:
String- Block number or tag
Output:
Object- Write state data
Note: This method is only available on internal debug endpoints.
debug_getBlockWriteSetKeys
Returns the write set keys for a block.
Input:
String- Block number or tag
Output:
Array- Write set keys
Note: This method is only available on internal debug endpoints.
PoW Compatibility Methods (Deprecated)
These methods exist for Ethereum compatibility but return placeholder values since Pharos uses PoS consensus.
eth_coinbase
"0x0"
No mining reward address in PoS
eth_mining
false
Validators produce blocks, not miners
eth_hashrate
"0x0"
No hashrate in PoS
eth_accounts
[]
Node does not manage accounts
eth_pendingTransactions
[]
Returns empty array
eth_getCompilers
[]
Deprecated
eth_getUncleCountByBlockHash
null
Uncles are a PoW concept
eth_getUncleCountByBlockNumber
null
Uncles are a PoW concept
eth_getUncleByBlockHashAndIndex
null
Uncles are a PoW concept
eth_getUncleByBlockNumberAndIndex
null
Uncles are a PoW concept
Not Implemented Methods
The following methods are declared but not implemented. Calling them returns METHOD_NOT_FOUND:
eth_batchGetBlockByNumbereth_batchGetTransactionByHasheth_batchGetTransactionReceipteth_batchGetBlockReceipts
Notes
WebSocket:
eth_subscribeandeth_unsubscriberequire a WebSocket connection. Supported subscription types:newHeads,logs.Block Tags: Supported values:
latest,earliest,pending,safe,finalized, or a specific block number in hexadecimal.EIP Support: EIP-1559 (fee market), EIP-2930 (access lists), EIP-1186 (eth_getProof) are fully supported.
Rate Limiting:
eth_getLogsrange is limited to 100 blocks (with rate limiting) or 10,000 blocks (fallback).trace_filteris limited to 500 blocks.
Last updated
Was this helpful?
