From fe0dcf9e8f445aa092e181664981e92f301e5f07 Mon Sep 17 00:00:00 2001 From: Andrew Nikitin Date: Fri, 10 Sep 2021 17:29:01 +0300 Subject: [PATCH 01/13] Pool/keys API documentaion Signed-off-by: Andrew Nikitin --- docs/pool_connection.md | 116 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 docs/pool_connection.md diff --git a/docs/pool_connection.md b/docs/pool_connection.md new file mode 100644 index 000000000..a5f5a5c5f --- /dev/null +++ b/docs/pool_connection.md @@ -0,0 +1,116 @@ +# Keys and pool API + +## Overview + +This page describes API about how to work with keys and how to connect to the pool. +All the libraries methods/calls are defined on the [`cheqd-sdk`](https://github.com/cheqd/cheqd-sdk) \(forked from [Evernym VDR Tools](https://gitlab.com/evernym/verity/vdr-tools)\). + +## Keys +### List of methods +* [`**indy_cheqd_keys_add_random**`](#indy_cheqd_keys_add_random) +* [`**indy_cheqd_keys_add_from_mnemonic**`](#indy_cheqd_keys_add_from_mnemonic) +* [`**indy_cheqd_keys_get_info**`](#indy_cheqd_keys_get_info) +* [`**indy_cheqd_keys_get_list_keys**`](#indy_cheqd_keys_get_list_keys) +* [`**indy_cheqd_keys_sign**`](#indy_cheqd_keys_sign) + +#### **indy_cheqd_keys_add_random** +This method implements the logic of creation a key just using `alias`, without specifying any other additional information, like mnemonic. +As result, the next structure is expected: +``` +alias: String, +// Cosmos address +account_id: String, +// Base58-encoded SEC1-encoded secp256k1 ECDSA key +pub_key: String, +``` + +#### **indy_cheqd_keys_add_from_mnemonic** +This method realised logic for recovering keys from `mnemonic` string. Mnemonic string - it's a human-readable combination of words, in general can include 12 or 24 words. +As result, the next structure is expected: +``` +alias: String, +// Cosmos address +account_id: String, +// Base58-encoded SEC1-encoded secp256k1 ECDSA key +pub_key: String, +``` + +#### **indy_cheqd_keys_get_info** +This method is needed for getting information about already generated and stored keys by using only an `alias`. +As result, the list of next structures is expected: +``` +alias: String, +// Cosmos address +account_id: String, +// Base58-encoded SEC1-encoded secp256k1 ECDSA key +pub_key: String, +``` + +#### **indy_cheqd_keys_get_list_keys** +The method returns a list of all keys which are placed locally. +As result, the next structure is expected: +``` +alias: String, +// Cosmos address +account_id: String, +// Base58-encoded SEC1-encoded secp256k1 ECDSA key +pub_key: String, +``` + +#### **indy_cheqd_keys_sign** +This method can sign a transaction by using a key which can be found by `alias` +As result, raw byte's string is expected. + +## Pool + +### list of methods +* [`**indy_cheqd_pool_add**`](#indy_cheqd_pool_add) +* [`**indy_cheqd_pool_get_config**`](#indy_cheqd_pool_get_config) +* [`**indy_cheqd_pool_get_all_config**`](#indy_cheqd_pool_get_all_config) +* [`**indy_cheqd_pool_broadcast_tx_commit**`](#indy_cheqd_pool_broadcast_tx_commit) +* [`**indy_cheqd_pool_abci_query**`](#indy_cheqd_pool_abci_query) +* [`**indy_cheqd_pool_abci_info**`](#indy_cheqd_pool_abci_info) + +#### **indy_cheqd_pool_add** +This method is needed for adding information about pool which will be used to connect to. +Input parameters: +* `alias` - is a human-readable string, +* `rpc_address` - address for connecting to the node, like `http://1.2.3.4:26657`, port `26657` is default value. +* `chain_id` - identifier of the network. +As result structure like PoolConfig is expected: +``` +alias: String, +rpc_address: String, +chain_id: String, +} +``` +#### **indy_cheqd_pool_get_config** +This method is needed for getting config information about connecting to the pool by alias. +Expected result is structure PoolConfig, like: +``` +alias: String, +rpc_address: String, +chain_id: String, +} +``` +#### **indy_cheqd_pool_get_all_config** +The same as [indy_cheqd_pool_get_config](#indy_cheqd_pool_get_config) but returns the list of structures. +#### **indy_cheqd_pool_broadcast_tx_commit** +This method allows to send a txn to all the nodes. +Request signed txn as input in raw format. +#### **indy_cheqd_pool_abci_query** +Needs to send abci_query to the pool. +With pool `alias` it requires request in json format as input parameter. +#### **indy_cheqd_pool_abci_info** +Get general pool information. +Reuires only `pool alias` +Returns the response in json format, like: +``` +"response": { + "data": "cheqdnode", + "version": "1.0", + "app_version": "1", + "last_block_height": "791638", + "last_block_app_hash": "dNurd7DVM06TCDJtZ4rd6RfWraKhxjptbARRbKPAF30=" + } +``` From 77eecec55f141ac3aa1c59339053fcf95b3d3937 Mon Sep 17 00:00:00 2001 From: Andrew Nikitin Date: Fri, 10 Sep 2021 17:39:28 +0300 Subject: [PATCH 02/13] Fix bolding Signed-off-by: Andrew Nikitin --- docs/pool_connection.md | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/docs/pool_connection.md b/docs/pool_connection.md index a5f5a5c5f..764fd69f6 100644 --- a/docs/pool_connection.md +++ b/docs/pool_connection.md @@ -7,11 +7,11 @@ All the libraries methods/calls are defined on the [`cheqd-sdk`](https://github. ## Keys ### List of methods -* [`**indy_cheqd_keys_add_random**`](#indy_cheqd_keys_add_random) -* [`**indy_cheqd_keys_add_from_mnemonic**`](#indy_cheqd_keys_add_from_mnemonic) -* [`**indy_cheqd_keys_get_info**`](#indy_cheqd_keys_get_info) -* [`**indy_cheqd_keys_get_list_keys**`](#indy_cheqd_keys_get_list_keys) -* [`**indy_cheqd_keys_sign**`](#indy_cheqd_keys_sign) +* [`indy_cheqd_keys_add_random`](#indy_cheqd_keys_add_random) +* [`indy_cheqd_keys_add_from_mnemonic`](#indy_cheqd_keys_add_from_mnemonic) +* [`indy_cheqd_keys_get_info`](#indy_cheqd_keys_get_info) +* [`indy_cheqd_keys_get_list_keys`](#indy_cheqd_keys_get_list_keys) +* [`indy_cheqd_keys_sign`](#indy_cheqd_keys_sign) #### **indy_cheqd_keys_add_random** This method implements the logic of creation a key just using `alias`, without specifying any other additional information, like mnemonic. @@ -64,12 +64,12 @@ As result, raw byte's string is expected. ## Pool ### list of methods -* [`**indy_cheqd_pool_add**`](#indy_cheqd_pool_add) -* [`**indy_cheqd_pool_get_config**`](#indy_cheqd_pool_get_config) -* [`**indy_cheqd_pool_get_all_config**`](#indy_cheqd_pool_get_all_config) -* [`**indy_cheqd_pool_broadcast_tx_commit**`](#indy_cheqd_pool_broadcast_tx_commit) -* [`**indy_cheqd_pool_abci_query**`](#indy_cheqd_pool_abci_query) -* [`**indy_cheqd_pool_abci_info**`](#indy_cheqd_pool_abci_info) +* [`indy_cheqd_pool_add`](#indy_cheqd_pool_add) +* [`indy_cheqd_pool_get_config`](#indy_cheqd_pool_get_config) +* [`indy_cheqd_pool_get_all_config`](#indy_cheqd_pool_get_all_config) +* [`indy_cheqd_pool_broadcast_tx_commit`](#indy_cheqd_pool_broadcast_tx_commit) +* [`indy_cheqd_pool_abci_query`](#indy_cheqd_pool_abci_query) +* [`indy_cheqd_pool_abci_info`](#indy_cheqd_pool_abci_info) #### **indy_cheqd_pool_add** This method is needed for adding information about pool which will be used to connect to. @@ -114,3 +114,8 @@ Returns the response in json format, like: "last_block_app_hash": "dNurd7DVM06TCDJtZ4rd6RfWraKhxjptbARRbKPAF30=" } ``` + +## Base connection workflow: +* Generate keys or restore them from mnemonic string. Useful methods here [`indy_cheqd_keys_add_random`](#indy_cheqd_keys_add_random) or [`indy_cheqd_keys_add_from_mnemonic`](#indy_cheqd_keys_add_from_mnemonic). +* Add configuration about pool, by calling [`indy_cheqd_pool_add`](#indy_cheqd_pool_add) +THe real connection will be created only when request or txn will be sent. From bcf4800d2804ca24d28ae8e2346144fbdb213ba2 Mon Sep 17 00:00:00 2001 From: Andrew Nikitin Date: Fri, 10 Sep 2021 19:37:05 +0300 Subject: [PATCH 03/13] Add real responses Signed-off-by: Andrew Nikitin --- docs/pool_connection.md | 150 ++++++++++++++++++++++++++++++---------- 1 file changed, 113 insertions(+), 37 deletions(-) diff --git a/docs/pool_connection.md b/docs/pool_connection.md index 764fd69f6..379f296dd 100644 --- a/docs/pool_connection.md +++ b/docs/pool_connection.md @@ -17,53 +17,56 @@ All the libraries methods/calls are defined on the [`cheqd-sdk`](https://github. This method implements the logic of creation a key just using `alias`, without specifying any other additional information, like mnemonic. As result, the next structure is expected: ``` -alias: String, -// Cosmos address -account_id: String, -// Base58-encoded SEC1-encoded secp256k1 ECDSA key -pub_key: String, +{ + "alias":"some_alias", + "account_id":"cosmos1gudhsalrhsurucr5gkvga5973359etv6q0xvwz", + "pub_key":"xSMzGopEnnTPCwjQwryDcrG9MGw3sVyb4ecYVaJrfkoA" +} ``` #### **indy_cheqd_keys_add_from_mnemonic** This method realised logic for recovering keys from `mnemonic` string. Mnemonic string - it's a human-readable combination of words, in general can include 12 or 24 words. As result, the next structure is expected: ``` -alias: String, -// Cosmos address -account_id: String, -// Base58-encoded SEC1-encoded secp256k1 ECDSA key -pub_key: String, +{ + "alias":"some_alias_2", + "account_id":"cosmos10hcwm576uprz53wj2p8vv2dg0u8zu3n6l0wsxr", + "pub_key":"fPn3LGakGrbHJTEk5fs7hAfa65DfpefgWawmwfCwjTHF" +} ``` #### **indy_cheqd_keys_get_info** This method is needed for getting information about already generated and stored keys by using only an `alias`. As result, the list of next structures is expected: ``` -alias: String, -// Cosmos address -account_id: String, -// Base58-encoded SEC1-encoded secp256k1 ECDSA key -pub_key: String, +{ + "alias":"some_alias", + "account_id":"cosmos17t7fmt3vpkkxa04hql0gyx8dufumq05vr9ztp6", + "pub_key":"juXSChod4MmAAniezu44pDtTMgTUizUi84RaWqnhf43j" +} ``` #### **indy_cheqd_keys_get_list_keys** The method returns a list of all keys which are placed locally. As result, the next structure is expected: ``` -alias: String, -// Cosmos address -account_id: String, -// Base58-encoded SEC1-encoded secp256k1 ECDSA key -pub_key: String, -``` + [ + Object({"account_id": String("cosmos1x33xkjd3gqlfhz5l9h60m53pr2mdd4y3nc86h0"), "alias": String("alice"), "pub_key": String("fTsZShn9KkgYKyDmbP5bLhVucNuPRdo4N6zGjAfzSSgv")}), + Object({"account_id": String("cosmos1c4n6j030trrljqsphmw9tcrcpgdf33hd3jd0jn"), "alias": String("some_alias_2"), "pub_key": String("g2vxGLkuYg84s3UcsKSxSttNgCKoQgRBQXizzSqbHdRJ")}), + Object({"account_id": String("cosmos1kcwadpmfreuvdrvkz7v79ydclfnn4ukdhp57c2"), "alias": String("some_alias_1"), "pub_key": String("27taHHmKLcxZEHQPmiNHuXTXQYF7u2CxGrzKQMxBZALsQ")}) + ] + ``` #### **indy_cheqd_keys_sign** This method can sign a transaction by using a key which can be found by `alias` As result, raw byte's string is expected. +``` +[10, 146, 1, 10, 134, 1, 10, 37, 47, 99, 104, 101, 113, 100, 105, 100, 46, 99, 104, 101, 113, 100, 110, 111, 100, 101, 46, 99, 104, 101, 113, 100, 46, 77, 115, 103, 67, 114, 101, 97, 116, 101, 78, 121, 109, 18, 93, 10, 45, 99, 111, 115, 109, 111, 115, 49, 120, 51, 51, 120, 107, 106, 100, 51, 103, 113, 108, 102, 104, 122, 53, 108, 57, 104, 54, 48, 109, 53, 51, 112, 114, 50, 109, 100, 100, 52, 121, 51, 110, 99, 56, 54, 104, 48, 18, 10, 116, 101, 115, 116, 45, 97, 108, 105, 97, 115, 26, 11, 116, 101, 115, 116, 45, 118, 101, 114, 107, 101, 121, 34, 8, 116, 101, 115, 116, 45, 100, 105, 100, 42, 9, 116, 101, 115, 116, 45, 114, 111, 108, 101, 18, 4, 109, 101, 109, 111, 24, 192, 2, 18, 97, 10, 78, 10, 70, 10, 31, 47, 99, 111, 115, 109, 111, 115, 46, 99, 114, 121, 112, 116, 111, 46, 115, 101, 99, 112, 50, 53, 54, 107, 49, 46, 80, 117, 98, 75, 101, 121, 18, 35, 10, 33, 2, 59, 126, 95, 52, 102, 213, 99, 251, 102, 62, 148, 101, 72, 226, 188, 243, 222, 31, 35, 148, 19, 127, 79, 75, 79, 37, 160, 132, 193, 33, 148, 7, 18, 4, 10, 2, 8, 1, 18, 15, 10, 9, 10, 4, 99, 104, 101, 113, 18, 1, 48, 16, 224, 167, 18, 26, 64, 130, 229, 164, 76, 214, 244, 157, 39, 135, 11, 118, 223, 29, 196, 41, 92, 247, 126, 129, 194, 18, 154, 136, 165, 153, 76, 202, 85, 187, 195, 40, 69, 10, 206, 165, 238, 223, 245, 35, 140, 92, 123, 246, 110, 23, 39, 32, 215, 239, 230, 196, 146, 168, 5, 147, 9, 67, 113, 242, 163, 0, 223, 233, 73] +``` ## Pool -### list of methods +### List of methods * [`indy_cheqd_pool_add`](#indy_cheqd_pool_add) * [`indy_cheqd_pool_get_config`](#indy_cheqd_pool_get_config) * [`indy_cheqd_pool_get_all_config`](#indy_cheqd_pool_get_all_config) @@ -77,42 +80,115 @@ Input parameters: * `alias` - is a human-readable string, * `rpc_address` - address for connecting to the node, like `http://1.2.3.4:26657`, port `26657` is default value. * `chain_id` - identifier of the network. -As result structure like PoolConfig is expected: +As result structure like PoolConfig is expected in response: ``` -alias: String, -rpc_address: String, -chain_id: String, +{ + "alias":"test_pool", + "rpc_address":"rpc_address", + "chain_id":"chain_id" } ``` #### **indy_cheqd_pool_get_config** This method is needed for getting config information about connecting to the pool by alias. Expected result is structure PoolConfig, like: ``` -alias: String, -rpc_address: String, -chain_id: String, +{ + "alias":"test_pool", + "rpc_address":"rpc_address", + "chain_id":"chain_id" } ``` #### **indy_cheqd_pool_get_all_config** The same as [indy_cheqd_pool_get_config](#indy_cheqd_pool_get_config) but returns the list of structures. +Response should be like: +``` +[Object({ + "alias": String("test_pool_1"), + "chain_id": String("chain_id"), + "rpc_address": String("rpc_address") +}), +Object({ + "alias": String("test_pool_2"), + "chain_id": String("chain_id"), + "rpc_address": String("rpc_address") +})] +``` #### **indy_cheqd_pool_broadcast_tx_commit** This method allows to send a txn to all the nodes. Request signed txn as input in raw format. +Expected response should be in json format like: +``` +{ + "check_tx": { + "code": 0, + "data": "", + "log": "[]", + "info": "", + "gas_wanted": "300000", + "gas_used": "38591", + "events": [], + "codespace": "" + }, + "deliver_tx": { + "code": 0, + "data": "Cg8KCUNyZWF0ZU55bRICCAU=", + "log": [{ + "events ": [{ + "type ": "message", + "attributes": [{ + "key": "action", + "value": "CreateNym" + }] + }] + }], + "info": "", + "gas_wanted": "300000", + "gas_used": "46474", + "events": [{ + "type": "message", + "attributes": [{ + "key": "YWN0aW9u", + "value": "Q3JlYXRlTnlt" + }] + }], + "codespace": "" + }, + "hash": "364441EDC5266A0B6AF5A67D4F05AC5D1FE95BFEDFBEBBE195723BEDBA877CAE", + "height": "121" +} +``` #### **indy_cheqd_pool_abci_query** Needs to send abci_query to the pool. With pool `alias` it requires request in json format as input parameter. +Expected response should be in json format like: +``` +{ + "nym": + { + "creator":"cosmos1x33xkjd3gqlfhz5l9h60m53pr2mdd4y3nc86h0", + "id":4, + "alias":"test-alias", + "verkey":"test-verkey", + "did":"test-did", + "role":"test-role" + } +} +``` #### **indy_cheqd_pool_abci_info** Get general pool information. -Reuires only `pool alias` +Requires only `pool alias` Returns the response in json format, like: ``` -"response": { - "data": "cheqdnode", - "version": "1.0", - "app_version": "1", - "last_block_height": "791638", - "last_block_app_hash": "dNurd7DVM06TCDJtZ4rd6RfWraKhxjptbARRbKPAF30=" - } +"{ + "response": + { + "data": "cheqd-node", + "version":"1.0", + "app_version":"1", + "last_block_height":"119", + "last_block_app_hash":[120,105,48,70,72,98,101,55,55,97,112,84,54,98,65,116,76,71,88,76,43,65,90,107,114,75,73,78,104,88,83,119,102,118,115,105,111,54,105,67,53,106,99,61] + } + } ``` ## Base connection workflow: From 013edfe67747b0a15a6fcc3814c1de96dfd2640e Mon Sep 17 00:00:00 2001 From: Andrew Nikitin Date: Fri, 10 Sep 2021 20:03:14 +0300 Subject: [PATCH 04/13] Add more information about inputs and responses Signed-off-by: Andrew Nikitin --- docs/pool_connection.md | 55 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 3 deletions(-) diff --git a/docs/pool_connection.md b/docs/pool_connection.md index 379f296dd..01cd09720 100644 --- a/docs/pool_connection.md +++ b/docs/pool_connection.md @@ -3,7 +3,7 @@ ## Overview This page describes API about how to work with keys and how to connect to the pool. -All the libraries methods/calls are defined on the [`cheqd-sdk`](https://github.com/cheqd/cheqd-sdk) \(forked from [Evernym VDR Tools](https://gitlab.com/evernym/verity/vdr-tools)\). +All the libraries methods/calls are defined on the [`cheqd-sdk`](https://github.com/cheqd/cheqd-sdk) (forked from [Evernym VDR Tools](https://gitlab.com/evernym/verity/vdr-tools) ). ## Keys ### List of methods @@ -15,6 +15,12 @@ All the libraries methods/calls are defined on the [`cheqd-sdk`](https://github. #### **indy_cheqd_keys_add_random** This method implements the logic of creation a key just using `alias`, without specifying any other additional information, like mnemonic. + +Input parameters: + +* `wallet_handle` - integer, which is connected to previously created and opened wallet. +* `alias` - human-readable representation of alias to user, + As result, the next structure is expected: ``` { @@ -26,6 +32,13 @@ As result, the next structure is expected: #### **indy_cheqd_keys_add_from_mnemonic** This method realised logic for recovering keys from `mnemonic` string. Mnemonic string - it's a human-readable combination of words, in general can include 12 or 24 words. + +Input parameters: + +* `wallet_handle` - integer, which is connected to previously created and opened wallet. +* `alias` - human-readable representation of alias to user, +* `mnemonic` - string of 12 or 24 words. + As result, the next structure is expected: ``` { @@ -37,6 +50,12 @@ As result, the next structure is expected: #### **indy_cheqd_keys_get_info** This method is needed for getting information about already generated and stored keys by using only an `alias`. + +Input parameters: + +* `wallet_handle` - integer, which is connected to previously created and opened wallet. +* `alias` - human-readable representation of alias to user, + As result, the list of next structures is expected: ``` { @@ -48,6 +67,11 @@ As result, the list of next structures is expected: #### **indy_cheqd_keys_get_list_keys** The method returns a list of all keys which are placed locally. + +Input parameters: + +* `wallet_handle` - integer, which is connected to previously created and opened wallet. + As result, the next structure is expected: ``` [ @@ -59,6 +83,14 @@ As result, the next structure is expected: #### **indy_cheqd_keys_sign** This method can sign a transaction by using a key which can be found by `alias` + +Input parameters: + +* `wallet_handle` - integer, which is connected to previously created and opened wallet. +* `alias` - human-readable representation of alias to user, +* `tx_raw` - byte representation of transaction, +* `tx_len` - length of string with bytes of transaction, + As result, raw byte's string is expected. ``` [10, 146, 1, 10, 134, 1, 10, 37, 47, 99, 104, 101, 113, 100, 105, 100, 46, 99, 104, 101, 113, 100, 110, 111, 100, 101, 46, 99, 104, 101, 113, 100, 46, 77, 115, 103, 67, 114, 101, 97, 116, 101, 78, 121, 109, 18, 93, 10, 45, 99, 111, 115, 109, 111, 115, 49, 120, 51, 51, 120, 107, 106, 100, 51, 103, 113, 108, 102, 104, 122, 53, 108, 57, 104, 54, 48, 109, 53, 51, 112, 114, 50, 109, 100, 100, 52, 121, 51, 110, 99, 56, 54, 104, 48, 18, 10, 116, 101, 115, 116, 45, 97, 108, 105, 97, 115, 26, 11, 116, 101, 115, 116, 45, 118, 101, 114, 107, 101, 121, 34, 8, 116, 101, 115, 116, 45, 100, 105, 100, 42, 9, 116, 101, 115, 116, 45, 114, 111, 108, 101, 18, 4, 109, 101, 109, 111, 24, 192, 2, 18, 97, 10, 78, 10, 70, 10, 31, 47, 99, 111, 115, 109, 111, 115, 46, 99, 114, 121, 112, 116, 111, 46, 115, 101, 99, 112, 50, 53, 54, 107, 49, 46, 80, 117, 98, 75, 101, 121, 18, 35, 10, 33, 2, 59, 126, 95, 52, 102, 213, 99, 251, 102, 62, 148, 101, 72, 226, 188, 243, 222, 31, 35, 148, 19, 127, 79, 75, 79, 37, 160, 132, 193, 33, 148, 7, 18, 4, 10, 2, 8, 1, 18, 15, 10, 9, 10, 4, 99, 104, 101, 113, 18, 1, 48, 16, 224, 167, 18, 26, 64, 130, 229, 164, 76, 214, 244, 157, 39, 135, 11, 118, 223, 29, 196, 41, 92, 247, 126, 129, 194, 18, 154, 136, 165, 153, 76, 202, 85, 187, 195, 40, 69, 10, 206, 165, 238, 223, 245, 35, 140, 92, 123, 246, 110, 23, 39, 32, 215, 239, 230, 196, 146, 168, 5, 147, 9, 67, 113, 242, 163, 0, 223, 233, 73] @@ -76,6 +108,7 @@ As result, raw byte's string is expected. #### **indy_cheqd_pool_add** This method is needed for adding information about pool which will be used to connect to. + Input parameters: * `alias` - is a human-readable string, * `rpc_address` - address for connecting to the node, like `http://1.2.3.4:26657`, port `26657` is default value. @@ -90,6 +123,10 @@ As result structure like PoolConfig is expected in response: ``` #### **indy_cheqd_pool_get_config** This method is needed for getting config information about connecting to the pool by alias. + +Input parameters: +* `alias` - human-readable string, represents pool alias, like `test_pool`. + Expected result is structure PoolConfig, like: ``` { @@ -115,6 +152,12 @@ Object({ ``` #### **indy_cheqd_pool_broadcast_tx_commit** This method allows to send a txn to all the nodes. + +Input parameters: +* `pool_alias` - human-readable string, like `test_pool`, +* `signed_tx_raw` - string of bytes which includes raw signed transaction, +* `signed_tx_len` - length of signed txn string, + Request signed txn as input in raw format. Expected response should be in json format like: ``` @@ -160,6 +203,11 @@ Expected response should be in json format like: #### **indy_cheqd_pool_abci_query** Needs to send abci_query to the pool. With pool `alias` it requires request in json format as input parameter. + +Input parameters: +* `pool_alias` - human-readable string, like `test_pool`, +* `req_json`- String of ABCI query in json format, + Expected response should be in json format like: ``` { @@ -176,7 +224,7 @@ Expected response should be in json format like: ``` #### **indy_cheqd_pool_abci_info** Get general pool information. -Requires only `pool alias` +Requires only `pool alias` as input parameter. Returns the response in json format, like: ``` "{ @@ -194,4 +242,5 @@ Returns the response in json format, like: ## Base connection workflow: * Generate keys or restore them from mnemonic string. Useful methods here [`indy_cheqd_keys_add_random`](#indy_cheqd_keys_add_random) or [`indy_cheqd_keys_add_from_mnemonic`](#indy_cheqd_keys_add_from_mnemonic). * Add configuration about pool, by calling [`indy_cheqd_pool_add`](#indy_cheqd_pool_add) -THe real connection will be created only when request or txn will be sent. + +The real connection will be created only when request or txn will be sent. From 8c40d1271fe55d26a66554baf60518b6de5b56fd Mon Sep 17 00:00:00 2001 From: Ankur Banerjee Date: Thu, 24 Feb 2022 00:20:05 +0000 Subject: [PATCH 05/13] Renamed the file and moved in menu tree --- .../ledger-connection.md} | 65 +++++++++++-------- 1 file changed, 39 insertions(+), 26 deletions(-) rename docs/{pool_connection.md => identity-api/ledger-connection.md} (75%) diff --git a/docs/pool_connection.md b/docs/identity-api/ledger-connection.md similarity index 75% rename from docs/pool_connection.md rename to docs/identity-api/ledger-connection.md index 01cd09720..0956861b0 100644 --- a/docs/pool_connection.md +++ b/docs/identity-api/ledger-connection.md @@ -1,36 +1,36 @@ -# Keys and pool API +# VDR Tools SDK ledger connection API ## Overview -This page describes API about how to work with keys and how to connect to the pool. -All the libraries methods/calls are defined on the [`cheqd-sdk`](https://github.com/cheqd/cheqd-sdk) (forked from [Evernym VDR Tools](https://gitlab.com/evernym/verity/vdr-tools) ). +This page describes the API for how [Evernym VDR Tools](https://gitlab.com/evernym/verity/vdr-tools) works with identity wallet keys and how it connects to the ledger "pool". -## Keys -### List of methods -* [`indy_cheqd_keys_add_random`](#indy_cheqd_keys_add_random) -* [`indy_cheqd_keys_add_from_mnemonic`](#indy_cheqd_keys_add_from_mnemonic) -* [`indy_cheqd_keys_get_info`](#indy_cheqd_keys_get_info) -* [`indy_cheqd_keys_get_list_keys`](#indy_cheqd_keys_get_list_keys) -* [`indy_cheqd_keys_sign`](#indy_cheqd_keys_sign) +It is worth noting here that the terminology of "pool" connection is specifically a legacy term originally used in [Hyperledger Indy](https://github.com/hyperledger/indy-node), which as a permissioned blockchain assumes there is a finite pools of servers. While this paradigm is no longer true in the public, permissionless world of the cheqd network, the identity APIs in VDR Tools SDK and similar Hyperledger Aries-based frameworks is retained for explanations. -#### **indy_cheqd_keys_add_random** -This method implements the logic of creation a key just using `alias`, without specifying any other additional information, like mnemonic. +## Identity wallet key methods -Input parameters: +For compatibility purposes, VDR Tools SDK method names use the `indy_` prefix. This may be updated in the future as work is done on the upstream project to refactor method names to be ledger-agnostic. -* `wallet_handle` - integer, which is connected to previously created and opened wallet. -* `alias` - human-readable representation of alias to user, +### indy_cheqd_keys_add_random -As result, the next structure is expected: -``` +This method implements the logic of identity wallet key creation just using `alias`, without specifying any other additional information, like mnemonic. + +#### Input parameters + +* `wallet_handle` (integer): Linked to previously created and opened wallet. +* `alias` (string): Human-readable representation of alias to user, + +#### Example output + +```jsonc { - "alias":"some_alias", - "account_id":"cosmos1gudhsalrhsurucr5gkvga5973359etv6q0xvwz", + "alias": "some_alias", + "account_id":"cheqd1gudhsalrhsurucr5gkvga5973359etv6q0xvwz", "pub_key":"xSMzGopEnnTPCwjQwryDcrG9MGw3sVyb4ecYVaJrfkoA" } ``` -#### **indy_cheqd_keys_add_from_mnemonic** +### indy_cheqd_keys_add_from_mnemonic + This method realised logic for recovering keys from `mnemonic` string. Mnemonic string - it's a human-readable combination of words, in general can include 12 or 24 words. Input parameters: @@ -99,12 +99,25 @@ As result, raw byte's string is expected. ## Pool ### List of methods -* [`indy_cheqd_pool_add`](#indy_cheqd_pool_add) -* [`indy_cheqd_pool_get_config`](#indy_cheqd_pool_get_config) -* [`indy_cheqd_pool_get_all_config`](#indy_cheqd_pool_get_all_config) -* [`indy_cheqd_pool_broadcast_tx_commit`](#indy_cheqd_pool_broadcast_tx_commit) -* [`indy_cheqd_pool_abci_query`](#indy_cheqd_pool_abci_query) -* [`indy_cheqd_pool_abci_info`](#indy_cheqd_pool_abci_info) +- [VDR Tools SDK ledger connection API](#vdr-tools-sdk-ledger-connection-api) + - [Overview](#overview) + - [Identity wallet key methods](#identity-wallet-key-methods) + - [indy_cheqd_keys_add_random](#indy_cheqd_keys_add_random) + - [Input parameters](#input-parameters) + - [Example output](#example-output) + - [indy_cheqd_keys_add_from_mnemonic](#indy_cheqd_keys_add_from_mnemonic) + - [**indy_cheqd_keys_get_info**](#indy_cheqd_keys_get_info) + - [**indy_cheqd_keys_get_list_keys**](#indy_cheqd_keys_get_list_keys) + - [**indy_cheqd_keys_sign**](#indy_cheqd_keys_sign) + - [Pool](#pool) + - [List of methods](#list-of-methods) + - [**indy_cheqd_pool_add**](#indy_cheqd_pool_add) + - [**indy_cheqd_pool_get_config**](#indy_cheqd_pool_get_config) + - [**indy_cheqd_pool_get_all_config**](#indy_cheqd_pool_get_all_config) + - [**indy_cheqd_pool_broadcast_tx_commit**](#indy_cheqd_pool_broadcast_tx_commit) + - [**indy_cheqd_pool_abci_query**](#indy_cheqd_pool_abci_query) + - [**indy_cheqd_pool_abci_info**](#indy_cheqd_pool_abci_info) + - [Base connection workflow:](#base-connection-workflow) #### **indy_cheqd_pool_add** This method is needed for adding information about pool which will be used to connect to. From 3c0cb4d22d27d071b80521a01a448e80cb8633ea Mon Sep 17 00:00:00 2001 From: Ankur Banerjee Date: Thu, 24 Feb 2022 00:28:45 +0000 Subject: [PATCH 06/13] Making formatting more consistent with current standards --- docs/identity-api/ledger-connection.md | 38 ++++++++++++++------------ 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/docs/identity-api/ledger-connection.md b/docs/identity-api/ledger-connection.md index 0956861b0..f9c3551ed 100644 --- a/docs/identity-api/ledger-connection.md +++ b/docs/identity-api/ledger-connection.md @@ -17,44 +17,46 @@ This method implements the logic of identity wallet key creation just using `ali #### Input parameters * `wallet_handle` (integer): Linked to previously created and opened wallet. -* `alias` (string): Human-readable representation of alias to user, +* `alias` (string): Memorable key name/alias that makes it easier to reference for a user. #### Example output ```jsonc { "alias": "some_alias", - "account_id":"cheqd1gudhsalrhsurucr5gkvga5973359etv6q0xvwz", - "pub_key":"xSMzGopEnnTPCwjQwryDcrG9MGw3sVyb4ecYVaJrfkoA" + "account_id": "cheqd1gudhsalrhsurucr5gkvga5973359etv6q0xvwz", + "pub_key": "xSMzGopEnnTPCwjQwryDcrG9MGw3sVyb4ecYVaJrfkoA" } ``` ### indy_cheqd_keys_add_from_mnemonic -This method realised logic for recovering keys from `mnemonic` string. Mnemonic string - it's a human-readable combination of words, in general can include 12 or 24 words. +This method implements logic similar to that used in [cheqd CLI to recover a key](../cheqd-cli/cheqd-cli-key-management.md) in the identity wallet from a mnemonic. -Input parameters: +#### Input parameters -* `wallet_handle` - integer, which is connected to previously created and opened wallet. -* `alias` - human-readable representation of alias to user, -* `mnemonic` - string of 12 or 24 words. +* `wallet_handle` (integer): Linked to previously created and opened wallet. +* `alias` (string): Memorable key name/alias that makes it easier to reference for a user. +* `mnemonic` (string): 12 or 24 word seed phrase to recover the keys associated with a wallet. -As result, the next structure is expected: -``` +#### Example result + +```jsonc { - "alias":"some_alias_2", - "account_id":"cosmos10hcwm576uprz53wj2p8vv2dg0u8zu3n6l0wsxr", - "pub_key":"fPn3LGakGrbHJTEk5fs7hAfa65DfpefgWawmwfCwjTHF" + "alias": "some_alias_2", + "account_id": "cheqd10hcwm576uprz53wj2p8vv2dg0u8zu3n6l0wsxr", + "pub_key": "fPn3LGakGrbHJTEk5fs7hAfa65DfpefgWawmwfCwjTHF" } ``` -#### **indy_cheqd_keys_get_info** +#### indy_cheqd_keys_get_info + This method is needed for getting information about already generated and stored keys by using only an `alias`. Input parameters: * `wallet_handle` - integer, which is connected to previously created and opened wallet. -* `alias` - human-readable representation of alias to user, +* `alias` (string): Memorable key name/alias that makes it easier to reference for a user. As result, the list of next structures is expected: ``` @@ -87,7 +89,7 @@ This method can sign a transaction by using a key which can be found by `alias` Input parameters: * `wallet_handle` - integer, which is connected to previously created and opened wallet. -* `alias` - human-readable representation of alias to user, +* `alias` (string): Memorable key name/alias that makes it easier to reference for a user. * `tx_raw` - byte representation of transaction, * `tx_len` - length of string with bytes of transaction, @@ -106,7 +108,9 @@ As result, raw byte's string is expected. - [Input parameters](#input-parameters) - [Example output](#example-output) - [indy_cheqd_keys_add_from_mnemonic](#indy_cheqd_keys_add_from_mnemonic) - - [**indy_cheqd_keys_get_info**](#indy_cheqd_keys_get_info) + - [Input parameters](#input-parameters-1) + - [Example result](#example-result) + - [indy_cheqd_keys_get_info](#indy_cheqd_keys_get_info) - [**indy_cheqd_keys_get_list_keys**](#indy_cheqd_keys_get_list_keys) - [**indy_cheqd_keys_sign**](#indy_cheqd_keys_sign) - [Pool](#pool) From f2696077f79777dac56104073690da301c0be3d1 Mon Sep 17 00:00:00 2001 From: Ankur Banerjee Date: Thu, 24 Feb 2022 10:59:25 +0000 Subject: [PATCH 07/13] Split key management to its own page --- docs/identity-api/ledger-connection.md | 263 ------------------ .../vdr-tools-sdk-key-management.md | 104 +++++++ 2 files changed, 104 insertions(+), 263 deletions(-) delete mode 100644 docs/identity-api/ledger-connection.md create mode 100644 docs/identity-api/vdr-tools-sdk-key-management.md diff --git a/docs/identity-api/ledger-connection.md b/docs/identity-api/ledger-connection.md deleted file mode 100644 index f9c3551ed..000000000 --- a/docs/identity-api/ledger-connection.md +++ /dev/null @@ -1,263 +0,0 @@ -# VDR Tools SDK ledger connection API - -## Overview - -This page describes the API for how [Evernym VDR Tools](https://gitlab.com/evernym/verity/vdr-tools) works with identity wallet keys and how it connects to the ledger "pool". - -It is worth noting here that the terminology of "pool" connection is specifically a legacy term originally used in [Hyperledger Indy](https://github.com/hyperledger/indy-node), which as a permissioned blockchain assumes there is a finite pools of servers. While this paradigm is no longer true in the public, permissionless world of the cheqd network, the identity APIs in VDR Tools SDK and similar Hyperledger Aries-based frameworks is retained for explanations. - -## Identity wallet key methods - -For compatibility purposes, VDR Tools SDK method names use the `indy_` prefix. This may be updated in the future as work is done on the upstream project to refactor method names to be ledger-agnostic. - -### indy_cheqd_keys_add_random - -This method implements the logic of identity wallet key creation just using `alias`, without specifying any other additional information, like mnemonic. - -#### Input parameters - -* `wallet_handle` (integer): Linked to previously created and opened wallet. -* `alias` (string): Memorable key name/alias that makes it easier to reference for a user. - -#### Example output - -```jsonc -{ - "alias": "some_alias", - "account_id": "cheqd1gudhsalrhsurucr5gkvga5973359etv6q0xvwz", - "pub_key": "xSMzGopEnnTPCwjQwryDcrG9MGw3sVyb4ecYVaJrfkoA" -} -``` - -### indy_cheqd_keys_add_from_mnemonic - -This method implements logic similar to that used in [cheqd CLI to recover a key](../cheqd-cli/cheqd-cli-key-management.md) in the identity wallet from a mnemonic. - -#### Input parameters - -* `wallet_handle` (integer): Linked to previously created and opened wallet. -* `alias` (string): Memorable key name/alias that makes it easier to reference for a user. -* `mnemonic` (string): 12 or 24 word seed phrase to recover the keys associated with a wallet. - -#### Example result - -```jsonc -{ - "alias": "some_alias_2", - "account_id": "cheqd10hcwm576uprz53wj2p8vv2dg0u8zu3n6l0wsxr", - "pub_key": "fPn3LGakGrbHJTEk5fs7hAfa65DfpefgWawmwfCwjTHF" -} -``` - -#### indy_cheqd_keys_get_info - -This method is needed for getting information about already generated and stored keys by using only an `alias`. - -Input parameters: - -* `wallet_handle` - integer, which is connected to previously created and opened wallet. -* `alias` (string): Memorable key name/alias that makes it easier to reference for a user. - -As result, the list of next structures is expected: -``` -{ - "alias":"some_alias", - "account_id":"cosmos17t7fmt3vpkkxa04hql0gyx8dufumq05vr9ztp6", - "pub_key":"juXSChod4MmAAniezu44pDtTMgTUizUi84RaWqnhf43j" -} -``` - -#### **indy_cheqd_keys_get_list_keys** -The method returns a list of all keys which are placed locally. - -Input parameters: - -* `wallet_handle` - integer, which is connected to previously created and opened wallet. - -As result, the next structure is expected: -``` - [ - Object({"account_id": String("cosmos1x33xkjd3gqlfhz5l9h60m53pr2mdd4y3nc86h0"), "alias": String("alice"), "pub_key": String("fTsZShn9KkgYKyDmbP5bLhVucNuPRdo4N6zGjAfzSSgv")}), - Object({"account_id": String("cosmos1c4n6j030trrljqsphmw9tcrcpgdf33hd3jd0jn"), "alias": String("some_alias_2"), "pub_key": String("g2vxGLkuYg84s3UcsKSxSttNgCKoQgRBQXizzSqbHdRJ")}), - Object({"account_id": String("cosmos1kcwadpmfreuvdrvkz7v79ydclfnn4ukdhp57c2"), "alias": String("some_alias_1"), "pub_key": String("27taHHmKLcxZEHQPmiNHuXTXQYF7u2CxGrzKQMxBZALsQ")}) - ] - ``` - -#### **indy_cheqd_keys_sign** -This method can sign a transaction by using a key which can be found by `alias` - -Input parameters: - -* `wallet_handle` - integer, which is connected to previously created and opened wallet. -* `alias` (string): Memorable key name/alias that makes it easier to reference for a user. -* `tx_raw` - byte representation of transaction, -* `tx_len` - length of string with bytes of transaction, - -As result, raw byte's string is expected. -``` -[10, 146, 1, 10, 134, 1, 10, 37, 47, 99, 104, 101, 113, 100, 105, 100, 46, 99, 104, 101, 113, 100, 110, 111, 100, 101, 46, 99, 104, 101, 113, 100, 46, 77, 115, 103, 67, 114, 101, 97, 116, 101, 78, 121, 109, 18, 93, 10, 45, 99, 111, 115, 109, 111, 115, 49, 120, 51, 51, 120, 107, 106, 100, 51, 103, 113, 108, 102, 104, 122, 53, 108, 57, 104, 54, 48, 109, 53, 51, 112, 114, 50, 109, 100, 100, 52, 121, 51, 110, 99, 56, 54, 104, 48, 18, 10, 116, 101, 115, 116, 45, 97, 108, 105, 97, 115, 26, 11, 116, 101, 115, 116, 45, 118, 101, 114, 107, 101, 121, 34, 8, 116, 101, 115, 116, 45, 100, 105, 100, 42, 9, 116, 101, 115, 116, 45, 114, 111, 108, 101, 18, 4, 109, 101, 109, 111, 24, 192, 2, 18, 97, 10, 78, 10, 70, 10, 31, 47, 99, 111, 115, 109, 111, 115, 46, 99, 114, 121, 112, 116, 111, 46, 115, 101, 99, 112, 50, 53, 54, 107, 49, 46, 80, 117, 98, 75, 101, 121, 18, 35, 10, 33, 2, 59, 126, 95, 52, 102, 213, 99, 251, 102, 62, 148, 101, 72, 226, 188, 243, 222, 31, 35, 148, 19, 127, 79, 75, 79, 37, 160, 132, 193, 33, 148, 7, 18, 4, 10, 2, 8, 1, 18, 15, 10, 9, 10, 4, 99, 104, 101, 113, 18, 1, 48, 16, 224, 167, 18, 26, 64, 130, 229, 164, 76, 214, 244, 157, 39, 135, 11, 118, 223, 29, 196, 41, 92, 247, 126, 129, 194, 18, 154, 136, 165, 153, 76, 202, 85, 187, 195, 40, 69, 10, 206, 165, 238, 223, 245, 35, 140, 92, 123, 246, 110, 23, 39, 32, 215, 239, 230, 196, 146, 168, 5, 147, 9, 67, 113, 242, 163, 0, 223, 233, 73] -``` - -## Pool - -### List of methods -- [VDR Tools SDK ledger connection API](#vdr-tools-sdk-ledger-connection-api) - - [Overview](#overview) - - [Identity wallet key methods](#identity-wallet-key-methods) - - [indy_cheqd_keys_add_random](#indy_cheqd_keys_add_random) - - [Input parameters](#input-parameters) - - [Example output](#example-output) - - [indy_cheqd_keys_add_from_mnemonic](#indy_cheqd_keys_add_from_mnemonic) - - [Input parameters](#input-parameters-1) - - [Example result](#example-result) - - [indy_cheqd_keys_get_info](#indy_cheqd_keys_get_info) - - [**indy_cheqd_keys_get_list_keys**](#indy_cheqd_keys_get_list_keys) - - [**indy_cheqd_keys_sign**](#indy_cheqd_keys_sign) - - [Pool](#pool) - - [List of methods](#list-of-methods) - - [**indy_cheqd_pool_add**](#indy_cheqd_pool_add) - - [**indy_cheqd_pool_get_config**](#indy_cheqd_pool_get_config) - - [**indy_cheqd_pool_get_all_config**](#indy_cheqd_pool_get_all_config) - - [**indy_cheqd_pool_broadcast_tx_commit**](#indy_cheqd_pool_broadcast_tx_commit) - - [**indy_cheqd_pool_abci_query**](#indy_cheqd_pool_abci_query) - - [**indy_cheqd_pool_abci_info**](#indy_cheqd_pool_abci_info) - - [Base connection workflow:](#base-connection-workflow) - -#### **indy_cheqd_pool_add** -This method is needed for adding information about pool which will be used to connect to. - -Input parameters: -* `alias` - is a human-readable string, -* `rpc_address` - address for connecting to the node, like `http://1.2.3.4:26657`, port `26657` is default value. -* `chain_id` - identifier of the network. -As result structure like PoolConfig is expected in response: -``` -{ - "alias":"test_pool", - "rpc_address":"rpc_address", - "chain_id":"chain_id" -} -``` -#### **indy_cheqd_pool_get_config** -This method is needed for getting config information about connecting to the pool by alias. - -Input parameters: -* `alias` - human-readable string, represents pool alias, like `test_pool`. - -Expected result is structure PoolConfig, like: -``` -{ - "alias":"test_pool", - "rpc_address":"rpc_address", - "chain_id":"chain_id" -} -``` -#### **indy_cheqd_pool_get_all_config** -The same as [indy_cheqd_pool_get_config](#indy_cheqd_pool_get_config) but returns the list of structures. -Response should be like: -``` -[Object({ - "alias": String("test_pool_1"), - "chain_id": String("chain_id"), - "rpc_address": String("rpc_address") -}), -Object({ - "alias": String("test_pool_2"), - "chain_id": String("chain_id"), - "rpc_address": String("rpc_address") -})] -``` -#### **indy_cheqd_pool_broadcast_tx_commit** -This method allows to send a txn to all the nodes. - -Input parameters: -* `pool_alias` - human-readable string, like `test_pool`, -* `signed_tx_raw` - string of bytes which includes raw signed transaction, -* `signed_tx_len` - length of signed txn string, - -Request signed txn as input in raw format. -Expected response should be in json format like: -``` -{ - "check_tx": { - "code": 0, - "data": "", - "log": "[]", - "info": "", - "gas_wanted": "300000", - "gas_used": "38591", - "events": [], - "codespace": "" - }, - "deliver_tx": { - "code": 0, - "data": "Cg8KCUNyZWF0ZU55bRICCAU=", - "log": [{ - "events ": [{ - "type ": "message", - "attributes": [{ - "key": "action", - "value": "CreateNym" - }] - }] - }], - "info": "", - "gas_wanted": "300000", - "gas_used": "46474", - "events": [{ - "type": "message", - "attributes": [{ - "key": "YWN0aW9u", - "value": "Q3JlYXRlTnlt" - }] - }], - "codespace": "" - }, - "hash": "364441EDC5266A0B6AF5A67D4F05AC5D1FE95BFEDFBEBBE195723BEDBA877CAE", - "height": "121" -} -``` -#### **indy_cheqd_pool_abci_query** -Needs to send abci_query to the pool. -With pool `alias` it requires request in json format as input parameter. - -Input parameters: -* `pool_alias` - human-readable string, like `test_pool`, -* `req_json`- String of ABCI query in json format, - -Expected response should be in json format like: -``` -{ - "nym": - { - "creator":"cosmos1x33xkjd3gqlfhz5l9h60m53pr2mdd4y3nc86h0", - "id":4, - "alias":"test-alias", - "verkey":"test-verkey", - "did":"test-did", - "role":"test-role" - } -} -``` -#### **indy_cheqd_pool_abci_info** -Get general pool information. -Requires only `pool alias` as input parameter. -Returns the response in json format, like: -``` -"{ - "response": - { - "data": "cheqd-node", - "version":"1.0", - "app_version":"1", - "last_block_height":"119", - "last_block_app_hash":[120,105,48,70,72,98,101,55,55,97,112,84,54,98,65,116,76,71,88,76,43,65,90,107,114,75,73,78,104,88,83,119,102,118,115,105,111,54,105,67,53,106,99,61] - } - } -``` - -## Base connection workflow: -* Generate keys or restore them from mnemonic string. Useful methods here [`indy_cheqd_keys_add_random`](#indy_cheqd_keys_add_random) or [`indy_cheqd_keys_add_from_mnemonic`](#indy_cheqd_keys_add_from_mnemonic). -* Add configuration about pool, by calling [`indy_cheqd_pool_add`](#indy_cheqd_pool_add) - -The real connection will be created only when request or txn will be sent. diff --git a/docs/identity-api/vdr-tools-sdk-key-management.md b/docs/identity-api/vdr-tools-sdk-key-management.md new file mode 100644 index 000000000..c1f6d75cb --- /dev/null +++ b/docs/identity-api/vdr-tools-sdk-key-management.md @@ -0,0 +1,104 @@ +# Key management in VDR Tools SDK + +## Overview + +This page describes how [Evernym VDR Tools](https://gitlab.com/evernym/verity/vdr-tools) works with cheqd accounts in identity wallets built using the VDR Tools SDK. + +## Identity wallet key methods + +These methods below are used to manage cheqd wallets/keys within identity wallets built using VDR Tools SDK. (For example, to pay for or receive payment for transactions that need to be written to ledger.) + +For compatibility purposes, VDR Tools SDK method names use the `indy_` prefix. This may be updated in the future as work is done on the upstream project to refactor method names to be ledger-agnostic. + +### indy_cheqd_keys_add_random + +Create a new identity wallet key with specified `alias`, without specifying any other additional information, such as mnemonics. + +#### Input parameters + +* `wallet_handle` (integer): Linked to previously created and opened wallet. +* `alias` (string): Memorable key name/alias that makes it easier to reference for a user. + +#### Example output + +```jsonc +{ + "alias": "some_alias", + "account_id": "cheqd1gudhsalrhsurucr5gkvga5973359etv6q0xvwz", + "pub_key": "xSMzGopEnnTPCwjQwryDcrG9MGw3sVyb4ecYVaJrfkoA" +} +``` + +### indy_cheqd_keys_add_from_mnemonic + +Similar to the technique used in [cheqd CLI to recover a key](../cheqd-cli/cheqd-cli-key-management.md), it allows identity wallets that use VDR Tools SDK to recover a key from mnemonic. + +#### Input parameters + +* `wallet_handle` (integer): Linked to previously created and opened wallet. +* `alias` (string): Memorable key name/alias that makes it easier to reference for a user. +* `mnemonic` (string): 12 or 24 word seed phrase to recover the keys associated with a wallet. + +#### Example output + +```jsonc +{ + "alias": "some_alias_2", + "account_id": "cheqd10hcwm576uprz53wj2p8vv2dg0u8zu3n6l0wsxr", + "pub_key": "fPn3LGakGrbHJTEk5fs7hAfa65DfpefgWawmwfCwjTHF" +} +``` + +### indy_cheqd_keys_get_info + +Display information about an existing key based on its `alias` in an identity wallet. + +#### Input parameters + +* `wallet_handle` (integer): Linked to previously created and opened wallet. +* `alias` (string): Memorable key name/alias that makes it easier to reference for a user. + +#### Example output + +```jsonc +{ + "alias": "some_alias", + "account_id": "cheqd17t7fmt3vpkkxa04hql0gyx8dufumq05vr9ztp6", + "pub_key": "juXSChod4MmAAniezu44pDtTMgTUizUi84RaWqnhf43j" +} +``` + +### indy_cheqd_keys_get_list_keys + +Return a list of all keys stored in the local identity wallet. + +#### Input parameters + +* `wallet_handle` (integer): Linked to previously created and opened wallet. + +#### Example output + +```text + [ + Object({"account_id": String("cheqd1x33xkjd3gqlfhz5l9h60m53pr2mdd4y3nc86h0"), "alias": String("alice"), "pub_key": String("fTsZShn9KkgYKyDmbP5bLhVucNuPRdo4N6zGjAfzSSgv")}), + Object({"account_id": String("cheqd1c4n6j030trrljqsphmw9tcrcpgdf33hd3jd0jn"), "alias": String("some_alias_2"), "pub_key": String("g2vxGLkuYg84s3UcsKSxSttNgCKoQgRBQXizzSqbHdRJ")}), + Object({"account_id": String("cheqd1kcwadpmfreuvdrvkz7v79ydclfnn4ukdhp57c2"), "alias": String("some_alias_1"), "pub_key": String("27taHHmKLcxZEHQPmiNHuXTXQYF7u2CxGrzKQMxBZALsQ")}) + ] + ``` + +### indy_cheqd_keys_sign + +Sign a transaction using key in identity wallet with specified `alias`. The cheqd account associated with the key must have sufficient balance to fund the transaction. + +#### Input parameters + +* `wallet_handle` (integer): Linked to previously created and opened wallet. +* `alias` (string): Memorable key name/alias that makes it easier to reference for a user. +* `tx_raw`: Raw bytecode representation of of a correctly formattted cheqd/Cosmos transaction. +* `tx_len`: Length of string for bytes in transaction. + +#### Example output + +``` +[10, 146, 1, 10, 134, 1, 10, 37, 47, 99, 104, 101, 113, 100, 105, 100, 46, 99, 104, 101, 113, 100, 110, 111, 100, 101, 46, 99, 104, 101, 113, 100, 46, 77, 115, 103, 67, 114, 101, 97, 116, 101, 78, 121, 109, 18, 93, 10, 45, 99, 111, 115, 109, 111, 115, 49, 120, 51, 51, 120, 107, 106, 100, 51, 103, 113, 108, 102, 104, 122, 53, 108, 57, 104, 54, 48, 109, 53, 51, 112, 114, 50, 109, 100, 100, 52, 121, 51, 110, 99, 56, 54, 104, 48, 18, 10, 116, 101, 115, 116, 45, 97, 108, 105, 97, 115, 26, 11, 116, 101, 115, 116, 45, 118, 101, 114, 107, 101, 121, 34, 8, 116, 101, 115, 116, 45, 100, 105, 100, 42, 9, 116, 101, 115, 116, 45, 114, 111, 108, 101, 18, 4, 109, 101, 109, 111, 24, 192, 2, 18, 97, 10, 78, 10, 70, 10, 31, 47, 99, 111, 115, 109, 111, 115, 46, 99, 114, 121, 112, 116, 111, 46, 115, 101, 99, 112, 50, 53, 54, 107, 49, 46, 80, 117, 98, 75, 101, 121, 18, 35, 10, 33, 2, 59, 126, 95, 52, 102, 213, 99, 251, 102, 62, 148, 101, 72, 226, 188, 243, 222, 31, 35, 148, 19, 127, 79, 75, 79, 37, 160, 132, 193, 33, 148, 7, 18, 4, 10, 2, 8, 1, 18, 15, 10, 9, 10, 4, 99, 104, 101, 113, 18, 1, 48, 16, 224, 167, 18, 26, 64, 130, 229, 164, 76, 214, 244, 157, 39, 135, 11, 118, 223, 29, 196, 41, 92, 247, 126, 129, 194, 18, 154, 136, 165, 153, 76, 202, 85, 187, 195, 40, 69, 10, 206, 165, 238, 223, 245, 35, 140, 92, 123, 246, 110, 23, 39, 32, 215, 239, 230, 196, 146, 168, 5, 147, 9, 67, 113, 242, 163, 0, 223, 233, 73] +``` From 58b849103a375b5f710fc759f123329c512d6f85 Mon Sep 17 00:00:00 2001 From: Ankur Banerjee Date: Thu, 24 Feb 2022 11:03:36 +0000 Subject: [PATCH 08/13] Update vdr-tools-sdk-key-management.md --- docs/identity-api/vdr-tools-sdk-key-management.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/identity-api/vdr-tools-sdk-key-management.md b/docs/identity-api/vdr-tools-sdk-key-management.md index c1f6d75cb..43d27a10f 100644 --- a/docs/identity-api/vdr-tools-sdk-key-management.md +++ b/docs/identity-api/vdr-tools-sdk-key-management.md @@ -4,9 +4,9 @@ This page describes how [Evernym VDR Tools](https://gitlab.com/evernym/verity/vdr-tools) works with cheqd accounts in identity wallets built using the VDR Tools SDK. -## Identity wallet key methods +## Identity wallet key methods for cheqd accounts -These methods below are used to manage cheqd wallets/keys within identity wallets built using VDR Tools SDK. (For example, to pay for or receive payment for transactions that need to be written to ledger.) +These methods below are used to manage [cheqd accounts/wallets](../cheqd-cli/cheqd-cli-accounts.md) within identity wallets built using VDR Tools SDK. (For example, to pay for or receive payment for transactions that need to be written to ledger.) For compatibility purposes, VDR Tools SDK method names use the `indy_` prefix. This may be updated in the future as work is done on the upstream project to refactor method names to be ledger-agnostic. From db7408fb0e9154a41caeea4fef7deeaaa1ebb150 Mon Sep 17 00:00:00 2001 From: Ankur Banerjee Date: Thu, 24 Feb 2022 11:39:20 +0000 Subject: [PATCH 09/13] Separate out pool config doc to its own page --- .../vdr-tools-sdk-ledger-connection.md | 153 ++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 docs/identity-api/vdr-tools-sdk-ledger-connection.md diff --git a/docs/identity-api/vdr-tools-sdk-ledger-connection.md b/docs/identity-api/vdr-tools-sdk-ledger-connection.md new file mode 100644 index 000000000..82f032134 --- /dev/null +++ b/docs/identity-api/vdr-tools-sdk-ledger-connection.md @@ -0,0 +1,153 @@ +# Ledger connections in VDR Tools SDK + +## Overview + +This page describes how [Evernym VDR Tools](https://gitlab.com/evernym/verity/vdr-tools) connects to the cheqd network ledger "pool". + +It is worth noting here that the terminology of "pool" connection is specifically a legacy term originally used in [Hyperledger Indy](https://github.com/hyperledger/indy-node), which as a permissioned blockchain assumes there is a finite pools of servers. While this paradigm is no longer true in the public, permissionless world of the cheqd network, the identity APIs in VDR Tools SDK and similar Hyperledger Aries-based frameworks is retained for explanations. + +## Ledger pool connection methods + +Establishing a ledger "pool" connection in VDR Tools SDK broadly has the following steps: + +1. Generate keys or restore them from mnemonic as described in [key management using VDR Tools SDK](vdr-tools-sdk-key-management.md). +2. Add ledger "pool" configuration as described using the methods below, i.e., `indy_cheqd_pool_add`. This only adds the configuration, without actually establishing the connection. The connection is established once the first transaction is sent. + +### indy_cheqd_pool_add + +Add a new cheqd network ledger `PoolConfig` configuration. + +#### Input parameters + +* `alias` (string): Friendly-name for pool connection +* `rpc_address` (string): Tendermint RPC endpoint (e.g., `http://localhost:26657`) for a cheqd network node(s) to send/receive transactions to. +* `chain_id` (string): cheqd network identifier, e.g., `cheqd-mainnet-1` + +#### Example output + +```jsonc +{ + "alias": "cheqd_pool", + "rpc_address": "rpc_address", + "chain_id": "chain_id" +} +``` + +#### **indy_cheqd_pool_get_config** +This method is needed for getting config information about connecting to the pool by alias. + +#### Input parameters +* `alias` - human-readable string, represents pool alias, like `test_pool`. + +Expected result is structure PoolConfig, like: +``` +{ + "alias":"test_pool", + "rpc_address":"rpc_address", + "chain_id":"chain_id" +} +``` +#### **indy_cheqd_pool_get_all_config** +The same as [indy_cheqd_pool_get_config](#indy_cheqd_pool_get_config) but returns the list of structures. +Response should be like: +``` +[Object({ + "alias": String("test_pool_1"), + "chain_id": String("chain_id"), + "rpc_address": String("rpc_address") +}), +Object({ + "alias": String("test_pool_2"), + "chain_id": String("chain_id"), + "rpc_address": String("rpc_address") +})] +``` +#### **indy_cheqd_pool_broadcast_tx_commit** +This method allows to send a txn to all the nodes. + +#### Input parameters +* `pool_alias` - human-readable string, like `test_pool`, +* `signed_tx_raw` - string of bytes which includes raw signed transaction, +* `signed_tx_len` - length of signed txn string, + +Request signed txn as input in raw format. +Expected response should be in json format like: +``` +{ + "check_tx": { + "code": 0, + "data": "", + "log": "[]", + "info": "", + "gas_wanted": "300000", + "gas_used": "38591", + "events": [], + "codespace": "" + }, + "deliver_tx": { + "code": 0, + "data": "Cg8KCUNyZWF0ZU55bRICCAU=", + "log": [{ + "events ": [{ + "type ": "message", + "attributes": [{ + "key": "action", + "value": "CreateNym" + }] + }] + }], + "info": "", + "gas_wanted": "300000", + "gas_used": "46474", + "events": [{ + "type": "message", + "attributes": [{ + "key": "YWN0aW9u", + "value": "Q3JlYXRlTnlt" + }] + }], + "codespace": "" + }, + "hash": "364441EDC5266A0B6AF5A67D4F05AC5D1FE95BFEDFBEBBE195723BEDBA877CAE", + "height": "121" +} +``` +#### **indy_cheqd_pool_abci_query** +Needs to send abci_query to the pool. +With pool `alias` it requires request in json format as input parameter. + +#### Input parameters +* `pool_alias` - human-readable string, like `test_pool`, +* `req_json`- String of ABCI query in json format, + +Expected response should be in json format like: +``` +{ + "nym": + { + "creator":"cheqd1x33xkjd3gqlfhz5l9h60m53pr2mdd4y3nc86h0", + "id":4, + "alias":"test-alias", + "verkey":"test-verkey", + "did":"test-did", + "role":"test-role" + } +} +``` +#### **indy_cheqd_pool_abci_info** +Get general pool information. +Requires only `pool alias` as input parameter. +Returns the response in json format, like: +``` +"{ + "response": + { + "data": "cheqd-node", + "version":"1.0", + "app_version":"1", + "last_block_height":"119", + "last_block_app_hash":[120,105,48,70,72,98,101,55,55,97,112,84,54,98,65,116,76,71,88,76,43,65,90,107,114,75,73,78,104,88,83,119,102,118,115,105,111,54,105,67,53,106,99,61] + } + } +``` + From e712aa25d33d3fabade6d87e1252bde15d54f16b Mon Sep 17 00:00:00 2001 From: Ankur Banerjee Date: Thu, 24 Feb 2022 13:18:35 +0000 Subject: [PATCH 10/13] Update vdr-tools-sdk-key-management.md --- docs/identity-api/vdr-tools-sdk-key-management.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/identity-api/vdr-tools-sdk-key-management.md b/docs/identity-api/vdr-tools-sdk-key-management.md index 43d27a10f..7c2a01ff3 100644 --- a/docs/identity-api/vdr-tools-sdk-key-management.md +++ b/docs/identity-api/vdr-tools-sdk-key-management.md @@ -78,7 +78,7 @@ Return a list of all keys stored in the local identity wallet. #### Example output -```text +```js [ Object({"account_id": String("cheqd1x33xkjd3gqlfhz5l9h60m53pr2mdd4y3nc86h0"), "alias": String("alice"), "pub_key": String("fTsZShn9KkgYKyDmbP5bLhVucNuPRdo4N6zGjAfzSSgv")}), Object({"account_id": String("cheqd1c4n6j030trrljqsphmw9tcrcpgdf33hd3jd0jn"), "alias": String("some_alias_2"), "pub_key": String("g2vxGLkuYg84s3UcsKSxSttNgCKoQgRBQXizzSqbHdRJ")}), From ad72f7b36801bfa46e0091f5310eb59dc4084ec3 Mon Sep 17 00:00:00 2001 From: Ankur Banerjee Date: Thu, 24 Feb 2022 13:19:09 +0000 Subject: [PATCH 11/13] Formatted pool connection docs Matched the pool config docs for internal style guidelines --- .../vdr-tools-sdk-ledger-connection.md | 133 ++++++++++-------- 1 file changed, 74 insertions(+), 59 deletions(-) diff --git a/docs/identity-api/vdr-tools-sdk-ledger-connection.md b/docs/identity-api/vdr-tools-sdk-ledger-connection.md index 82f032134..3e801aea3 100644 --- a/docs/identity-api/vdr-tools-sdk-ledger-connection.md +++ b/docs/identity-api/vdr-tools-sdk-ledger-connection.md @@ -13,6 +13,8 @@ Establishing a ledger "pool" connection in VDR Tools SDK broadly has the followi 1. Generate keys or restore them from mnemonic as described in [key management using VDR Tools SDK](vdr-tools-sdk-key-management.md). 2. Add ledger "pool" configuration as described using the methods below, i.e., `indy_cheqd_pool_add`. This only adds the configuration, without actually establishing the connection. The connection is established once the first transaction is sent. +For compatibility purposes, VDR Tools SDK method names use the `indy_` prefix. This may be updated in the future as work is done on the upstream project to refactor method names to be ledger-agnostic. + ### indy_cheqd_pool_add Add a new cheqd network ledger `PoolConfig` configuration. @@ -28,51 +30,61 @@ Add a new cheqd network ledger `PoolConfig` configuration. ```jsonc { "alias": "cheqd_pool", - "rpc_address": "rpc_address", - "chain_id": "chain_id" + "rpc_address": "https://rpc.testnet.cheqd.network:443", + "chain_id": "cheqd-testnet-4" } ``` -#### **indy_cheqd_pool_get_config** -This method is needed for getting config information about connecting to the pool by alias. +### indy_cheqd_pool_get_config + +Fetch pool configuration for a specific connection `alias`. #### Input parameters -* `alias` - human-readable string, represents pool alias, like `test_pool`. -Expected result is structure PoolConfig, like: -``` +* `alias` (string): Friendly-name for pool connection + +#### Example output + +```jsonc { - "alias":"test_pool", - "rpc_address":"rpc_address", - "chain_id":"chain_id" + "alias": "cheqd_pool", + "rpc_address": "https://rpc.testnet.cheqd.network:443", + "chain_id": "cheqd-testnet-4" } ``` -#### **indy_cheqd_pool_get_all_config** -The same as [indy_cheqd_pool_get_config](#indy_cheqd_pool_get_config) but returns the list of structures. -Response should be like: -``` + +### indy_cheqd_pool_get_all_config + +Display pool configuration for all pools. + +#### Example output + +```js [Object({ - "alias": String("test_pool_1"), - "chain_id": String("chain_id"), - "rpc_address": String("rpc_address") + "alias": String("cheqd_pool_1"), + "chain_id": String("cheqd-testnet-4"), + "rpc_address": String("https://rpc.testnet.cheqd.network:443") }), Object({ - "alias": String("test_pool_2"), - "chain_id": String("chain_id"), - "rpc_address": String("rpc_address") + "alias": String("cheqd_pool_2"), + "chain_id": String("cheqd-mainnet-1"), + "rpc_address": String("https://rpc.cheqd.net:443") })] ``` -#### **indy_cheqd_pool_broadcast_tx_commit** -This method allows to send a txn to all the nodes. + +### indy_cheqd_pool_broadcast_tx_commit + +Broadcast a signed cheqd/Cosmos transaction to node(s) in a defined pool. This wraps up any identity-related payloads generated by VDR Tools SDK in a cheqd ledger transaction wrapper [using standard Cosmos broadcast methods](https://docs.cosmos.network/master/run-node/txs.html#broadcasting-a-transaction). #### Input parameters -* `pool_alias` - human-readable string, like `test_pool`, -* `signed_tx_raw` - string of bytes which includes raw signed transaction, -* `signed_tx_len` - length of signed txn string, -Request signed txn as input in raw format. -Expected response should be in json format like: -``` +* `alias` (string): Friendly-name for pool connection +* `signed_tx_raw` (string): String of bytes containing a correctly formattted cheqd/Cosmos transaction. +* `signed_tx_len` (integer): Length of signed transaction string in bytes. + +#### Example output + +```jsonc { "check_tx": { "code": 0, @@ -92,7 +104,7 @@ Expected response should be in json format like: "type ": "message", "attributes": [{ "key": "action", - "value": "CreateNym" + "value": "CreateDid" }] }] }], @@ -112,42 +124,45 @@ Expected response should be in json format like: "height": "121" } ``` -#### **indy_cheqd_pool_abci_query** -Needs to send abci_query to the pool. -With pool `alias` it requires request in json format as input parameter. + +### indy_cheqd_pool_abci_query + +Send a [Tendermint ABCI query](https://docs.cosmos.network/v0.44/intro/sdk-app-architecture.html#abci) to specified pool `alias`. ABCI queries allow custom queries to be constructed and resultant answers fetched from the cheqd network ledger, for any data that may not be covered under the usual RPC/REST API endpoints. #### Input parameters -* `pool_alias` - human-readable string, like `test_pool`, -* `req_json`- String of ABCI query in json format, -Expected response should be in json format like: -``` +* `alias` (string): Friendly-name for pool connection +* `req_json` (string): ABCI query in JSON format + +#### Example output + +```jsonc { - "nym": + "did": { - "creator":"cheqd1x33xkjd3gqlfhz5l9h60m53pr2mdd4y3nc86h0", - "id":4, - "alias":"test-alias", - "verkey":"test-verkey", - "did":"test-did", - "role":"test-role" + "creator": "cheqd1x33xkjd3gqlfhz5l9h60m53pr2mdd4y3nc86h0", + "id": 4, + "alias": "test-alias", + "verkey": "did:cheqd::#key1", + "did": "did:cheqd::" } } ``` -#### **indy_cheqd_pool_abci_info** -Get general pool information. -Requires only `pool alias` as input parameter. -Returns the response in json format, like: -``` -"{ - "response": - { - "data": "cheqd-node", - "version":"1.0", - "app_version":"1", - "last_block_height":"119", - "last_block_app_hash":[120,105,48,70,72,98,101,55,55,97,112,84,54,98,65,116,76,71,88,76,43,65,90,107,114,75,73,78,104,88,83,119,102,118,115,105,111,54,105,67,53,106,99,61] - } - } -``` +### indy_cheqd_pool_abci_info + +Display pool information for a specified pool `alias`. Similar to the response that can be fetched directly from Tendermint RPC endpoint at the `/abci_info` path, e.g., `http://localhost:26657/abci_info` + +#### Example output + +```jsonc +{ + "response": { + "data": "cheqd-node", + "version": "0.4.0", + "app_version": "1", + "last_block_height": "541557", + "last_block_app_hash": "fMbrqSo1KFPeKBASylG4lEVy7iItUwGVqSUw1CE9Ydw=" + } +} +``` From fbddebe80abcb6cb2cb3ae2e4a92b8ae5be70339 Mon Sep 17 00:00:00 2001 From: Ankur Banerjee Date: Thu, 24 Feb 2022 13:23:51 +0000 Subject: [PATCH 12/13] Fixed links and summary page --- SUMMARY.md | 2 ++ ...ols-sdk-key-management.md => vdr-tools-sdk-accounts-keys.md} | 2 +- docs/identity-api/vdr-tools-sdk-ledger-connection.md | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) rename docs/identity-api/{vdr-tools-sdk-key-management.md => vdr-tools-sdk-accounts-keys.md} (99%) diff --git a/SUMMARY.md b/SUMMARY.md index 55e40ad25..cf9622426 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -25,6 +25,8 @@ * [Docker Compose Based Localnet](docs/build-and-networks/local-docker-compose-network.md) * [Setting up a new network](docs/build-and-networks/manual-network-setup.md) * [Client-app Identity APIs](docs/identity-api/README.md) + * [Account and key management in VDR Tools SDK](docs/identity-api/vdr-tools-sdk-accounts-keys.md) + * [Ledger connections in VDR Tools SDK](docs/identity-api/vdr-tools-sdk-ledger-connection.md) * [Error messages](docs/identity-api/identity-api-error-messages.md) ## Architecture diff --git a/docs/identity-api/vdr-tools-sdk-key-management.md b/docs/identity-api/vdr-tools-sdk-accounts-keys.md similarity index 99% rename from docs/identity-api/vdr-tools-sdk-key-management.md rename to docs/identity-api/vdr-tools-sdk-accounts-keys.md index 7c2a01ff3..467db7e5c 100644 --- a/docs/identity-api/vdr-tools-sdk-key-management.md +++ b/docs/identity-api/vdr-tools-sdk-accounts-keys.md @@ -1,4 +1,4 @@ -# Key management in VDR Tools SDK +# Account and key management in VDR Tools SDK ## Overview diff --git a/docs/identity-api/vdr-tools-sdk-ledger-connection.md b/docs/identity-api/vdr-tools-sdk-ledger-connection.md index 3e801aea3..4fe3599d2 100644 --- a/docs/identity-api/vdr-tools-sdk-ledger-connection.md +++ b/docs/identity-api/vdr-tools-sdk-ledger-connection.md @@ -10,7 +10,7 @@ It is worth noting here that the terminology of "pool" connection is specificall Establishing a ledger "pool" connection in VDR Tools SDK broadly has the following steps: -1. Generate keys or restore them from mnemonic as described in [key management using VDR Tools SDK](vdr-tools-sdk-key-management.md). +1. Generate keys or restore them from mnemonic as described in [key management using VDR Tools SDK](vdr-tools-sdk-accounts-keys.md). 2. Add ledger "pool" configuration as described using the methods below, i.e., `indy_cheqd_pool_add`. This only adds the configuration, without actually establishing the connection. The connection is established once the first transaction is sent. For compatibility purposes, VDR Tools SDK method names use the `indy_` prefix. This may be updated in the future as work is done on the upstream project to refactor method names to be ledger-agnostic. From 586dd1b879f93c97b2e652e0100b9c2ff4463ab9 Mon Sep 17 00:00:00 2001 From: Ankur Banerjee Date: Thu, 24 Feb 2022 13:29:20 +0000 Subject: [PATCH 13/13] Fix MDLint fail --- docs/identity-api/vdr-tools-sdk-accounts-keys.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/identity-api/vdr-tools-sdk-accounts-keys.md b/docs/identity-api/vdr-tools-sdk-accounts-keys.md index 467db7e5c..e8554d5a4 100644 --- a/docs/identity-api/vdr-tools-sdk-accounts-keys.md +++ b/docs/identity-api/vdr-tools-sdk-accounts-keys.md @@ -99,6 +99,6 @@ Sign a transaction using key in identity wallet with specified `alias`. The cheq #### Example output -``` +```text [10, 146, 1, 10, 134, 1, 10, 37, 47, 99, 104, 101, 113, 100, 105, 100, 46, 99, 104, 101, 113, 100, 110, 111, 100, 101, 46, 99, 104, 101, 113, 100, 46, 77, 115, 103, 67, 114, 101, 97, 116, 101, 78, 121, 109, 18, 93, 10, 45, 99, 111, 115, 109, 111, 115, 49, 120, 51, 51, 120, 107, 106, 100, 51, 103, 113, 108, 102, 104, 122, 53, 108, 57, 104, 54, 48, 109, 53, 51, 112, 114, 50, 109, 100, 100, 52, 121, 51, 110, 99, 56, 54, 104, 48, 18, 10, 116, 101, 115, 116, 45, 97, 108, 105, 97, 115, 26, 11, 116, 101, 115, 116, 45, 118, 101, 114, 107, 101, 121, 34, 8, 116, 101, 115, 116, 45, 100, 105, 100, 42, 9, 116, 101, 115, 116, 45, 114, 111, 108, 101, 18, 4, 109, 101, 109, 111, 24, 192, 2, 18, 97, 10, 78, 10, 70, 10, 31, 47, 99, 111, 115, 109, 111, 115, 46, 99, 114, 121, 112, 116, 111, 46, 115, 101, 99, 112, 50, 53, 54, 107, 49, 46, 80, 117, 98, 75, 101, 121, 18, 35, 10, 33, 2, 59, 126, 95, 52, 102, 213, 99, 251, 102, 62, 148, 101, 72, 226, 188, 243, 222, 31, 35, 148, 19, 127, 79, 75, 79, 37, 160, 132, 193, 33, 148, 7, 18, 4, 10, 2, 8, 1, 18, 15, 10, 9, 10, 4, 99, 104, 101, 113, 18, 1, 48, 16, 224, 167, 18, 26, 64, 130, 229, 164, 76, 214, 244, 157, 39, 135, 11, 118, 223, 29, 196, 41, 92, 247, 126, 129, 194, 18, 154, 136, 165, 153, 76, 202, 85, 187, 195, 40, 69, 10, 206, 165, 238, 223, 245, 35, 140, 92, 123, 246, 110, 23, 39, 32, 215, 239, 230, 196, 146, 168, 5, 147, 9, 67, 113, 242, 163, 0, 223, 233, 73] ```