Skip to content

Commit cb49a47

Browse files
committed
docs(rpc): add get_network_pubkey; correct availability, ports; mark start_dkg/reset_network as not exposed
1 parent 6ba4cc1 commit cb49a47

File tree

5 files changed

+65
-101
lines changed

5 files changed

+65
-101
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# `get_network_pubkey`
2+
3+
**Description:** Returns the current network verifying key as a hex string.
4+
5+
- In `validator`, this is the FROST group verifying key managed by the node's key manager.
6+
- In `local_validator`, this returns the local validator's x-only public key used for development.
7+
8+
**Method:** `POST`
9+
10+
**Parameters:** None.
11+
12+
**Returns:** Hex-encoded verifying key string.
13+
14+
**Request:**
15+
```bash
16+
curl -vL POST -H 'Content-Type: application/json' -d '
17+
{
18+
"jsonrpc":"2.0",
19+
"id":1,
20+
"method":"get_network_pubkey",
21+
"params":[]
22+
}' \
23+
http://localhost:9002/
24+
```
25+
26+
**Response:**
27+
```json
28+
{
29+
"jsonrpc": "2.0",
30+
"result": "c0ffee00c0ffee00c0ffee00c0ffee00c0ffee00c0ffee00c0ffee00c0ffee00",
31+
"id": "1"
32+
}
33+
```
34+
35+
**Notes:**
36+
- Available in both `validator` and `local_validator`.
37+
- No parameters are required.
Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,3 @@
1-
# `resetNetwork`
2-
3-
> ⚠️ Note:
4-
>
5-
> _This method is only callable by the Leader node, which for the time being will be Arch. This method is used for internal debugging purposes as we get the Testnet operational._
6-
>
7-
> This endpoint is also not available for local validators.
8-
9-
**Description:** Resets the network state.
10-
11-
**Parameters:**
12-
None.
13-
14-
**Returns:** A success message if the network reset is successful.
15-
16-
**Request:**
17-
```bash
18-
curl -vL POST -H 'Content-Type: application/json' -d '
19-
{
20-
"jsonrpc":"2.0",
21-
"id":1,
22-
"method":"reset_network",
23-
"params":[]
24-
}' \
25-
http://localhost:9002/
26-
```
27-
28-
**Response:**
29-
```json
30-
{
31-
"jsonrpc": "2.0",
32-
"result": "Success!",
33-
"id": "1"
34-
}
35-
```
1+
# `reset_network` (not currently exposed)
362

3+
This endpoint is not currently exposed by the validator's RPC server. It may appear in older docs but is unavailable in the running node.

src/rpc/http-methods/start-dkg.md

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,5 @@
1-
# `startDkg`
1+
# `start_dkg` (not currently exposed)
22

3-
> ️️⚠️ Note: This endpoint is not available for local validators.
4-
5-
**Description:** Initiates the Distributed Key Generation (DKG) process.
6-
7-
**Method:** `POST`
8-
9-
**Parameters:**
10-
None.
11-
12-
**Returns:** A success message if the DKG process is initiated.
13-
14-
**Request:**
15-
```bash
16-
curl -vL POST -H 'Content-Type: application/json' -d '
17-
{
18-
"jsonrpc":"2.0",
19-
"id":1,
20-
"method":"start_dkg",
21-
"params":[]
22-
}' \
23-
http://localhost:9002/
24-
```
25-
26-
**Response:**
27-
```json
28-
{
29-
"jsonrpc": "2.0",
30-
"result": "DKG process initiated",
31-
"id": "1"
32-
}
33-
```
3+
This endpoint is not currently exposed by the validator's RPC server. It may appear in older docs or client stubs but is unavailable in the running node.
344

5+
Use `get_network_pubkey` to retrieve the network verifying key. No replacement RPC exists for starting DKG via public API.

