-
Notifications
You must be signed in to change notification settings - Fork 51
add enable / disable / status methods for z coins #395
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
I have one note
| ----------------------------------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| ticker | string | Ticker of coin to activate | | ||
| activation_params | object | List of [Electrum servers](https://github.com/KomodoPlatform/coins/tree/master/electrums) | | ||
| activation_params.mode.zcash_params_path | string | Optional. Path to folder containing [Zcash parameters](https://z.cash/technology/paramgen/). Defaults to standard location as defined in [this guide](https://forum.komodoplatform.com/t/installing-zcash-params/603) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should provide a description of zcash_params_path
after activation_params.mode
, as its optional parameter and its not a part of mode
. zcash_params_path
is one of activation_params
arguments.
You can expand the view till activation_params here
In addition, you can see, how zcoin activation params look in API code
pub struct ZcoinActivationParams {
pub mode: ZcoinRpcMode,
pub required_confirmations: Option<u64>,
pub requires_notarization: Option<bool>,
pub zcash_params_path: Option<String>,
}
Where ZcoinRpcMode
could be Native
or Light
with electrum_servers
and with light_wallet_d_servers
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fixes!
Next review iteration :)
## task::enable_z_coin::init | ||
|
||
Z coins, like Pirate (ARRR) and the test coin ZOMBIE take a little longer to enable, and use a new two step method to enable. Activation can take a little while the first time, as we need to download some block cache data, and build a wallet database. Subsequent enabling will be faster, but still take a bit longer than other coins. The second step for activation is optional, but allows us to check the status of the activation process. | ||
<b>To enable Z coins you also need to [install some Zcash Params](https://forum.komodoplatform.com/t/installing-zcash-params/603)</b> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you, please, add additional links to alternative fetch-params-alt
scripts in your guide?
I had situations that some files from https://z.cash/downloads
were unavailable, so I had Failed to fetch the Zcash zkSNARK parameters!
error.
You left the link to zcutil with all scripts, but I think some users may not notice the alternative scripts in the list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ..rpc_data.electrum_servers.protocol | string | Transport protocol used by AtomicDEX API to connect to the electrum server (`TCP` or `SSL`). Optional, defaults to `TCP` | | ||
| ..rpc_data.electrum_servers.urls | string | Urls which are hosting electrum servers | | ||
| ...electrum_servers.disable_cert_verification | boolean | If `true`, this disables server SSL/TLS certificate verification (e.g. to use self-signed certificate). <b>Use at your own risk</b> | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We dont have urls
in electrum_servers
.
We have list of ElectrumRpcRequest
with parameters: url
(one string), protocol
and disable_cert_verification
. ElectrumRpcRequest
is structure in our code, we dont use its name in curl, we just use arguments of this structure in curly brackets.
If user wants to use one url
and put true
in disable_cert_verification
, list will look like:
\"electrum_servers\": [{\"url\":\"zombie.sirseven.me:10033\", \"disable_cert_verification\":true}],
.
Several urls in electrum_servers
will look like:
\"electrum_servers\": [{\"url\":\"zombie.sirseven.me:10033\"}, {\"url\":\"zombie.sirseven.me:10034\"}],
.
So basically electrum_servers
has one parameter, which is a list of {url, protocol, disable_cert_verification}
@artemii235 am I right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the table, thanks for pointing it out.
closes #391 |
\"method\": \"task::enable_z_coin::status\", | ||
\"mmrpc\": \"2.0\", | ||
\"params\": { | ||
\"task_id\": $1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"task_id": $1,
Missing comma here and extra trailing one below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks,fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fixes!
Next review iteration. I have couple notes and one question :)
| ..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). <b>Use at your own risk</b> | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, add note for disable_cert_verification
: Optional, defaults to false
:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -0,0 +1,63 @@ | |||
# withdraw_init | |||
|
|||
The `withdraw_init` method generates, signs, and returns a transaction that transfers the `amount` of `coin` to the address indicated in the `to` argument. It is only used for z coins like ZOMBIE, which may take some time to complete. The status of this method can be queried via the [withdraw_status](withdraw_status.html) method, or cancelled with [withdraw_status](withdraw_cancel.html). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
typo
cancelled with [withdraw_status](withdraw_cancel.html).
- I think this should becancelled with [withdraw_cancel](withdraw_cancel.html).
-
Could you tell me am I right or wrong? Right now links for
withdraw_status
andwithdraw_cancel
are invalid. They lead to our github docs project pages. But when this branch will be merged into master, links withwithdraw_status.html
andwithdraw_cancel.html
will exist, so everything will be fine. -
It is only used for z coins like ZOMBIE
- as I can see in our code the methodtask::withdraw::init
is used not only forZCoin
, but also forUtxoCoin
,QtumCoin
. In the case of other coins there will be an errorCoinDoesntSupportInitWithdraw
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks - I've reflowed these docs into two separate docs with subsections, and the sidebar accordingly
Any z coin specific text was removed from the withdraw tasks doc, with the z coin doc noting that the withdraw tasks are required for those coins and a link to the withdraw task doc.
The links will work once deployed (you can build & test locally to confirm. They don't work in github because the md / html extension change when built.
| amount | string (numeric) | the amount the user desires to withdraw, ignored when `max=true` | | ||
| max | bool | withdraw the maximum available amount | | ||
| fee.type | string | type of transaction fee; possible values: `UtxoFixed` or `UtxoPerKbyte` | | ||
| fee.amount | string (numeric) | fee amount in coin units, used only when type is `UtxoFixed` (fixed amount not depending on tx size) or `UtxoPerKbyte` (amount per Kbyte) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also have arguments memo
(optional and should be used carefully, as Artem suggested), and from
(optional). As I can see, we use from
for WithdrawRequest
in trezor integration, in the case of Iguana there will be an error 'from' is not supported if the coin is initialized with an Iguana private key
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ain't 100% sure, but memo
sounds like tendermint-only thing here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ain't 100% sure, but
memo
sounds like tendermint-only thing here.
We merged the PR related to memo use in ARRR withdraw KomodoPlatform/komodo-defi-framework#1574
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Memo tested with ARR successfully (tho not seen in tx_history output as "error_type":"NotSupportedFor","error_data":"ARRR"
)
Added to the doc along with example to satisfy KomodoPlatform/komodo-defi-framework#1589 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tho not seen in tx_history output as
"error_type":"NotSupportedFor","error_data":"ARRR"
Yep, thats correct, my_tx_history_v2_rpc
now works only for Bch, SlpToken, UtxoCoin, QtumCoin, Tendermint and TendermintToken
| amount | string (numeric) | the amount the user desires to withdraw, ignored when `max=true` | | ||
| memo | string | Optional, used for ZHTLC and Tendermint coins only. Attaches a memo to the transaction. | | ||
| from | string | Optional, used only for transactions using a hardware wallet. For more information, see the [Trezor Integration guide](trezor_integration.html) | | ||
| max | bool | withdraw the maximum available amount | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, add Optional, defaults to false
for max.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| memo | string | Optional, used for ZHTLC and Tendermint coins only. Attaches a memo to the transaction. | | ||
| from | string | Optional, used only for transactions using a hardware wallet. For more information, see the [Trezor Integration guide](trezor_integration.html) | | ||
| max | bool | withdraw the maximum available amount | | ||
| fee.type | string | type of transaction fee; possible values: `UtxoFixed` or `UtxoPerKbyte` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fee
param is Optional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| amount | string (numeric) | the amount the user desires to withdraw, ignored when `max=true` | | ||
| max | bool | withdraw the maximum available amount | | ||
| fee.type | string | type of transaction fee; possible values: `UtxoFixed` or `UtxoPerKbyte` | | ||
| fee.amount | string (numeric) | fee amount in coin units, used only when type is `UtxoFixed` (fixed amount not depending on tx size) or `UtxoPerKbyte` (amount per Kbyte) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tho not seen in tx_history output as
"error_type":"NotSupportedFor","error_data":"ARRR"
Yep, thats correct, my_tx_history_v2_rpc
now works only for Bch, SlpToken, UtxoCoin, QtumCoin, Tendermint and TendermintToken
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent!
Couple more non critical notes
upd: I see everything is done :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! 🔥
closes #391
Converted to draft until updated method names are merged in API repo.