serverVersion

Rostrum Electrum for Bitcoin Cash

Overview

The server.version method allows a client to identify itself to the server and negotiate the protocol version. It is important that only the first server.version message is accepted by the server after connection establishment.

Parameters

NameTypeRequiredDescription
client_namestringYesA string identifying the connecting client software.
protocol_versionmixedYesAn array [protocol_min, protocol_max] or a single string for equal values.

Returns

Upon a successful request, the server responds with the negotiated protocol version and server information. The response's result field contains an array with two elements:

FieldDescription
Server NameThe name and version of the Rostrum server.
ProtocolThe negotiated protocol version between client and server.

Example response

{
    "result": [
        "Rostrum 10.0.0",
        "1.4"
    ]
}

Request Example

curl --location 'https://api.tatum.io/v3/blockchain/node/rostrum-mainnet/' \
--header 'Content-Type: application/json' \
--header 'x-api-key: {API_KEY}' \
--data '{
    "method": "server.version",
    "params": ["TatumClient", "1.4"],
    "id": 1,
    "jsonrpc": "2.0"
}'
// yarn add @tatumio/tatum

import { TatumSDK, Rostrum, Network } from "@tatumio/tatum";

const rostrum = await TatumSDK.init<RostrumElectrum>({ network: Network.ROSTRUM_MAINNET });


const serverVersion = await tatum.rpc.getServerVersion({
  client_name: "TatumClient",
  protocol_version: "1.4"
});

console.log(serverVersion);

await rostrum.destroy(); // Destroy Tatum SDK - needed for stopping background jobs