Skip to content

Commit d32a69e

Browse files
committed
add "method_flavours" to "server.features"
1 parent bd57d96 commit d32a69e

File tree

1 file changed

+43
-3
lines changed

1 file changed

+43
-3
lines changed

docs/protocol-methods.rst

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Return the block header at the given height.
1414
.. versionchanged:: 1.4
1515
*cp_height* parameter added
1616
.. versionchanged:: 1.4.1
17+
.. versionchanged:: 1.6
18+
*cp_height* support made optional
1719

1820
*height*
1921

@@ -26,6 +28,10 @@ Return the block header at the given height.
2628

2729
*height* <= *cp_height*
2830

31+
The server CAN decide not to support a non-zero cp_height value, but if so,
32+
it MUST indicate that in its :func:`server.features` response by setting
33+
`method_flavours["blockchain.block.header"]["supports_cp_height"]=false`.
34+
2935
**Result**
3036

3137
If *cp_height* is zero, the raw block header as a hexadecimal
@@ -87,6 +93,7 @@ Return a chunk of block headers from the main chain.
8793
.. versionchanged:: 1.4.1
8894
.. versionchanged:: 1.6
8995
response contains *headers* field instead of *hex*
96+
*cp_height* support made optional
9097

9198
*start_height*
9299

@@ -103,6 +110,11 @@ Return a chunk of block headers from the main chain.
103110

104111
*start_height* + (*count* - 1) <= *cp_height*
105112

113+
The server CAN decide not to support a non-zero cp_height value, but if so,
114+
it MUST indicate that in its :func:`server.features` response by setting
115+
`method_flavours["blockchain.block.header"]["supports_cp_height"]=false`.
116+
(the flavour key `"blockchain.block.header"` is reused with the other header method).
117+
106118
**Result**
107119

108120
A dictionary with the following members:
@@ -562,8 +574,8 @@ as an input (spends it).
562574
the outpoint. The behaviour is undefined if an incorrect value is provided.
563575
The server (especially lighter ones such as EPS/BWT) might require this parameter
564576
to be able to serve the request, in which case the server must indicate so in its
565-
:func:`server.features` response, by including an `requires_spk_hint_for_outpoint` key
566-
with value `1`.
577+
:func:`server.features` response, by setting
578+
`method_flavours["blockchain.outpoint.subscribe"]["requires_spk_hint"]=true`.
567579

568580
.. note:: The server MAY automatically clean up subscriptions (unsubscribe the client)
569581
where the spending transaction is already deeply mined at a reorg-safe height (typically
@@ -773,6 +785,10 @@ with the child being the last element in the array.
773785
*verbose*
774786

775787
Whether a verbose coin-specific response is required.
788+
The server MUST support the verbose=false option (which is the default).
789+
The server CAN decide not to support the verbose=true option, but if so,
790+
it MUST indicate that in its :func:`server.features` response by setting
791+
`method_flavours["blockchain.transaction.broadcast_package"]["supports_verbose_true"]=false`.
776792

777793
**Result**
778794

@@ -855,6 +871,8 @@ Return a raw transaction.
855871
ignored argument *height* removed
856872
.. versionchanged:: 1.2
857873
*verbose* argument added
874+
.. versionchanged:: 1.6
875+
support of *verbose=true* made optional
858876

859877
*tx_hash*
860878

@@ -863,6 +881,10 @@ Return a raw transaction.
863881
*verbose*
864882

865883
Whether a verbose coin-specific response is required.
884+
The server MUST support the verbose=false option (which is the default).
885+
The server CAN decide not to support the verbose=true option, but if so,
886+
it MUST indicate that in its :func:`server.features` response by setting
887+
`method_flavours["blockchain.transaction.get"]["supports_verbose_true"]=false`.
866888

867889
**Result**
868890

@@ -1162,6 +1184,8 @@ Return a list of features and services supported by the server.
11621184
**Signature**
11631185

11641186
.. function:: server.features()
1187+
.. versionchanged:: 1.6
1188+
added *method_flavours* field to result
11651189

11661190
**Result**
11671191

@@ -1223,6 +1247,18 @@ Return a list of features and services supported by the server.
12231247
there is no pruning limit. Should be the same as what would
12241248
suffix the letter ``p`` in the IRC real name.
12251249

1250+
* *method_flavours*
1251+
1252+
A dictionary that describes whether optional features of certain protocol methods
1253+
are supported by the server. The server might also require an otherwise optional
1254+
argument to be set by the client, that too should be clearly advertised here.
1255+
The keys are protocol method name strings, and the values are dictionaries
1256+
that are specific to the given protocol method.
1257+
1258+
If a server supports all functionality defined for the negotiated protocol version,
1259+
it can just set this to the empty dict (but the `method_flavours` key itself
1260+
must always be present).
1261+
12261262
**Example Result**
12271263

12281264
::
@@ -1234,7 +1270,11 @@ Return a list of features and services supported by the server.
12341270
"protocol_min": "1.0",
12351271
"pruning": null,
12361272
"server_version": "ElectrumX 1.0.17",
1237-
"hash_function": "sha256"
1273+
"hash_function": "sha256",
1274+
"method_flavours": {
1275+
"blockchain.outpoint.subscribe": {"requires_spk_hint": true},
1276+
"blockchain.transaction.get": {"supports_verbose_true": false}
1277+
}
12381278
}
12391279

12401280

0 commit comments

Comments
 (0)