Skip to content

Commit 6f4a89f

Browse files
committed
Add non-admin feature RPC
1 parent b3e9c1b commit 6f4a89f

File tree

2 files changed

+166
-0
lines changed

2 files changed

+166
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
---
2+
html: feature.html
3+
parent: server-info-methods.html
4+
seo:
5+
description: Get information about protocol amendments.
6+
labels:
7+
- Blockchain
8+
- Core Server
9+
---
10+
11+
# feature
12+
13+
[[Source]](https://github.com/XRPLF/rippled/blob/master/src/ripple/rpc/handlers/Feature1.cpp "Source")<br/>
14+
15+
The `feature` command returns information about [amendments](../../../../concepts/networks-and-servers/amendments.md) this server knows about, including whether they are enabled and if the server knows how to apply the amendments.
16+
17+
This is the non-admin version of the [`feature` admin command](../../admin-api-methods/status-and-debugging-methods/feature.md). It follows the same formatting as the _admin_ command, but hides potentially sensitive data.
18+
19+
{% badge href="https://github.com/XRPLF/rippled/releases/tag/2.2.0" %}New in: rippled 2.2.0{% /badge %}
20+
21+
## Request Format
22+
23+
An example of the request format:
24+
25+
{% tabs %}
26+
27+
{% tab label="WebSocket" %}
28+
```json
29+
{
30+
"id": "list_all_features",
31+
"command": "feature"
32+
}
33+
```
34+
{% /tab %}
35+
36+
{% tab label="JSON-RPC" %}
37+
```json
38+
{
39+
"method": "feature",
40+
"params": [
41+
{
42+
"feature": "4C97EBA926031A7CF7D7B36FDE3ED66DDA5421192D63DE53FFB46E43B9DC8373"
43+
}
44+
]
45+
}
46+
```
47+
{% /tab %}
48+
49+
{% tab label="Commandline" %}
50+
```sh
51+
#Syntax: feature [<feature_id>]
52+
rippled feature 4C97EBA926031A7CF7D7B36FDE3ED66DDA5421192D63DE53FFB46E43B9DC8373
53+
```
54+
{% /tab %}
55+
56+
{% /tabs %}
57+
58+
{% try-it method="feature" /%}
59+
60+
The request includes the following parameters:
61+
62+
| `Field` | Type | Description |
63+
|:----------|:--------|:-------------------------------------------------------|
64+
| `feature` | String | _(Optional)_ The unique ID of an amendment, as hexadecimal; or the short name of the amendment. If provided, limits the response to one amendment. Otherwise, the response lists all amendments. |
65+
66+
## Response Format
67+
68+
An example of a successful response:
69+
70+
{% tabs %}
71+
72+
{% tab label="WebSocket" %}
73+
```json
74+
{
75+
"id": "list_all_features",
76+
"result": {
77+
"features": {
78+
"00C1FC4A53E60AB02C864641002B3172F38677E29C26C5406685179B37E1EDAC": {
79+
"enabled": true,
80+
"name": "RequireFullyCanonicalSig",
81+
"supported": true
82+
},
83+
"0285B7E5E08E1A8E4C15636F0591D87F73CB6A7B6452A932AD72BBC8E5D1CBE3": {
84+
"enabled": false,
85+
"name": "fixNFTokenDirV1",
86+
"supported": true
87+
},
88+
"03BDC0099C4E14163ADA272C1B6F6FABB448CC3E51F522F978041E4B57D9158C": {
89+
"enabled": true,
90+
"name": "fixNFTokenReserve",
91+
"supported": true
92+
},
93+
"07D43DCE529B15A10827E5E04943B496762F9A88E3268269D69C44BE49E21104": {
94+
"enabled": false,
95+
"name": "Escrow",
96+
"supported": true
97+
},
98+
"08DE7D96082187F6E6578530258C77FAABABE4C20474BDB82F04B021F1A68647": {
99+
"enabled": false,
100+
"name": "PayChan",
101+
"supported": true
102+
}
103+
}
104+
},
105+
"status": "success",
106+
"type": "response"
107+
}
108+
```
109+
{% /tab %}
110+
111+
{% tab label="JSON-RPC" %}
112+
```json
113+
200 OK
114+
115+
{
116+
"result": {
117+
"4C97EBA926031A7CF7D7B36FDE3ED66DDA5421192D63DE53FFB46E43B9DC8373": {
118+
"enabled": false,
119+
"name": "MultiSign",
120+
"supported": true
121+
},
122+
"status": "success"
123+
}
124+
}
125+
```
126+
{% /tab %}
127+
128+
{% tab label="Commandline" %}
129+
```json
130+
Loading: "/etc/rippled.cfg"
131+
Connecting to 127.0.0.1:5005
132+
133+
{
134+
"result": {
135+
"4C97EBA926031A7CF7D7B36FDE3ED66DDA5421192D63DE53FFB46E43B9DC8373": {
136+
"enabled": false,
137+
"name": "MultiSign",
138+
"supported": true
139+
},
140+
"status": "success"
141+
}
142+
}
143+
```
144+
{% /tab %}
145+
146+
{% /tabs %}
147+
148+
The response follows the [standard format][], with a successful result containing **a map of amendments** as a JSON object. The keys of the object are amendment IDs. The values for each key are _amendment objects_ that describe the status of the amendment with that ID. If the request specified a `feature`, the map contains only the requested amendment object, after applying any changes from the request. Each amendment object has the following fields:
149+
150+
| `Field` | Type | Description |
151+
|:------------|:--------|:-----------------------------------------------------|
152+
| `enabled` | Boolean | Whether this amendment is currently enabled in the latest ledger. |
153+
| `name` | String | (May be omitted) The human-readable name for this amendment, if known. |
154+
| `supported` | Boolean | Whether the server knows how to apply this amendment. If this field is set to `false` (the server does not know how to apply this amendment) and `enabled` is set to `true` (this amendment is enabled in the latest ledger), this amendment may cause your server to be [amendment blocked](../../../../concepts/networks-and-servers/amendments.md#amendment-blocked-servers). |
155+
156+
{% admonition type="warning" name="Caution" %}The `name` for an amendment does not strictly indicate what that amendment does. The name is not guaranteed to be unique or consistent across servers.{% /admonition %}
157+
158+
## Possible Errors
159+
160+
- Any of the [universal error types][].
161+
- `badFeature` - The `feature` specified was invalidly formatted, or the server does not know an amendment with that name.
162+
- `noPermission` - The user does not have permission to run the specified command (i.e., `vetoed`).
163+
- `reportingUnsupported` - ([Reporting Mode][] servers only) This method is not available in Reporting Mode.
164+
165+
{% raw-partial file="/docs/_snippets/common-links.md" /%}

sidebars.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,7 @@
527527
- page: docs/references/http-websocket-apis/public-api-methods/server-info-methods/server_info.md
528528
- page: docs/references/http-websocket-apis/public-api-methods/server-info-methods/server_state.md
529529
- page: docs/references/http-websocket-apis/public-api-methods/server-info-methods/version.md
530+
- page: docs/references/http-websocket-apis/public-api-methods/server-info-methods/feature.md
530531

531532
- page: docs/references/http-websocket-apis/public-api-methods/clio-methods/index.md
532533
expanded: false

0 commit comments

Comments
 (0)