Skip to content

Commit

Permalink
Merge pull request #131 from KomodoPlatform/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
gcharang authored Sep 22, 2023
2 parents a00d2c5 + 960aff2 commit a886740
Show file tree
Hide file tree
Showing 8 changed files with 5,633 additions and 296 deletions.
4,942 changes: 4,942 additions & 0 deletions filepathSlugs.json

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions src/pages/antara/api/gaming/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -568,9 +568,9 @@ int main()

#### Public Function

The `has_systems` function verifies whether or not a list of systems is already registered in the [system\_manager](#system_manager).
The `has_systems` function verifies whether or not a list of systems is already registered in the [system\_manager](#system-manager).

This function recursively calls the [has\_system](#has_system) function.
This function recursively calls the [has\_system](#has-system) function.

<Note>
This function is marked as [nodiscard.](https://en.cppreference.com/w/cpp/language/attributes/nodiscard)
Expand Down Expand Up @@ -621,7 +621,7 @@ int main()

#### Public Function

The `has_systems` function verifies whether or not a list of systems is already registered in the [system\_manager](#system_manager).
The `has_systems` function verifies whether or not a list of systems is already registered in the [system\_manager](#system-manager).

#### Usage Pattern

Expand Down Expand Up @@ -667,9 +667,9 @@ int main()

#### Public Function

The `has_systems` function verifies whether or not a list of systems is already registered in the [system\_manager](#system_manager).
The `has_systems` function verifies whether or not a list of systems is already registered in the [system\_manager](#system-manager).

This function recursively calls the [has\_system](#has_system) function.
This function recursively calls the [has\_system](#has-system) function.

<Note>
This function is marked as [nodiscard.](https://en.cppreference.com/w/cpp/language/attributes/nodiscard)
Expand Down Expand Up @@ -720,9 +720,9 @@ int main()

#### Public Function

The `has_systems` function verifies whether or not a list of systems is already registered in the [system\_manager](#system_manager).
The `has_systems` function verifies whether or not a list of systems is already registered in the [system\_manager](#system-manager).

This function recursively calls the [has\_system](#has_system) function.
This function recursively calls the [has\_system](#has-system) function.

<Note>
This function is marked [nodiscard.](https://en.cppreference.com/w/cpp/language/attributes/nodiscard)
Expand Down Expand Up @@ -868,7 +868,7 @@ int main()

The `mark_systems` function marks a list of systems for destruction at the next tick of the game loop.

This function recursively calls the [mark\_system](#mark_system) function.
This function recursively calls the [mark\_system](#mark-system) function.

<Note>
This system is marked as [nodiscard.](https://en.cppreference.com/w/cpp/language/attributes/nodiscard)
Expand Down Expand Up @@ -968,7 +968,7 @@ int main()

The `enable_systems` function enables a list of systems.

This function recursively calls the [enable\_system](#enable_system) function.
This function recursively calls the [enable\_system](#enable-system) function.

#### Usage Pattern

Expand Down Expand Up @@ -1064,7 +1064,7 @@ int main()

The `disable_systems` function disables a list of systems.

This function recursively calls the [disable\_system](#disable_system) function.
This function recursively calls the [disable\_system](#disable-system) function.

#### Usage Pattern

Expand Down Expand Up @@ -1263,7 +1263,7 @@ The `load_systems` function loads many os systems.

{/* What does "os" mean above? Operating systems? That would make it operating systems systems */}

This function recursively calls the [create\_systems](#create_systems) function.
This function recursively calls the [create\_system](#create-system) function.

#### Usage Pattern

Expand Down Expand Up @@ -1560,7 +1560,7 @@ int main()

The `key_released` function that takes no arguments is the default constructor, provided for scripting-system convenience.

Please see the [key\_released | 1](#key-released-1) function for more information.
Please see the [key\_released | 1](#key-released) function for more information.

###### Usage Pattern

Expand Down
224 changes: 170 additions & 54 deletions src/pages/atomicdex/api/v20-dev/zhtlc_coins/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,11 @@ To withdraw ZHTLC coins, you need to use the [task::withdraw](/atomicdex/api/v20

#### Arguments

| Structure | Type | Description |
| ------------------------------------------------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| ticker | string | Ticker of coin to activate |
| activation\_params | object | Contains details required for activation as explained below |
| activation\_params.required\_confirmations | integer | Block confirmations to wait for transactions when doing a swap. Optional, defaults to `3`. Overrides value if set in `coins` file. |
| activation\_params.requires\_notarization | boolean | For [dPoW](https://komodoplatform.com/en/blog/dpow-demystified/) protected coins, a `true` value will wait for transactions to be notarised when doing swaps. Optional, defaults to `false`. Overrides value if set in `coins` file. |
| activation\_params.mode.rpc | string | Set as `Light` to use external electrum & lightwallet\_d servers or `Native` to use local block chain data. If native, the `rpc_data` fields below are not required. |
| activation\_params.mode.rpc\_data | list of objects | Contains details about servers to be used for `Light` mode operation. |
| ..rpc\_data.light\_wallet\_d\_servers | list of strings | Urls which are hosting lightwallet\_d servers |
| ..rpc\_data.electrum\_servers | list of objects | Contains additional details about a coins electrum servers. |
| ...electrum\_servers.protocol | string | Transport protocol used by AtomicDEX API to connect to the electrum server (`TCP` or `SSL`). Optional, defaults to `TCP` |
| ...electrum\_servers.url | string | The URL and port of an electrum server. |
| ...electrum\_servers.disable\_cert\_verification | boolean | If `true`, this disables server SSL/TLS certificate verification (e.g. to use self-signed certificate). Optional, defaults to `false` <b>Use at your own risk!</b> |
| activation\_params.zcash\_params\_path | string | Path to folder containing [Zcash parameters](https://z.cash/technology/paramgen/). Optional, defaults to standard location as defined in [this guide](https://forum.komodoplatform.com/t/installing-zcash-params/603) |
| activation\_params.scan\_blocks\_per\_iteration | integer | Sets the number of scanned blocks per iteration during `BuildingWalletDb` state. Optional, default value is 1000. |
| activation\_params.scan\_interval\_ms | integer | Sets the interval in milliseconds between iterations of `BuildingWalletDb` state. Optional, default value is 0. |
| Structure | Type | Description |
| --------------------------------------------- | --------------- | ------------------------------------------------------------------------------- |
| ticker | string | Ticker of coin to activate |
| activation_params | object | A standard [ActivationRpcData](/atomicdex/api/v20#activation-rpc-data) object. |

<Note>
Using a smaller `scan_blocks_per_iteration` and larger `scan_interval_ms`,
will reduce the average CPU load during Z coin activation (at the cost of a
longer activation time). These optional fields are recommended when developing
for iOS, where a high CPU load may kill the activation process. Android &
desktop operating systems do not appear to have any problems with high CPU
load during Z coin activation.
</Note>

#### Response

Expand All @@ -55,9 +35,9 @@ To withdraw ZHTLC coins, you need to use the [task::withdraw](/atomicdex/api/v20

#### 📌 Examples

#### Command
#### Enable Z coin without any optional parameters

<CodeGroup title="" tag="POST" label="task::enable_z_coin::init" mm2MethodDecorate="true">
<CodeGroup title="task::enable_z_coin::init" tag="POST" label="task::enable_z_coin::init" mm2MethodDecorate="true">
```json
{
"userpass": "testpsw",
Expand Down Expand Up @@ -85,26 +65,117 @@ To withdraw ZHTLC coins, you need to use the [task::withdraw](/atomicdex/api/v20
}
}
}
```
```
</CodeGroup>

<CollapsibleSection expandedText="Hide Response" collapsedText="Show Response">
#### Response
#### Sync from block 2528700, with custom `.zcash-params` path and scan params

<CodeGroup title="task::enable_z_coin::init" tag="POST" label="task::enable_z_coin::init" mm2MethodDecorate="true">
```json
{
"userpass": "MM2_RPC_PASSWORD",
"method": "task::enable_z_coin::init",
"mmrpc": "2.0",
"params": {
"ticker": "ZOMBIE",
"activation_params": {
"mode": {
"rpc": "Light",
"rpc_data": {
"electrum_servers": [{"url":"zombie.dragonhound.info:10033"}],
"light_wallet_d_servers": ["http://zombie.dragonhound.info:443"],
"sync_params": {"height": 2528700}
}
},
"zcash_params_path": "/home/username/path_to/.zcash-params",
"scan_blocks_per_iteration": 100,
"scan_interval_ms": 200
}
}
}
```
</CodeGroup>

```json
{
"mmrpc": "2.0",
"result": {
"task_id": 0
},
"id": null
#### Sync from sapling activation height (earliest)

The Z coin lightwallet client only supports blocks that are post-sapling. The sapling activation height for Z coins can be found in the [coins file](https://github.com/KomodoPlatform/coins/blob/master/coins)

<CodeGroup title="task::enable_z_coin::init" tag="POST" label="task::enable_z_coin::init" mm2MethodDecorate="true">
```json
{
"userpass": "MM2_RPC_PASSWORD",
"method": "task::enable_z_coin::init",
"mmrpc": "2.0",
"params": {
"ticker": "ZOMBIE",
"activation_params": {
"mode": {
"rpc": "Light",
"rpc_data": {
"electrum_servers": [{"url":"zombie.dragonhound.info:10033"}],
"light_wallet_d_servers": ["http://zombie.dragonhound.info:443"],
"sync_params": "earliest"
},
},
"zcash_params_path": "/home/username/path_to/.zcash-params",
"scan_blocks_per_iteration": 100,
"scan_interval_ms": 200
}
}
}
```
</CodeGroup>

#### Using websockets to sync from [Proof of Keys Day](https://hackernoon.com/not-your-keys-not-your-bitcoin-jan3bitcoin-z6k3ktb), 2023.

<CodeGroup title="task::enable_z_coin::init" tag="POST" label="task::enable_z_coin::init" mm2MethodDecorate="true">
```json
{
"userpass": "MM2_RPC_PASSWORD",
"method": "task::enable_z_coin::init",
"mmrpc": "2.0",
"params": {
"ticker": "ZOMBIE",
"activation_params": {
"mode": {
"rpc": "Light",
"rpc_data": {
"electrum_servers": [
{
"protocol":"SSL",
"url":"zombie.dragonhound.info:20133",
"ws_url":"zombie.dragonhound.info:30059"
}
],
"light_wallet_d_servers": ["http://zombie.dragonhound.info:443"],
"sync_params": {"date": 1672704000}
}
}
}
}
}
```
</CodeGroup>


<CollapsibleSection expandedText='Hide Response' collapsedText='Show Response'>
#### Response

```json
{
"mmrpc": "2.0",
"result": {
"task_id": 0
},
"id": null
}
```

</CollapsibleSection>

## task\_enable\_z\_coin\_status

After initiating z coin enabling, you can use the `task_id` to check progress.
Z coins need to build sync a local block cache and wallet database before they can be used. Using `task_id` as an input, this method will return the current status of the activation process.

#### Arguments

Expand All @@ -122,20 +193,20 @@ After initiating z coin enabling, you can use the `task_id` to check progress.

#### 📌 Examples

#### Command

<CodeGroup title="" tag="POST" label="task::enable_z_coin::status" mm2MethodDecorate="true">
```json
{
"userpass": "testpsw",
"method": "task::enable_z_coin::status",
"mmrpc": "2.0",
"params": {
"task_id": "<TASK_ID>",
"forget_if_finished": false
}
#### Status of Z coin activation

<CodeGroup title="task::enable_z_coin::status" tag="POST" label="task::enable_z_coin::status" mm2MethodDecorate="true">
```json
{
"userpass": "testpsw",
"method": "task::enable_z_coin::status",
"mmrpc": "2.0",
"params": {
"task_id": 0,
"forget_if_finished": false
}
```
}
```
</CodeGroup>

<CollapsibleSection expandedText="Hide Response" collapsedText="Show Response">
Expand Down Expand Up @@ -184,10 +255,55 @@ After initiating z coin enabling, you can use the `task_id` to check progress.
}
}
},
"id": null
"id": null
}
```

#### Response (CoinCreationError - no Zcash Params)

```json
{
"error": "Error on platform coin ZOMBIE creation: ZCashParamsNotFound",
"error_path": "lib.z_coin_activation.z_coin",
"error_trace": "lib:104] z_coin_activation:218] z_coin:1007]",
"error_type": "CoinCreationError",
"error_data": {
"ticker": "ZOMBIE",
"error": "ZCashParamsNotFound"
}
}
```

#### Response (error - NoSuchTask)

You'll see this if the task number does not exist, or the task has already completed.

```json
{
"mmrpc": "2.0",
"error": "No such task '1'",
"error_path": "init_standalone_coin",
"error_trace": "init_standalone_coin:119]",
"error_type": "NoSuchTask",
"error_data": 1,
"id": null
}
```

#### Response (error - InvalidRequest)

```json
{
"mmrpc": "2.0",
"error": "Error parsing request: invalid value: integer `-205`, expected u64",
"error_path": "dispatcher",
"error_trace": "dispatcher:109]",
"error_type": "InvalidRequest",
"error_data": "invalid value: integer `-205`, expected u64",
"id": 42
}
```

#### Response (Enabling complete)

```json
Expand Down Expand Up @@ -276,7 +392,7 @@ If you want to cancel the enabling process before it has completed, you can use

#### Command

<CodeGroup title="" tag="POST" label="task::enable_z_coin::cancel" mm2MethodDecorate="true">
<CodeGroup title="task::enable_z_coin::cancel" tag="POST" label="task::enable_z_coin::cancel" mm2MethodDecorate="true">
```json
{
"userpass": "testpsw",
Expand Down Expand Up @@ -364,9 +480,9 @@ To get the transaction history for ZHTLC coins, you need to use this special met

#### 📌 Examples

#### Command
#### Z Coin Transaction History

<CodeGroup title="" tag="POST" label="z_coin_tx_history" mm2MethodDecorate="true">
<CodeGroup title="z_coin_tx_history" tag="POST" label="z_coin_tx_history" mm2MethodDecorate="true">
```json
{
"userpass": "testpsw",
Expand Down
Loading

0 comments on commit a886740

Please sign in to comment.