Skip to content

Commit eb21022

Browse files
authored
Rename standard RPCs to look more RESTful. (#1290)
1 parent 5b5c284 commit eb21022

38 files changed

+170
-180
lines changed

doc/members/accept_recovery.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,28 +42,28 @@ To restore private transactions and complete the recovery procedure, members sho
4242

4343
.. note:: The members who submit their recovery shares do not necessarily have to be the members who previously accepted the recovery.
4444

45-
First, members should retrieve their encrypted recovery shares via the ``getEncryptedRecoveryShare`` RPC [#recovery_share]_.
45+
First, members should retrieve their encrypted recovery shares via the ``recovery_share`` RPC [#recovery_share]_.
4646

4747
.. code-block:: bash
4848
49-
$ curl https://<ccf-node-address>/members/getEncryptedRecoveryShare -X GET --cacert network_cert --key member1_privk --cert member1_cert -H "content-type: application/json"
49+
$ curl https://<ccf-node-address>/members/recovery_share -X GET --cacert network_cert --key member1_privk --cert member1_cert -H "content-type: application/json"
5050
5151
Then, members should decrypt their shares using their private encryption key and the `previous` network public encryption key (output by the first node of the now-defunct service via the ``network-enc-pubk-file`` :ref:`command line option <operators/start_network:Starting the First Node>`) using `NaCl's public-key authenticated encryption <https://nacl.cr.yp.to/box.html>`_.
5252

53-
Finally, members should submit their decrypted share to CCF via the ``submitRecoveryShare`` RPC:
53+
Finally, members should submit their decrypted share to CCF via the ``recovery_share/submit`` RPC:
5454

5555
.. code-block:: bash
5656
5757
$ cat submit_recovery_share.json
5858
{"recovery_share": [<recovery_share_bytes>]}
5959
60-
$ curl https://<ccf-node-address>/members/submitRecoveryShare -X POST --data-binary @submit_recovery_share.json --cacert network_cert --key member1_privk --cert member1_cert -H "content-type: application/json"
60+
$ curl https://<ccf-node-address>/members/recovery_share/submit -X POST --data-binary @submit_recovery_share.json --cacert network_cert --key member1_privk --cert member1_cert -H "content-type: application/json"
6161
false
6262
63-
$ curl https://<ccf-node-address>/members/submitRecoveryShare -X POST --data-binary @submit_recovery_share.json --cacert network_cert --key member2_privk --cert member2_cert -H "content-type: application/json"
63+
$ curl https://<ccf-node-address>/members/recovery_share/submit -X POST --data-binary @submit_recovery_share.json --cacert network_cert --key member2_privk --cert member2_cert -H "content-type: application/json"
6464
true
6565
66-
When the recovery threshold is reached, the ``submitRecoveryShare`` RPC returns ``true``. At this point, the private recovery procedure is started and the private ledger is being recovered.
66+
When the recovery threshold is reached, the ``recovery_share/submit`` RPC returns ``true``. At this point, the private recovery procedure is started and the private ledger is being recovered.
6767

6868
.. note:: While all nodes are recovering the private ledger, no new transaction can be executed by the network.
6969

@@ -91,16 +91,16 @@ Summary Diagram
9191
Node 2-->>Member 1: State: ACCEPTED
9292
Note over Node 2, Node 3: accept_recovery proposal completes. Service is ready to accept recovery shares.
9393

94-
Member 0->>+Node 2: getEncryptedRecoveryShare
94+
Member 0->>+Node 2: recovery_share
9595
Node 2-->>Member 0: Encrypted recovery share for Member 0
9696
Note over Member 0: Decrypts recovery share
97-
Member 0->>+Node 2: submitRecoveryShare: {"recovery_share": ...}
97+
Member 0->>+Node 2: recovery_share/submit: {"recovery_share": ...}
9898
Node 2-->>Member 0: False
9999

100-
Member 1->>+Node 2: getEncryptedRecoveryShare
100+
Member 1->>+Node 2: recovery_share
101101
Node 2-->>Member 1: Encrypted recovery share for Member 1
102102
Note over Member 1: Decrypts recovery share
103-
Member 1->>+Node 2: submitRecoveryShare: {"recovery_share": ...}
103+
Member 1->>+Node 2: recovery_share/submit: {"recovery_share": ...}
104104
Node 2-->>Member 1: True
105105

106106
Note over Node 2, Node 3: Reading Private Ledger...

doc/members/adding_member.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ Activating a New Member
3939

4040
A new member who gets registered in CCF is not yet able to participate in governance operations. To do so, the new member should first acknowledge that they are satisfied with the state of the service (for example, after auditing the current constitution and the nodes currently trusted).
4141

42-
First, the new member should update and retrieve the latest state digest via the ``members/updateAckStateDigest`` command. In doing so, the new member confirms that they are satisfied with the current state of the service.
42+
First, the new member should update and retrieve the latest state digest via the ``members/ack/update_state_digest`` command. In doing so, the new member confirms that they are satisfied with the current state of the service.
4343

4444
.. code-block:: bash
4545
46-
$ curl https://<ccf-node-address>/members/updateAckStateDigest --cacert networkcert.pem --key new_member_privk.pem --cert new_member_cert.pem
46+
$ curl https://<ccf-node-address>/members/ack/update_state_digest --cacert networkcert.pem --key new_member_privk.pem --cert new_member_cert.pem
4747
{
4848
"state_digest": <...>
4949
}
5050
5151
52-
Then, the new member should sign the state digest returned by the ``members/updateAckStateDigest`` via the ``members/ack`` command, using the ``scurl.sh`` utility:
52+
Then, the new member should sign the state digest returned by the ``members/ack/update_state_digest`` via the ``members/ack`` command, using the ``scurl.sh`` utility:
5353

5454
.. code-block:: bash
5555

doc/members/member_rpc_api.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ read
4343
.. literalinclude:: ../schemas/read_result.json
4444
:language: json
4545

46-
updateAckStateDigest
46+
ack/update_state_digest
4747
--------------------
4848

49-
.. literalinclude:: ../schemas/updateAckStateDigest_result.json
49+
.. literalinclude:: ../schemas/ack/update_state_digest_result.json
5050
:language: json
5151

5252
vote
@@ -65,16 +65,16 @@ withdraw
6565
.. literalinclude:: ../schemas/withdraw_result.json
6666
:language: json
6767

68-
getEncryptedRecoveryShare
68+
recovery_share
6969
-------------------------
7070

71-
.. literalinclude:: ../schemas/getEncryptedRecoveryShare_result.json
71+
.. literalinclude:: ../schemas/recovery_share_result.json
7272
:language: json
7373

74-
submitRecoveryShare
74+
recovery_share/submit
7575
-------------------
7676

77-
.. literalinclude:: ../schemas/submitRecoveryShare_params.json
77+
.. literalinclude:: ../schemas/recovery_share/submit_params.json
7878
:language: json
79-
.. literalinclude:: ../schemas/submitRecoveryShare_result.json
79+
.. literalinclude:: ../schemas/recovery_share/submit_result.json
8080
:language: json

doc/operators/operator_rpc_api.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ Operator RPC API
33

44
As well as the following methods, :ref:`users/rpc_api:Common Methods` are also available to operators.
55

6-
getQuote
7-
--------
6+
quote
7+
-----
88

99
Retrieves quote of single contacted node.
1010

11-
.. literalinclude:: ../schemas/getQuote_result.json
11+
.. literalinclude:: ../schemas/quote_result.json
1212
:language: json
1313

1414
Example
@@ -26,12 +26,12 @@ Example
2626
]
2727
}
2828
29-
getQuotes
30-
---------
29+
quotes
30+
------
3131

3232
Retrieves quotes of all trusted nodes.
3333

34-
.. literalinclude:: ../schemas/getQuotes_result.json
34+
.. literalinclude:: ../schemas/quotes_result.json
3535
:language: json
3636

3737
Example
@@ -54,8 +54,8 @@ Example
5454
]
5555
}
5656
57-
getSignedIndex
58-
--------------
57+
signed_index
58+
------------
5959

