From 09d729b7dd024bfd4dd9f6608b064a13725464ae Mon Sep 17 00:00:00 2001 From: weichweich Date: Fri, 29 Apr 2022 10:02:48 +0200 Subject: [PATCH 1/2] chore: update browser list --- yarn.lock | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/yarn.lock b/yarn.lock index d3352f33f..82526dfaa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3590,20 +3590,10 @@ caniuse-api@^3.0.0: lodash.memoize "^4.1.2" lodash.uniq "^4.5.0" -caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001252, caniuse-lite@^1.0.30001254: - version "1.0.30001257" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001257.tgz" - integrity sha512-JN49KplOgHSXpIsVSF+LUyhD8PUp6xPpAXeRrrcBh4KBeP7W864jHn6RvzJgDlrReyeVjMFJL3PLpPvKIxlIHA== - -caniuse-lite@^1.0.30001264, caniuse-lite@^1.0.30001271: - version "1.0.30001271" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001271.tgz" - integrity sha512-BBruZFWmt3HFdVPS8kceTBIguKxu4f99n5JNp06OlPD/luoAMIaIK5ieV5YjnBLH3Nysai9sxj9rpJj4ZisXOA== - -caniuse-lite@^1.0.30001280: - version "1.0.30001286" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001286.tgz" - integrity sha512-zaEMRH6xg8ESMi2eQ3R4eZ5qw/hJiVsO/HlLwniIwErij0JDr9P+8V4dtx1l+kLq6j3yy8l8W4fst1lBnat5wQ== +caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001252, caniuse-lite@^1.0.30001254, caniuse-lite@^1.0.30001264, caniuse-lite@^1.0.30001271, caniuse-lite@^1.0.30001280: + version "1.0.30001334" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001334.tgz" + integrity sha512-kbaCEBRRVSoeNs74sCuq92MJyGrMtjWVfhltoHUCW4t4pXFvGjUBrfo47weBRViHkiV3eBYyIsfl956NtHGazw== ccount@^1.0.0, ccount@^1.0.3: version "1.1.0" From f9d564d49bd96e71558d73043252ebf9a808a23a Mon Sep 17 00:00:00 2001 From: weichweich Date: Fri, 29 Apr 2022 15:02:41 +0200 Subject: [PATCH 2/2] docs for RPCs --- docs/chain/0_introduction.md | 13 +- docs/chain/{collator.md => 1_collator.md} | 0 docs/chain/{fullnode.md => 2_fullnode.md} | 0 docs/chain/{delegator.md => 3_delegator.md} | 0 docs/chain/{did.md => 4_did.md} | 0 docs/chain/5_rpc_api.md | 240 ++++++++++++++++++++ 6 files changed, 249 insertions(+), 4 deletions(-) rename docs/chain/{collator.md => 1_collator.md} (100%) rename docs/chain/{fullnode.md => 2_fullnode.md} (100%) rename docs/chain/{delegator.md => 3_delegator.md} (100%) rename docs/chain/{did.md => 4_did.md} (100%) create mode 100644 docs/chain/5_rpc_api.md diff --git a/docs/chain/0_introduction.md b/docs/chain/0_introduction.md index 471e3b9c0..817a4b1ce 100644 --- a/docs/chain/0_introduction.md +++ b/docs/chain/0_introduction.md @@ -5,7 +5,12 @@ title: Introduction The section covers KILT chain specific topics. -* Learn how to [become a collator candidate](collator.md) -* [Delegate KILT Coins](delegator.md) to help the community decide which candidates should become collators -* Learn about [DIDs](did.md) -* Learn how to run a [full node](fullnode.md) +* Learn how to [become a collator candidate](collator) +* Learn how to [run a full node](fullnode) +* [Delegate KILT Coins](delegator) to help the community decide which candidates should become collators + * This guide shows how to use the Polkadot Apps for that + * The recommended way is to use the [stakeboard](https://stakeboard.kilt.io) +* Learn about [DIDs](did) +* Explore the [full node API](custom-rpc) + * every full node exposes a set of remote procedure calls + * these calls can be used to query the blockchain or to submit transactions diff --git a/docs/chain/collator.md b/docs/chain/1_collator.md similarity index 100% rename from docs/chain/collator.md rename to docs/chain/1_collator.md diff --git a/docs/chain/fullnode.md b/docs/chain/2_fullnode.md similarity index 100% rename from docs/chain/fullnode.md rename to docs/chain/2_fullnode.md diff --git a/docs/chain/delegator.md b/docs/chain/3_delegator.md similarity index 100% rename from docs/chain/delegator.md rename to docs/chain/3_delegator.md diff --git a/docs/chain/did.md b/docs/chain/4_did.md similarity index 100% rename from docs/chain/did.md rename to docs/chain/4_did.md diff --git a/docs/chain/5_rpc_api.md b/docs/chain/5_rpc_api.md new file mode 100644 index 000000000..1af1376f9 --- /dev/null +++ b/docs/chain/5_rpc_api.md @@ -0,0 +1,240 @@ +--- +id: custom-rpc +title: Custom RPC API +--- + +KILT blockchain nodes expose endpoints for executing Remote Procedure Calls (RPC). +Most of the RPCs can also be found in any other substrate based chain and don't derive from their default implementation. +For a [list of default RPCs refer to the official polkadot documentation](https://polkadot.js.org/docs/substrate/rpc/). + +Besides the default set up RPCs, the KILT blockchain also supports a set of custom RPCs which will be described in this document. + +## Query information linked to a DID + +KILT DIDs own many different storage entries which cannot be queried in parallel and therefore would require multiple [round-trip times](https://en.wikipedia.org/wiki/Round-trip_delay) to assemble. +To shorten delays in user interfaces, three convenience RPCs are available on the KILT blockchain + +### Query by did identifier + +Look up linked information to this DID identifier. + +#### Method Name + +`did_query` + +#### Parameter + +* `DidIdentifier` - the DID that should be looked up without the `did:kilt:` prefix. + + +#### Request: + +``` +curl \ + -H "Content-Type: application/json" \ + -d '{ + "id":1, + "jsonrpc":"2.0", + "method": "did_query", + "params":["4q9HbHkTszhd1Kp23Dbkuk1KNE8grgzF9S9Gr6areY21SB6c"] + }' \ + https://kilt-rpc.dwellir.com +``` + +#### Response: + +```json +{ + "jsonrpc": "2.0", + "result": { + "accounts": [ + "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY" + ], + "details": { + "attestation_key": null, + "authentication_key": "0x15ba41bf8842ae185ae06110a63e6cc7ac36d8a8ea217746231bef46c1379ab1", + "delegation_key": null, + "deposit": { + "amount": "2007900000000000", + "owner": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY" + }, + "key_agreement_keys": [], + "last_tx_counter": 3, + "public_keys": { + "0x15ba41bf8842ae185ae06110a63e6cc7ac36d8a8ea217746231bef46c1379ab1": { + "block_number": 120, + "key": { + "PublicVerificationKey": { + "Sr25519": "5FKxrLQM24ZhLxcaQfJR3uMxMZh5gU6E4CP3yghPJLzCDnHN" + } + } + } + } + }, + "identifier": "5FKxrLQM24ZhLxcaQfJR3uMxMZh5gU6E4CP3yghPJLzCDnHN", + "service_endpoints": [ + { + "id": "123", + "service_types": [ + "twitter" + ], + "urls": [ + "example.com" + ] + } + ], + "w3n": "alice-0" + }, + "id": 1 +} +``` + +### Query by linked account + +DIDs can be associated to multiple different blockchain accounts. +This RPC makes it possible to look up a DID using a blockchain account. + +#### Method Name + +`did_queryByAccount` + +#### Parameter + +* `AccountId` - The account id that should be linked to a DID. + +#### Request: + +``` +curl \ + -H "Content-Type: application/json" \ + -d '{ + "id":1, + "jsonrpc":"2.0", + "method": "did_queryByAccount", + "params":["4q9HbHkTszhd1Kp23Dbkuk1KNE8grgzF9S9Gr6areY21SB6c"] + }' \ + https://kilt-rpc.dwellir.com +``` + +#### Response: + +```json +{ + "jsonrpc": "2.0", + "result": { + "accounts": [ + "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY" + ], + "details": { + "attestation_key": null, + "authentication_key": "0x15ba41bf8842ae185ae06110a63e6cc7ac36d8a8ea217746231bef46c1379ab1", + "delegation_key": null, + "deposit": { + "amount": "2007900000000000", + "owner": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY" + }, + "key_agreement_keys": [], + "last_tx_counter": 3, + "public_keys": { + "0x15ba41bf8842ae185ae06110a63e6cc7ac36d8a8ea217746231bef46c1379ab1": { + "block_number": 120, + "key": { + "PublicVerificationKey": { + "Sr25519": "5FKxrLQM24ZhLxcaQfJR3uMxMZh5gU6E4CP3yghPJLzCDnHN" + } + } + } + } + }, + "identifier": "5FKxrLQM24ZhLxcaQfJR3uMxMZh5gU6E4CP3yghPJLzCDnHN", + "service_endpoints": [ + { + "id": "123", + "service_types": [ + "twitter" + ], + "urls": [ + "example.com" + ] + } + ], + "w3n": "alice-0" + }, + "id": 1 +} +``` + +### Query by web3name + +DIDs can be associated to multiple different blockchain accounts. +This RPC makes it possible to look up a DID using a blockchain account. + +#### Method Name + +`did_queryByWeb3Name` + +#### Parameter + +* `String` - The web3name + +#### Request: + +``` +curl \ + -H "Content-Type: application/json" \ + -d '{ + "id":1, + "jsonrpc":"2.0", + "method": "did_queryByWeb3Name", + "params":["botlabs_gmbh"] + }' \ + https://kilt-rpc.dwellir.com +``` + +#### Response: + +```json +{ + "jsonrpc": "2.0", + "result": { + "accounts": [ + "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY" + ], + "details": { + "attestation_key": null, + "authentication_key": "0x15ba41bf8842ae185ae06110a63e6cc7ac36d8a8ea217746231bef46c1379ab1", + "delegation_key": null, + "deposit": { + "amount": "2007900000000000", + "owner": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY" + }, + "key_agreement_keys": [], + "last_tx_counter": 3, + "public_keys": { + "0x15ba41bf8842ae185ae06110a63e6cc7ac36d8a8ea217746231bef46c1379ab1": { + "block_number": 120, + "key": { + "PublicVerificationKey": { + "Sr25519": "5FKxrLQM24ZhLxcaQfJR3uMxMZh5gU6E4CP3yghPJLzCDnHN" + } + } + } + } + }, + "identifier": "5FKxrLQM24ZhLxcaQfJR3uMxMZh5gU6E4CP3yghPJLzCDnHN", + "service_endpoints": [ + { + "id": "123", + "service_types": [ + "twitter" + ], + "urls": [ + "example.com" + ] + } + ], + "w3n": "alice-0" + }, + "id": 1 +} +```