getnettotals - Litecoin

Example code for the getnettotals JSON-RPC method. Complete guide on how to use getnettotals JSON-RPC in GetBlock Web3 documentation.

Returns information about network traffic, including bytes in, bytes out, and current time.

Parameters

  • None

Request

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "getnettotals",
    "params": [],
    "id": "getblock.io"
}'

Response

{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": {
        "totalbytesrecv": 1234567890,
        "totalbytessent": 987654321,
        "timemillis": 1640000000000,
        "uploadtarget": {
            "timeframe": 86400,
            "target": 0,
            "target_reached": false,
            "serve_historical_blocks": true,
            "bytes_left_in_cycle": 0,
            "time_left_in_cycle": 0
        }
    }
}

Response Parameters

Field
Type
Description

totalbytesrecv

number

Total bytes received.

totalbytessent

number

Total bytes sent.

timemillis

number

Current UNIX time in milliseconds.

Use Cases

  • Bandwidth monitoring

  • Network statistics

  • Traffic analysis

  • Resource monitoring

Error Handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid ACCESS-TOKEN.

Integration Notes

The getnettotals method helps developers build robust applications that interact with the Litecoin blockchain.

Last updated

Was this helpful?