For the complete documentation index, see llms.txt. This page is also available as Markdown.

getdifficulty - Litecoin

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

Returns the proof-of-work difficulty as a multiple of the minimum difficulty.

Parameters

  • None

Request

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

const data = JSON.stringify({
    "jsonrpc": "2.0",
    "method": "getdifficulty",
    "params": [],
    "id": "getblock.io"
});

const config = {
    method: 'post',
    url: 'https://go.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));

Response

response.json
{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": 12345678.90123456
}

Response Parameters

Field
Type
Description

result

number

The current difficulty.

Use Case

The getdifficulty method is essential for:

  • Mining difficulty monitoring

  • Network hashrate estimation

  • Mining profitability analysis

  • Historical difficulty tracking

Error Handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid ACCESS-TOKEN.

Integration Notes

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

Last updated

Was this helpful?