1
0
Fork 0
mirror of https://github.com/bitcoin/bips.git synced 2025-03-04 03:03:53 +01:00

Add example commands

This commit is contained in:
Ben van Hartingsveldt 2024-05-10 22:33:23 +02:00
parent b5a9b10216
commit 19cf447939
No known key found for this signature in database
GPG key ID: 261AA214130CE7AB

View file

@ -203,6 +203,113 @@ Send the version of the client to the server. This command doesn't expect a resp
| The client version.
|}
===Service: Example===
This service is an example service. It doesn't have any other purpose than testing.
* Service name: <code>example</code>
* Service vendor: <code>Stratum</code>
====Method: Hello World====
Ask the server to send a "Hello world!" back.
* Method name: <code>hello_world</code>
{|
! <ins>[Request]</ins>
! Type
! Example
! Description
|-
! Method
| colspan="3" | <code>example.hello_world</code>
|-
! <ins>[Response]</ins>
! Type
! Example
! Description
|-
! Result
| <code>string</code>
| <code>Hello world!</code>
| The "Hello world" text.
|}
====Method: Ping====
Ping the server and get a pong back with the same text.
* Method name: <code>ping</code>
{|
! <ins>[Request]</ins>
! Type
! Example
! Description
|-
! Method
| colspan="3" | <code>example.ping</code>
|-
! Params [0] (<code>payload</code>)
| <code>mixed</code>
| <code>12345678</code>
| The ping text.
|-
! <ins>[Response]</ins>
! Type
! Example
! Description
|-
! Result
| <code>string</code>
| <code>Hello world!</code>
| The "Hello world" text.
|}
====Method: Synchronous====
Ask the server to run a synchronous command for a specific amount of seconds.
* Method name: <code>synchronous</code>
====Method: Throw Exception====
Ask the server throw exception.
* Method name: <code>throw_exception</code>
====Method: Throw Signed Exception====
Ask the server throw signed exception.
* Method name: <code>throw_signed_exception</code>
===Service: Example Publish-Subscribe===
This service is an example service. It doesn't have any other purpose than testing.
* Service name: <code>example.pubsub</code>
* Service vendor: <code>Stratum</code>
====Method: Subscribe====
Subscribe on an event.
* Method name: <code>subscribe</code>
====Method: Time Event====
The time event that gets emitted.
* Method name: <code>time_event</code>
====Method: Unsubscribe====
Unsubscribe from an event.
* Method name: <code>unsubscribe</code>
===Service: Server===
* Service name: <code>server</code>
@ -251,7 +358,7 @@ This document serves as the specification for the media type "application/stratu
IANA maintains the registry of WebSocket Subprotocol Names at https://www.iana.org/assignments/websocket.
This document serves as the specification for the subprotocol name "stratum". It has been registered with IANA.
This document serves as the specification for the WebSocket subprotocol name "stratum". It has been registered with IANA.
==References==
<references/>