Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Update SDK docs #542

Open
MSevey opened this issue Aug 9, 2022 · 1 comment
Open

Update SDK docs #542

MSevey opened this issue Aug 9, 2022 · 1 comment

Comments

@MSevey
Copy link
Contributor

MSevey commented Aug 9, 2022

Add section for File API

getEncryptedPathSeed

Add missing documentation for getting userID

Document resolver link / datalink

@parajbs
Copy link

parajbs commented Aug 17, 2022

Hello MSevey,

I also think it's stupid that not everything is documented, I then got the information I brought from the code myself, because there is also information there.
Maybe there will be a complete sdk-doc soon.
But there are other problems in the sdk doc, so it may take some time.

Here is some information that I have worked out, I hope it will help you:

1. File API:

getJSON(userID, path)

getEntryData(userID, path)

getEntryLink(userID, path)

getJSONEncrypted(userID, pathSeed)

Example:

  const userID = "4dfb9ce035e4e44711c1bb0a0901ce3adc2a928b122ee7b45df6ac47548646b0";
  // Path seed for "test.hns/encrypted".
  const pathSeed = "fe2c5148646532a442dd117efab3ff2a190336da506e363f80fb949513dab811";

Your links to how it works:
https://github.com/SkynetLabs/skynet-js/blob/master/integration/file.test.ts
https://github.com/SkynetLabs/skynet-js/blob/master/integration/encryptedfile.test.ts

2. "getEncryptedPathSeed" function:
I think it's a function that encrypts the path for mySky.
You would have to look it up yourself in the "skynet-js" code, because there are other functions that are part of it.
But I think during my tests I had to change something in the "skynet-js" code so that I could even see the output of the "getEncryptedPathSeed" function.

What do you need it for?
I think it's just an internal function for "mySky" and not necessarily intended for the end-user.
If you really need it, I'll have to look again.

3. get the UserID:
After you logged in to MySky, you can get userID:
const userId = await mySky.userID();

The UserId is your "publicKey".
Example:
"4dfb9ce035e4e44711c1bb0a0901ce3adc2a928b122ee7b45df6ac47548646b0";

4. Document resolver link / data link
I'm not sure but I believe this is the function for it:
await client.db.setDataLink(privateKey, dataKey, dataLink);

Here is a link:
https://docs.skynetlabs.com/skynet-topics/resolver-skylinks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants