-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: update getting-started and remove examples #477
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.
Very nice! Finally it's a readable and useful document again. Just a few questions.
docs/getting-started.md
Outdated
3. Install typescript with `yarn add typescript` | ||
4. Make a new file, e.g. `touch getting-started.ts` | ||
5. Execute the file with `npx ts-node getting-started.ts` | ||
To run the script at any point during this guide, just run `npx ts-node getting-started.ts`. |
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.
Would require npx right? We could simply tell people to also add ts-node to their dependencies, in which case you can run yarn ts-node getting-started.ts
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.
docs/getting-started.md
Outdated
If you don't do this, certain operations like account generation could fail with the notice that "the WASM interface has not been initialized". | ||
2. Set essential configurations, most importantly the endpoint of the KILT node to which you'll want to connect for actions that read or write to blockchain state. | ||
These operations would throw an error if called before an endpoint has been set. | ||
If this step is skipped, certain operations like account generation could fail with the error "the WASM interface has not been initialized". |
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.
if you want to be precise, sr25519 crypto will not work.
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.
docs/getting-started.md
Outdated
console.log(claimerLightDid.did) | ||
``` | ||
Before being used in credentials, CTypes must be stored on the KILT blockchain. | ||
To do so, an on-chain DID is required for the entity willing to write CType on chain. |
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.
article missing
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.
docs/getting-started.md
Outdated
|
||
The message can be encrypted with the keystore and keys as follows: | ||
As sender identity and message validity are also checked during decryption, if the decryption process completes successfully, the attester can assume that the sender of the message is also the owner of the claim, as the two identities match. |
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.
The last part is something we are about to change, right? So maybe we shouldnt advertise it at this point.
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.
Good point -> cf7198f
docs/getting-started.md
Outdated
} | ||
``` | ||
|
||
The Attester creates the attestation based on the IRequestForAttestation object she received: | ||
Then, after verifying the validity of the claims in the request for attestation, the attester builds an attestation. |
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.
Unclear it that's a technical process or the attester's job. In any case we should indicate that there is a moment of judgement by the attester.
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.
docs/getting-started.md
Outdated
const selectedCredential = await credential.createPresentation({ | ||
// Hide the `age` property, and only reveal the `name` one. | ||
selectedAttributes: ['name'], | ||
signer: keystore, | ||
claimerDid: claimerLightDid, | ||
}) |
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.
this does allow for a challenge AFAIK
docs/getting-started.md
Outdated
const requestForCredentialMessage = new Kilt.Message( | ||
{ | ||
type: Kilt.Message.BodyType.REQUEST_CREDENTIAL, | ||
content: { | ||
cTypes: [ | ||
{ cTypeHash: ctype.hash, trustedAttesters: [attesterFullDid.did] }, | ||
], | ||
}, | ||
}, |
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.
For some reason this comment didn't make it... I was asking if we don't allow for a challenge on the request, or have some other challenge procedure for verification at this point?
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.
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, minor changes
docs/getting-started.md
Outdated
If you don't do this, certain operations like account generation could fail with the notice that "the WASM interface has not been initialized". | ||
2. Set essential configurations, most importantly the endpoint of the KILT node to which you'll want to connect for actions that read or write to blockchain state. | ||
These operations would throw an error if called before an endpoint has been set. | ||
If this step is skipped, certain operations like account generation using some algorithms, e.g., Sr25519, could fail with the error "the WASM interface has not been initialized". |
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.
If this step is skipped, certain operations like account generation using some algorithms, e.g., Sr25519, could fail with the error "the WASM interface has not been initialized". | |
If this step is skipped, certain operations such as using some algorithms to generate accounts, e.g., Sr25519, could fail with the error "the WASM interface has not been initialized". |
docs/getting-started.md
Outdated
2. Set essential configurations, most importantly the endpoint of the KILT node to which you'll want to connect for actions that read or write to blockchain state. | ||
These operations would throw an error if called before an endpoint has been set. | ||
If this step is skipped, certain operations like account generation using some algorithms, e.g., Sr25519, could fail with the error "the WASM interface has not been initialized". | ||
2. Set essential configurations, most importantly the address of the KILT node to connect to for anything that interacts with the KILT blockchain. |
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.
2. Set essential configurations, most importantly the address of the KILT node to connect to for anything that interacts with the KILT blockchain. | |
2. Set essential configurations, most importantly the address of the KILT node to connect to interact with the KILT blockchain. |
// Keyring is required to generate KILT accounts. | ||
const keyring = new Kilt.Utils.Keyring({ | ||
ss58Format: 38, | ||
type: 'ed25519', |
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 have a comment here about the sr25519
requiring the cryptoWaitReady
.
``` | ||
|
||
Or by setting a default address in the configuration, connecting implicitly. | ||
// Keyring is required to generate KILT accounts. |
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.
// Keyring is required to generate KILT accounts. | |
// Keyring is required to generate KILT accounts. | |
// If you are using `srr25519` to generate KILT accounts, the `cryptoWaitReady` must be called beforehand. |
|
||
```typescript | ||
const tx = await ctype.getStoreTx() | ||
/* The attester signs the ctype creation transaction resulting from calling `ctype.store()` with its DID. */ |
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 indicate that if you are not using a local chain, it is best practice to check if the CType is stored on chain
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
Getting started update
Provides an overall refresh of the getting started guide, by using the new syntax as in #473, as this PR is based on top of that. It also removes the
docs/example.ts
file which seemed like a useless repetition of the getting started.This PR fixes https://github.com/KILTprotocol/ticket/issues/1825.