src/rpc/rpc-method-availability.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ The following RPC methods are available in both `validator` and `local_validator
2828
- `get_transactions_by_block` - Single BlockTransactionsParams object
2929
- `get_transactions_by_ids` - Single TransactionsByIdsParams object
3030
- `get_version` - No parameters
31-
- `get_arch_txid_from_btc_txid` - Single string parameter (Bitcoin transaction ID)
32-
- `get_transaction_report` - Single string parameter (transaction ID)
33-
- `get_latest_tx_using_account` - Single string parameter (account public key)
34-
- `get_all_accounts` - No parameters
31+
- `get_network_pubkey` - No parameters
3532

3633
### Available Only in Validator Crate
3734

@@ -40,6 +37,22 @@ The following RPC methods are **only available** in the `validator` crate:
4037
- `get_peers` - No parameters
4138
- `get_current_state` - No parameters
4239

40+
### Available Only in Local Validator Crate
41+
42+
The following RPC methods are available only in the `local_validator` crate (development/debug helpers):
43+
44+
- `get_arch_txid_from_btc_txid` - Single string parameter (Bitcoin transaction ID)
45+
- `get_transaction_report` - Single string parameter (transaction ID)
46+
- `get_latest_tx_using_account` - Single string parameter (account public key)
47+
- `get_all_accounts` - No parameters
48+
49+
### Deprecated or Not Exposed
50+
51+
The following legacy methods are not currently exposed via RPC in the validator:
52+
53+
- `start_dkg`
54+
- `reset_network`
55+
4356
## Parameter Format Patterns
4457

4558
### Single Parameter Methods

src/rpc/rpc.md

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The Arch Network provides a comprehensive JSON-RPC API for interacting with vali
1313
## API Endpoints
1414

1515
### Default Configuration
16-
- **Default Port**: `9002` for validator nodes, `9001` for local validators
16+
- **Default Port**: `9001` for validator nodes, `9002` for local validators
1717
- **Endpoint URL**: `http://localhost:9002` (or your node's IP address)
1818
- **Protocol**: HTTP POST with JSON-RPC 2.0
1919

@@ -70,8 +70,7 @@ All RPC requests must be sent as HTTP `POST` requests with:
7070
- [`is_node_ready`](#is_node_ready) - Check node readiness
7171
- [`get_peers`](#get_peers) - Get connected network peers
7272
- [`get_current_state`](#get_current_state) - Get current validator node state
73-
- [`start_dkg`](#start_dkg) - Initiate Distributed Key Generation (leader only)
74-
- [`reset_network`](#reset_network) - Reset network state (leader only)
73+
- [`get_network_pubkey`](#get_network_pubkey) - Get the network verifying key
7574

7675
### System Operations
7776
- [`get_version`](#get_version) - Get node version information
@@ -659,44 +658,21 @@ curl -X POST -H 'Content-Type: application/json' -d '
659658
}' http://localhost:9002/
660659
```
661660

662-
### start_dkg
661+
### get_network_pubkey
663662

664-
Initiates the Distributed Key Generation (DKG) process.
663+
Returns the current network verifying key as a hex string.
665664

666665
**Parameters:** None
667666

668-
**Returns:** Success message if the DKG process is initiated
669-
670-
**Note:** Not available for local validators.
671-
672-
**Example:**
673-
```bash
674-
curl -X POST -H 'Content-Type: application/json' -d '
675-
{
676-
"jsonrpc":"2.0",
677-
"id":1,
678-
"method":"start_dkg",
679-
"params":[]
680-
}' http://localhost:9002/
681-
```
682-
683-
### reset_network
684-
685-
Resets the network state.
686-
687-
**Parameters:** None
688-
689-
**Returns:** Success message if the network reset is successful
690-
691-
**Note:** Only callable by the Leader node. Not available for local validators.
667+
**Returns:** Hex-encoded verifying key string
692668

693669
**Example:**
694670
```bash
695671
curl -X POST -H 'Content-Type: application/json' -d '
696672
{
697673
"jsonrpc":"2.0",
698674
"id":1,
699-
"method":"reset_network",
675+
"method":"get_network_pubkey",
700676
"params":[]
701677
}' http://localhost:9002/
702678
```

0 commit comments

Comments
 (0)