Skip to content

Commit 20a038d

Browse files
authored
Merge pull request #356 from KomodoPlatform/add/kdf/peer_connection_healthcheck
2 parents cb0dc56 + cf4fd7e commit 20a038d

File tree

5 files changed

+89
-18
lines changed

5 files changed

+89
-18
lines changed

filepathSlugs.json

+17-8
Original file line numberDiff line numberDiff line change
@@ -2816,6 +2816,14 @@
28162816
"token-protocol-parse-error-error",
28172817
"unexpected-token-protocol-error"
28182818
],
2819+
"src/pages/komodo-defi-framework/api/v20/get_current_mtp/index.mdx": [
2820+
"get-current-mtp",
2821+
"arguments",
2822+
"response",
2823+
"examples",
2824+
"command",
2825+
"response-success"
2826+
],
28192827
"src/pages/komodo-defi-framework/api/v20/get_public_key/index.mdx": [
28202828
"get-public-key",
28212829
"arguments",
@@ -2970,6 +2978,15 @@
29702978
"command",
29712979
"response-2"
29722980
],
2981+
"src/pages/komodo-defi-framework/api/v20/peer_connection_healthcheck/index.mdx": [
2982+
"peer-connection-healthcheck",
2983+
"arguments",
2984+
"response",
2985+
"examples",
2986+
"command",
2987+
"response-peer-found",
2988+
"response-peer-not-found"
2989+
],
29732990
"src/pages/komodo-defi-framework/api/v20/recreate_swap_data/index.mdx": [
29742991
"recreate-swap-data",
29752992
"arguments",
@@ -3111,14 +3128,6 @@
31113128
"invalid-request-wrong-parameter-type",
31123129
"invalid-fee-policy-attempt-to-use-eth-gas-for-utxo-coin"
31133130
],
3114-
"src/pages/komodo-defi-framework/api/v20-dev/get_current_mtp/index.mdx": [
3115-
"get-current-mtp",
3116-
"arguments",
3117-
"response",
3118-
"examples",
3119-
"command",
3120-
"response-success"
3121-
],
31223131
"src/pages/komodo-defi-framework/api/v20-dev/get_locked_amount/index.mdx": [
31233132
"get-locked-amount",
31243133
"arguments",

src/data/sidebar.json

+13-9
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,19 @@
500500
"href": "/komodo-defi-framework/api/v20/withdraw/"
501501
}
502502
]
503+
},
504+
{
505+
"title": "Utility",
506+
"links": [
507+
{
508+
"title": "peer_connection_healthcheck",
509+
"href": "/komodo-defi-framework/api/v20/peer_connection_healthcheck/"
510+
},
511+
{
512+
"title": "get_current_mtp",
513+
"href": "/komodo-defi-framework/api/v20/get_current_mtp/"
514+
}
515+
]
503516
}
504517
]
505518
},
@@ -510,15 +523,6 @@
510523
"titleLink": "/komodo-defi-framework/api/v20-dev/",
511524
"links": []
512525
},
513-
{
514-
"title": "Utility",
515-
"links": [
516-
{
517-
"title": "get_current_mtp",
518-
"href": "/komodo-defi-framework/api/v20-dev/get_current_mtp/"
519-
}
520-
]
521-
},
522526
{
523527
"title": "HD Wallet Tasks",
524528
"links": [

src/pages/komodo-defi-framework/api/index.mdx

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Below is a table of the currently available legacy, v2.0 and v2.0 (Dev) methods:
3737
| | [enable\_tendermint\_with\_assets](/komodo-defi-framework/api/v20/enable_tendermint_with_assets/#enable-tendermint-with-assets) | |
3838
| | | [get\_channel\_details](/komodo-defi-framework/api/v20-dev/lightning/channels/#get-channel-details) |
3939
| | | [get\_claimable\_balances](/komodo-defi-framework/api/v20-dev/lightning/channels/#get-claimable-balances) |
40-
| | | [get\_current\_mtp](/komodo-defi-framework/api/v20-dev/get_current_mtp/#get-current-mtp) |
40+
| | [get\_current\_mtp](/komodo-defi-framework/api/v20/get_current_mtp/#get-current-mtp) | |
4141
| [get\_enabled\_coins](/komodo-defi-framework/api/legacy/get_enabled_coins/#get-enabled-coins) | | |
4242
| [get\_gossip\_mesh](/komodo-defi-framework/api/legacy/get_gossip_mesh/#get-gossip-mesh) | | |
4343
| [get\_gossip\_peer\_topics](/komodo-defi-framework/api/legacy/get_gossip_peer_topics/#get-gossip-peer-topics) | | |
@@ -82,6 +82,7 @@ Below is a table of the currently available legacy, v2.0 and v2.0 (Dev) methods:
8282
| [orderbook](/komodo-defi-framework/api/legacy/orderbook/#orderbook) | [orderbook](/komodo-defi-framework/api/v20/orderbook/#orderbook) | |
8383
| [orderbook\_depth](/komodo-defi-framework/api/legacy/orderbook_depth/#orderbook-depth) | | |
8484
| [orders\_history\_by\_filter](/komodo-defi-framework/api/legacy/orders_history_by_filter/#orders-history-by-filter) | | |
85+
| | [peer\_connection\_healthcheck](/komodo-defi-framework/api/v20/peer_connection_healthcheck/#peer-connection-healthcheck) | |
8586
| [recover\_funds\_of\_swap](/komodo-defi-framework/api/legacy/recover_funds_of_swap/#recover-funds-of-swap) | | |
8687
| | [recreate\_swap\_data](/komodo-defi-framework/api/v20/recreate_swap_data/#recreate-swap-data) | |
8788
| | | [refresh\_nft\_metadata](/komodo-defi-framework/api/v20-dev/non_fungible_tokens/refresh_nft_metadata/#refresh-nft-metadata) |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
export const title = "Komodo DeFi Framework Method: Peer Connection Healthcheck";
2+
export const description = "The peer_connection_healthcheck method checks if a peer is connected to the KDF network.";
3+
4+
# peer\_connection\_healthcheck
5+
6+
The `peer_connection_healthcheck` method checks if a peer is connected to the KDF network using the [currently configured](/komodo-defi-framework/setup/configure-mm2-json/) `netid`.
7+
8+
## Arguments
9+
10+
| Structure | Type | Description |
11+
| --------- | ---- | ----------- |
12+
| (none) | | |
13+
14+
#### Response
15+
16+
| Structure | Type | Description |
17+
| --------- | ------- | --------------------------------------- |
18+
| result | boolean | True if peer found connected to network |
19+
20+
#### 📌 Examples
21+
22+
#### Command
23+
24+
<CodeGroup title="" tag="POST" label="peer_connection_healthcheck" mm2MethodDecorate="true">
25+
```json
26+
{
27+
"userpass": "RPC_UserP@SSW0RD",
28+
"method": "peer_connection_healthcheck",
29+
"mmrpc": "2.0",
30+
"params": {
31+
"peer_address": "12D3KooWCcjBQ3kG3BzjVwuZqGDL2YxXik6SCDv2YAHj4E54NiAy"
32+
}
33+
}
34+
```
35+
</CodeGroup>
36+
37+
<CollapsibleSection expandedText="Hide Response" collapsedText="Show Response">
38+
#### Response (peer found)
39+
40+
```json
41+
{
42+
"mmrpc": "2.0",
43+
"result": true,
44+
"id": null
45+
}
46+
```
47+
48+
#### Response (peer not found)
49+
50+
```json
51+
{
52+
"mmrpc": "2.0",
53+
"result": false,
54+
"id": null
55+
}
56+
```
57+
</CollapsibleSection>

0 commit comments

Comments
 (0)