6060
.. literalinclude:: ../schemas/getSignedIndex_result.json
6161
:language: json

doc/operators/recovery.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ To initiate the first phase of the recovery procedure, one or several nodes shou
3131
recover
3232
--network-cert-file /path/to/network_certificate
3333
34-
Each node will then immediately restore the public entries of its ledger (``--ledger-dir``). Because deserialising the public entries present in the ledger may take some time, operators can query the progress of the public recovery by calling ``getSignedIndex`` which returns the version of the last signed recovered ledger entry. Once the public ledger is fully recovered, the recovered node automatically becomes part of the public network, allowing other nodes to join the network.
34+
Each node will then immediately restore the public entries of its ledger (``--ledger-dir``). Because deserialising the public entries present in the ledger may take some time, operators can query the progress of the public recovery by calling ``signed_index`` which returns the version of the last signed recovered ledger entry. Once the public ledger is fully recovered, the recovered node automatically becomes part of the public network, allowing other nodes to join the network.
3535

36-
.. note:: If more than one node were started in ``recover`` mode, the node with the highest signed index (as per the response to the ``getSignedIndex`` RPC) should be preferred to start the new network. Other nodes should be shutdown and new nodes restarted with the ``join`` option.
36+
.. note:: If more than one node were started in ``recover`` mode, the node with the highest signed index (as per the response to the ``signed_index`` RPC) should be preferred to start the new network. Other nodes should be shutdown and new nodes restarted with the ``join`` option.
3737

3838
Similarly to the normal join protocol (see :ref:`operators/start_network:Adding a New Node to the Network`), other nodes are then able to join the network.
3939

@@ -48,10 +48,10 @@ Similarly to the normal join protocol (see :ref:`operators/start_network:Adding
4848
Node 2-->>Operators: Network Certificate
4949
Note over Node 2: Reading Public Ledger...
5050

51-
Operators->>+Node 2: getSignedIndex
51+
Operators->>+Node 2: signed_index
5252
Node 2-->>Operators: {"signed_index": 50, "state": "readingPublicLedger"}
5353
Note over Node 2: Finished Reading Public Ledger, now Part of Public Network
54-
Operators->>Node 2: getSignedIndex
54+
Operators->>Node 2: signed_index
5555
Node 2-->>Operators: {"signed_index": 243, "state": "partOfPublicNetwork"}
5656

5757
Note over Operators, Node 2: Operators select Node 2 to start the new network

doc/schemas/updateAckStateDigest_result.json renamed to doc/schemas/ack/update_state_digest_result.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
"required": [
1414
"state_digest"
1515
],
16-
"title": "updateAckStateDigest/result",
16+
"title": "ack/update_state_digest/result",
1717
"type": "object"
1818
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
"required": [
99
"method"
1010
],
11-
"title": "getSchema/params",
11+
"title": "api/schema/params",
1212
"type": "object"
1313
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
"params_schema",
1313
"result_schema"
1414
],
15-
"title": "getSchema/result",
15+
"title": "api/schema/result",
1616
"type": "object"
1717
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
"required": [
1212
"methods"
1313
],
14-
"title": "listMethods/result",
14+
"title": "api/result",
1515
"type": "object"
1616
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@
4040
"histogram",
4141
"tx_rates"
4242
],
43-
"title": "getMetrics/result",
43+
"title": "metrics/result",
4444
"type": "object"
4545
}

0 commit comments

Comments
 (0)