Skip to content

Commit 52b79cd

Browse files
committed
sync dev
2 parents 333f5c9 + 20a038d commit 52b79cd

File tree

8 files changed

+961
-212
lines changed

8 files changed

+961
-212
lines changed

filepathSlugs.json

+18-9
Original file line numberDiff line numberDiff line change
@@ -2261,7 +2261,7 @@
22612261
"response-success-2",
22622262
"qtum-qrc-20-coin-activation",
22632263
"response-success-3",
2264-
"response-error-mm2-is-not-set",
2264+
"error-responses",
22652265
"enable-method",
22662266
"arguments-2",
22672267
"response-2",
@@ -2814,6 +2814,14 @@
28142814
"token-protocol-parse-error-error",
28152815
"unexpected-token-protocol-error"
28162816
],
2817+
"src/pages/komodo-defi-framework/api/v20/get_current_mtp/index.mdx": [
2818+
"get-current-mtp",
2819+
"arguments",
2820+
"response",
2821+
"examples",
2822+
"command",
2823+
"response-success"
2824+
],
28172825
"src/pages/komodo-defi-framework/api/v20/get_public_key/index.mdx": [
28182826
"get-public-key",
28192827
"arguments",
@@ -2968,6 +2976,15 @@
29682976
"command",
29692977
"response-2"
29702978
],
2979+
"src/pages/komodo-defi-framework/api/v20/peer_connection_healthcheck/index.mdx": [
2980+
"peer-connection-healthcheck",
2981+
"arguments",
2982+
"response",
2983+
"examples",
2984+
"command",
2985+
"response-peer-found",
2986+
"response-peer-not-found"
2987+
],
29712988
"src/pages/komodo-defi-framework/api/v20/recreate_swap_data/index.mdx": [
29722989
"recreate-swap-data",
29732990
"arguments",
@@ -3109,14 +3126,6 @@
31093126
"invalid-request-wrong-parameter-type",
31103127
"invalid-fee-policy-attempt-to-use-eth-gas-for-utxo-coin"
31113128
],
3112-
"src/pages/komodo-defi-framework/api/v20-dev/get_current_mtp/index.mdx": [
3113-
"get-current-mtp",
3114-
"arguments",
3115-
"response",
3116-
"examples",
3117-
"command",
3118-
"response-success"
3119-
],
31203129
"src/pages/komodo-defi-framework/api/v20-dev/get_locked_amount/index.mdx": [
31213130
"get-locked-amount",
31223131
"arguments",

postman/collections/komodo_defi.postman_collection.json

+695-35
Large diffs are not rendered by default.

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

+126-125
Large diffs are not rendered by default.

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

+46-28
Original file line numberDiff line numberDiff line change
@@ -63,23 +63,18 @@ Komodo DeFi Framework is a true cross chain, cross protocol Decentralized Exchan
6363

6464
#### Arguments
6565

66-
| Structure | Type | Description |
67-
| ---------------------------------------- | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
68-
| coin | string | Ticker of coin to activate |
69-
| servers | array of objects | List of \[Electrum servers] ([https://github.com/KomodoPlatform/coins/tree/master/electrums](https://github.com/KomodoPlatform/coins/tree/master/electrums)) |
70-
| servers.url | string | Electrum server URL |
71-
| servers.protocol | string (optional, defaults to `TCP`) | Transport protocol used by Komodo DeFi Framework API to connect to the electrum server (`TCP` or `SSL`) |
72-
| servers.disable\_cert\_verification | bool (optional, defaults to `false`.) | If `true`, this disables server SSL/TLS certificate verification (e.g. to use self-signed certificate). <b>Use at your own risk</b> |
73-
| mm2 | integer | Required if not set in `coins` file. Informs the Komodo DeFi Framework API whether or not the coin is expected to function. Accepted values are `0` or `1` |
74-
| tx\_history | bool | If `true` the Komodo DeFi Framework API will preload trasaction history as a background process. Must be set to `true` to use the [my\_tx\_history](/komodo-defi-framework/api/legacy/my_tx_history/#my-tx-history) method |
75-
| required\_confirmations | integer (optional, defaults to `3`) | Number of confirmations for the Komodo DeFi Framework API to wait during the transaction steps of an atomic swap. |
76-
| requires\_notarization | boolean (optional, defaults to `false`) | If `true`, coins protected by [Komodo Platform's dPoW security](https://satindergrewal.medium.com/delayed-proof-of-work-explained-9a74250dbb86) will wait for a notarization before progressing to the next atomic swap transactions step. |
77-
| swap\_contract\_address | string (required for QRC20 only) | address of etomic swap smart contract |
78-
| fallback\_swap\_contract | string (required for QRC20 only) | address of backup etomic swap smart contract |
79-
| utxo\_merge\_params | object (optional) | If set, will consolidate excessive UTXOs (e.g. from mining) |
80-
| utxo\_merge\_params.merge\_at | integer | Number of UTXOs in wallet required before merging |
81-
| utxo\_merge\_params.check\_every | integer | How often to check the UTXO count, in seconds. Ideally should be at least 3x the coins block time. |
82-
| utxo\_merge\_params.max\_merge\_at\_once | integer | Maximum number of UTXOs to merge in each consolidation transaction. Should be less that `merge_at` value, but will fail if so high the transaction becomes too large. Suggested maximum is 250. |
66+
| Structure | Type | Description | |
67+
| ------------------------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - |
68+
| coin | string | Ticker of coin to activate | |
69+
| servers | list of objects | A list of standard [ActivationServers](/komodo-defi-framework/api/common_structures/activation/#activation-servers) objects. | |
70+
| mm2 | integer | Required if not set in `coins` file. Informs the Komodo DeFi Framework API whether or not the coin is expected to function. Accepted values are `0` or `1` | |
71+
| min\_connected | integer | Optional, defaults to `1`. Minimum number of electrum servers to maintain an active connection to. | |
72+
| max\_connected | integer | Optional. Maximum number of electrum servers to maintain an active connection to. If not set, defaults to all servers in activation request. | |
73+
| required\_confirmations | integer | Optional, defaults to `3`. Number of confirmations for the Komodo DeFi Framework API to wait during the transaction steps of an atomic swap. | |
74+
| requires\_notarization | boolean | Optional, defaults to `false`. If `true`, coins protected by [Komodo Platform's dPoW security](https://satindergrewal.medium.com/delayed-proof-of-work-explained-9a74250dbb86) will wait for a notarization before progressing to the next atomic swap transactions step. | |
75+
| swap\_contract\_address | string | QRC20 only. Address of etomic swap smart contract | |
76+
| fallback\_swap\_contract | string | QRC20 only. Address of backup etomic swap smart contract | |
77+
| utxo\_merge\_params | object | A standard [UtxoMergeParams](/komodo-defi-framework/api/common_structures/activation/#utxo-merge-params) object. Used to reduce a wallet's UTXO count in cases where it is causing significantly slower RPC responses. | |
8378

8479
#### Response
8580

@@ -105,15 +100,22 @@ Komodo DeFi Framework is a true cross chain, cross protocol Decentralized Exchan
105100
"method": "electrum",
106101
"servers": [
107102
{
108-
"url": "electrum1.cipig.net:10063"
103+
"url": "electrum1.cipig.net:10063",
104+
"protocol": "TCP"
109105
},
110106
{
111-
"url": "electrum2.cipig.net:10063"
107+
"url": "electrum2.cipig.net:20063",
108+
"protocol": "SSL",
109+
"disable_cert_verification": true
112110
},
113111
{
114-
"url": "electrum3.cipig.net:10063"
112+
"url": "electrum3.cipig.net:20063",
113+
"protocol": "SSL",
114+
"ws_url": "electrum3.cipig.net:30063"
115115
}
116116
],
117+
"min_connected": 1,
118+
"max_connected": 2,
117119
"userpass": "RPC_UserP@SSW0RD"
118120
}
119121
```
@@ -218,17 +220,33 @@ Komodo DeFi Framework is a true cross chain, cross protocol Decentralized Exchan
218220
"result": "success"
219221
}
220222
```
223+
</CollapsibleSection>
221224

222-
#### Response (Error, `mm2` is not set)
225+
#### Error responses
223226

224-
If mm2 is not set in either the command or your `coins` file, you will see the following error:
227+
If mm2 is not set in either the command or your `coins` file, you will see the following error:
225228

226-
```json
227-
{
228-
"error": "lp_coins:943] lp_coins:693] mm2 param is not set neither in coins config nor enable request, assuming that coin is not supported"
229-
}
230-
```
231-
</CollapsibleSection>
229+
```json
230+
{
231+
"error": "lp_coins:943] lp_coins:693] mm2 param is not set neither in coins config nor enable request, assuming that coin is not supported"
232+
}
233+
```
234+
235+
If min\_connected is \< 1, you will see the following error:
236+
237+
```json
238+
{
239+
"error":"rpc:184] dispatcher_legacy:141] lp_commands_legacy:141] lp_coins:4462] utxo_standard:73] utxo_coin_builder:616] Internal error: manager:129] min_connected should be greater than 0"
240+
}
241+
```
242+
243+
If max\_connected is \< min\_connected, you will see the following error:
244+
245+
```json
246+
{
247+
"error": "rpc:184] dispatcher_legacy:141] lp_commands_legacy:141] lp_coins:4462] utxo_standard:73] utxo_coin_builder:616] Internal error: manager:132] min_connected (2) must be <= max_connected (1)"
248+
}
249+
```
232250

233251
## Enable Method
234252

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>

src/pages/komodo-defi-framework/setup/configure-mm2-json/index.mdx

+6-6
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,15 @@ When running the Komodo DeFi API via commandline with the `mm2` binary, some bas
7878

7979
#### Example for HD Wallets:
8080

81-
If you are using HD wallets, you will need to add the `hd_account_id` value to your `MM2.json` file. This value will be used in the derivation path for all coins, and will take the place of the `COIN_ID` value in the following path: `m/44'/COIN_ID'/<hd_account_id>'/CHAIN/ADDRESS_ID`.
81+
If you are using HD wallets, you will need to set `enable_hd` to `true` in to your `MM2.json` file.
8282

8383
<Note>
84-
Using the same seed phrase with / without setting the `hd_account_id` value
84+
Using the same seed phrase with / without setting `enable_hd` to `true`
8585
will result in different addresses being generated. For example, when using
86-
the seed phrase `february soldier message acid member jump shadow walk novel impose puppy tornado`: - If the `hd_account_id` value is set to `0` in
86+
the seed phrase `february soldier message acid member jump shadow walk novel impose puppy tornado`: - If `enable_hd` is `true` in your
8787
MM2.json, the first address in the wallet returns the address
88-
`0x26cE5D1cD4CC673a1b0b980371C7c862B9503452` for ETH - If the `hd_account_id`
89-
value is not set, the wallet will return the address
88+
`0x26cE5D1cD4CC673a1b0b980371C7c862B9503452` for ETH - If the `enable_hd`
89+
is `false` (or not set), the wallet will return the address
9090
`0x8c40a6E127c7a13e26ce95deA88354C3fb134580` for ETH
9191
</Note>
9292

@@ -98,7 +98,7 @@ If you are using HD wallets, you will need to add the `hd_account_id` value to y
9898
"passphrase": "ENTER_UNIQUE_SEED_PHRASE_DONT_USE_THIS_CHANGE_IT_OR_FUNDS_NOT_SAFU",
9999
"allow_weak_password": false,
100100
"dbdir": "/path/to/DB/folder",
101-
"hd_account_id": 0
101+
"enable_hd": true
102102
}
103103
```
104104

0 commit comments

Comments
 (0)