Server API

import {JsonRpcClient} from '@defichain/jellyfish-api-jsonrpc'
const client = new JsonRpcClient('http://foo:bar@localhost:8554')

// Using client.server.
const something = await client.server.method()

getRpcInfo

Returns details of the RPC server.

  • active_commands a list of active commands
  • logpath the complete path to the debug log
interface server {
  getRpcInfo (): Promise<RpcInfo>
}

interface RpcInfo {
  active_commands: ActiveCommand[]
  logpath: string
}

interface ActiveCommand {
  method: string
  duration: number
}

uptime

Returns the total uptime of the server in seconds.

interface server {
  uptime (): Promise<number>
}