Skip to content

Instantly share code, notes, and snippets.

@frozeman
Last active May 17, 2017 14:37
Show Gist options
  • Save frozeman/80723fe0785d97b1d67a65103f336a7f to your computer and use it in GitHub Desktop.
Save frozeman/80723fe0785d97b1d67a65103f336a7f to your computer and use it in GitHub Desktop.
Whisper API spec

Whisper API 5.0

This is the proposed API for whisper v5.

Specs

shh_version

Returns the current semver version number.

Parameters

none

Returns

String - The semver version number.

Example
// Request
curl -X POST --data '{"jsonrpc":"2.0","method":"shh_version","params":[],"id":1}'

// Result
{
  "id":1,
  "jsonrpc": "2.0",
  "result": "5.0.0"
}

shh_info

Returns diagnostic information about the whisper node.

Parameters

none

Returns

Object - diagnostic information with the following properties:

  • memory - Number: Memory size of the floating messages in bytes.
  • message - Number: Number of floating messages.
Example
// Request
curl -X POST --data '{"jsonrpc":"2.0","method":"shh_info","params":[],"id":1}'

// Result
{
  "id":1,
  "jsonrpc": "2.0",
  "result": {
    "memory": 10000,
    "messages": 20
  }
}

shh_setMaxMessageLength

Sets the maximal message length allowed by this node. This rejects incoming and outgoing messages with a size larger than set by this function.

Parameters
  1. Number: Message size in bytes.
Returns

Boolean - true on success and an error on failure.

Example
// Request
curl -X POST --data '{"jsonrpc":"2.0","method":"shh_setMaxMessageLength","params":[234567],"id":1}'

// Result
{
  "id":1,
  "jsonrpc": "2.0",
  "result": true
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment