Skip to content
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

Update README #88

Open
2 tasks
amarts opened this issue Jun 27, 2023 · 37 comments
Open
2 tasks

Update README #88

amarts opened this issue Jun 27, 2023 · 37 comments
Assignees
Labels
C4GT Community documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@amarts
Copy link
Member

amarts commented Jun 27, 2023

Description

Make sure README reflects what is in the project, and using README, one is able to complete a demo run. Also it should have links to documentation for further study.

Goals

  • Run through the README file and verify the if it is missing something

Expected Outcome

  • README file is accurate, anyone following it should not have any further questions, in setting up the dev environment and be able to run the demo script

Acceptance Criteria

Following the instructions on the README file, one should be able to set up the dev environment and be able to run the demo script

Implementation Details

NA

Mockups / Wireframes

NA


Product Name

CORD

Organization Name

Dhiway

Domain

Blockchain

Tech Skills Needed

Rust build tool chain

Mentor(s)

@amarts @NiranjanAP

Complexity

Low

Category

Documentation

Sub Category

Beginner friendly

@amarts amarts added documentation Improvements or additions to documentation good first issue Good for newcomers labels Jun 27, 2023
@StillAbeginnerr
Copy link

I want to take up the issue, Assign me, please.

@amarts
Copy link
Member Author

amarts commented Dec 14, 2023

@StillAbeginnerr feel free to work on it and while submitting refer to this issue (#88).

@StillAbeginnerr
Copy link

StillAbeginnerr commented Dec 15, 2023

Using Github Desktop, I cloned the repository and then first tried with the following.

npm install cord.network/sdk 
npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://[email protected]/cord.network/sdk.git
npm ERR! [email protected]: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.

Then The following to get the node modules installed

npm i
npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "workspace:": workspace:*

npm ERR! A complete log of this run can be found in: C:\Users\Shiva\AppData\Local\npm-cache\_logs\2023-12-15T16_36_57_461Z-debug-0.log

This problem persists. I checked my possible ways to work with it via Chatgpt and Other Tools like Stackoverflow.
Need some tips regarding this issue.
@amarts

@amarts
Copy link
Member Author

amarts commented Dec 15, 2023

Did you miss the '@'... It's npm install @cord.network/sdk

@adi-a11y
Copy link
Contributor

adi-a11y commented Dec 15, 2023

Using Github Desktop, I cloned the repository and then first tried with the following.

npm install cord.network/sdk 
npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://[email protected]/cord.network/sdk.git
npm ERR! [email protected]: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.

Then The following to get the node modules installed

npm i
npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "workspace:": workspace:*

npm ERR! A complete log of this run can be found in: C:\Users\Shiva\AppData\Local\npm-cache\_logs\2023-12-15T16_36_57_461Z-debug-0.log

This problem persists. I checked my possible ways to work with it via Chatgpt and Other Tools like Stackoverflow. Need some tips regarding this issue. @amarts

@StillAbeginnerr, Can you please try using yarn instead of npm?

@StillAbeginnerr
Copy link

Did you miss the '@'... It's npm install @cord.network/sdk

It gives another error

PS C:\Users\Shiva\OneDrive\Pictures\cord.js> npm install @cord.network/sdk
At line:1 char:13
+ npm install @cord.network/sdk
+             ~~~~~
The splatting operator '@' cannot be used to reference variables in an expression. '@cord' can be used only as an argument to a command. To reference variables in 
an expression use '$cord'.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : SplattingNotPermitted

@StillAbeginnerr
Copy link

StillAbeginnerr commented Dec 15, 2023

Using Github Desktop, I cloned the repository and then first tried with the following.

npm install cord.network/sdk 
npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://[email protected]/cord.network/sdk.git
npm ERR! [email protected]: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.

Then The following to get the node modules installed

npm i
npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "workspace:": workspace:*

npm ERR! A complete log of this run can be found in: C:\Users\Shiva\AppData\Local\npm-cache\_logs\2023-12-15T16_36_57_461Z-debug-0.log

This problem persists. I checked my possible ways to work with it via Chatgpt and Other Tools like Stackoverflow. Need some tips regarding this issue. @amarts

Can you please try using yarn instead of npm?

PS C:\Users\Shiva\OneDrive\Pictures\cord.js> yarn add @cord.network/sdk
At line:1 char:10
+ yarn add @cord.network/sdk
+          ~~~~~
The splatting operator '@' cannot be used to reference variables in an    
expression. '@cord' can be used only as an argument to a command. To      
reference variables in an expression use '$cord'.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRe  
   cordException
    + FullyQualifiedErrorId : SplattingNotPermitted

PS C:\Users\Shiva\OneDrive\Pictures\cord.js> yarn add cord.network/sdk 
Usage Error: The cord.network/sdk string didn't match the required format (package-name@range). Did you perhaps forget to explicitly reference the package name?

$ yarn add [--json] [-F,--fixed] [-E,--exact] [-T,--tilde] [-C,--caret] [-D,--dev] [-P,--peer] [-O,--optional] [--prefer-dev] [-i,--interactive] [--cached] [--mode #0] ...

@StillAbeginnerr
Copy link

@amarts

@amarts
Copy link
Member Author

amarts commented Dec 19, 2023

Wanting to understand what is that is being tried here.

There are 2 things:

  1. Consume this SDK : this is where one needs to install @cord.network/sdk, this is never done on a github codebase, but on a machine where application is using the SDK (think inside a nodejs app, reactjs app, may be used on GNU/Linux CLI, or in docker.

  2. Develop, and improve the SDK: This is a task for developers, once cloned, you would do npm install and npm run build. make changes to code, and run demo scripts, and make sure your changes work.

As a project we need to cover both in documentation. Ideally README should contain the section 1 part, so it can be used in npmjs package page while publishing. The developer part can be a separate page inside the docs/ which may or may not be having a link from README.

In github desktop, you don't need to handle 'npm install @cord.network/sdk, but can just manage the code, and yarn and yarn build`

@StillAbeginnerr
Copy link

okay sir, I understand.

what I did was,

  1. Cloned the repository in my system.
  2. Tried to install the node_modules using npm install
  3. got an error regarding installation of node_modules.
  4. tried npm i @cord.network/sdk.
  5. again got an error.
  6. tried npm i cord.network/sdk.
  7. again got an error.
  8. then tried chatgpt to work upon that but didn't work.
  9. so pasted the issue and error here.

@StillAbeginnerr
Copy link

same error with yarn

@StillAbeginnerr
Copy link

StillAbeginnerr commented Dec 24, 2023

Wanting to understand what is that is being tried here.

There are 2 things:

  1. Consume this SDK : this is where one needs to install @cord.network/sdk, this is never done on a github codebase, but on a machine where application is using the SDK (think inside a nodejs app, reactjs app, may be used on GNU/Linux CLI, or in docker.
  2. Develop, and improve the SDK: This is a task for developers, once cloned, you would do npm install and npm run build. make changes to code, and run demo scripts, and make sure your changes work.

As a project we need to cover both in documentation. Ideally README should contain the section 1 part, so it can be used in npmjs package page while publishing. The developer part can be a separate page inside the docs/ which may or may not be having a link from README.

In github desktop, you don't need to handle 'npm install @cord.network/sdk, but can just manage the code, and yarn and yarn build`

I managed to work successfully with the first pointer that is consuming the SDK but had received errors in running the demo script and the attached screenshot is here where i utilised the Experiment the SDK methods using the following commands.
yarn
yarn build
npx tsx demo/src/func-test.ts
npx tsx demo/src/network-score-test.ts

1
2

the error while I tried to run the demo script:

gitpod /workspace/cord.js (develop) $ npx tsx demo/src/func-test.ts
node:internal/modules/cjs/loader:1144
const err = new Error(message);
^

Error: Cannot find module './generateKeypairs'
Require stack:

  • /workspace/cord.js/demo/src/utils/generateDid.ts
  • /workspace/cord.js/demo/src/func-test.ts
    at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
    at l.default._resolveFilename (/workspace/cord.js/node_modules/tsx/dist/cjs/index.cjs:1:1671)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at (/workspace/cord.js/demo/src/utils/generateDid.ts:3:34)
    at Object. (/workspace/cord.js/demo/src/utils/generateDid.ts:10:23)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Object.j (/workspace/cord.js/node_modules/tsx/dist/cjs/index.cjs:1:1197)
    at Module.load (node:internal/modules/cjs/loader:1207:32) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    '/workspace/cord.js/demo/src/utils/generateDid.ts',
    '/workspace/cord.js/demo/src/func-test.ts'
    ]
    }

Node.js v20.10.0

@StillAbeginnerr
Copy link

StillAbeginnerr commented Dec 25, 2023

@adi-a11y sir could you please my issue?

@amarts
Copy link
Member Author

amarts commented Dec 25, 2023

@StillAbeginnerr try npm install @cord.network/[email protected], and then run the func-test

The issue of the generate is because of #157 . Also make sure you update to latest of develop branch.

@StillAbeginnerr
Copy link

StillAbeginnerr commented Dec 30, 2023

I cloned the Latest develop branch and worked but the same issue persists, I thought that running npx tsx demo/src/func-test.ts would show me some demo but somehow I failed again.

I don't understand why it is not referring to utils/key module to get the required library as per issue 157

I looked in the code to see if I could find why the module is missing using issue #157.

image
image
image
image

@StillAbeginnerr
Copy link

@amarts @NiranjanAP

@NiranjanAP
Copy link
Contributor

we'll take a look at this and get back

@NiranjanAP
Copy link
Contributor

Pls make the changes as below, test and create a PR.

diff --git a/demo/src/utils/generateDid.ts b/demo/src/utils/generateDid.ts
index f23517b..ec37b89 100644
--- a/demo/src/utils/generateDid.ts
+++ b/demo/src/utils/generateDid.ts
@@ -1,6 +1,5 @@
 import * as Cord from '@cord.network/sdk'
 import { mnemonicGenerate } from '@polkadot/util-crypto'
-import { generateKeypairs } from './generateKeypairs'
 
 /**
  * It creates a DID on chain, and returns the mnemonic and DID document
@@ -21,7 +20,7 @@ export async function createDid(
     keyAgreement,
     assertionMethod,
     capabilityDelegation,
-  } = generateKeypairs(mnemonic)
+  } = Cord.Utils.Key.generateKeypairs(mnemonic)
   // Get tx that will create the DID on chain and DID-URI that can be used to resolve the DID Document.
   const didCreationTx = await Cord.Did.getStoreTx(
     {

@NiranjanAP
Copy link
Contributor

@StillAbeginnerr
Along with the above changes to fix the generateKeyPair issue, we have also updated the readme to clarify the sdk installation flow.

@StillAbeginnerr
Copy link

StillAbeginnerr commented Jan 7, 2024

@NiranjanAP
I have noted that and applied,
I am confused what is the result (It seems like the server is connected) I don't know if I need to run something else also, and or now just make a documentation on the whole process.

image

@StillAbeginnerr
Copy link

image

@StillAbeginnerr
Copy link

@NiranjanAP https://github.com/StillAbeginnerr/cord.js/blob/develop/README.md
this is my repository and I have made a few changes for the demo script run.

Do I need to include yarn install @cord.network/[email protected] because the latest didn't work on my system?

Npm didn't work for me, so should i include it in the readme or not?

@NiranjanAP
Copy link
Contributor

NiranjanAP commented Jan 7, 2024 via email

@NiranjanAP
Copy link
Contributor

@NiranjanAP https://github.com/StillAbeginnerr/cord.js/blob/develop/README.md this is my repository and I have made a few changes for the demo script run.

Do I need to include yarn install @cord.network/[email protected] because the latest didn't work on my system?

Npm didn't work for me, so should i include it in the readme or not?

You install sdk only if you are writing a new app and want to consume the sdk, read the updated readme
For just running the demo script, you don't need to install the SDK

@StillAbeginnerr
Copy link

Okay i got it, thank you :)

@NiranjanAP
Copy link
Contributor

Once you are able to run CORD instance and test the cordjs demo script. Please update the same in this README as a prerequisite and make a PR. It'll help others trying the same. @StillAbeginnerr

@StillAbeginnerr
Copy link

Once you are able to run CORD instance and test the cordjs demo script. Please update the same in this README as a prerequisite and make a PR. It'll help others trying the same. @StillAbeginnerr

I'm on it.

@Vishalk91-4
Copy link

@NiranjanAP, could you just brief the steps to start

I mean running yarn, then yarn run build
after that I am facing w2s disconnected error for running npx tsx demo/src/func-test.ts

@amarts
Copy link
Member Author

amarts commented Jan 27, 2024

after that I am facing w2s disconnected error for running npx tsx demo/src/func-test.ts

for 'connecting', you would need CORD instance running. On your machine, you should be running a docker instance of cord, or compiled cord to run these scripts. Check the instructions to run cord project locally.

@vilol-04
Copy link

Can I work on this issue?

@StillAbeginnerr
Copy link

StillAbeginnerr commented Feb 1, 2024

I'll make a PR by tomorrow. most of the work is done. had health issues so couldn't work on it. please make me assigned to this issue.

Once you are able to run CORD instance and test the cordjs demo script. Please update the same in this README as a prerequisite and make a PR. It'll help others trying the same. @StillAbeginnerr

I'm on it.

@NiranjanAP
Copy link
Contributor

@StillAbeginnerr since we don't track this regularly, it doesn't make sense to assign if it is not being dedicatedly worked upon. However, once the work is done, feel free to assign to yourself and raise a PR.

@VishnuAmit
Copy link

Hey @NiranjanAP . I would like to take this issue. Kindly assign it to me. Thanks

@scyther
Copy link

scyther commented Apr 28, 2024

Hi , I beleive PR for this issue has been merged . Tried README.md and was able to run yarn demo-statement

Except .nvmrc didn't get the LTS version of Node ( As node LTS needs to be installed first ). A troubleshoot doc can be helpful mentioning to use nvm install lts/*

@SGCODEX
Copy link

SGCODEX commented Oct 4, 2024

Hi, Can this issue be assigned to me?

@vatsa287
Copy link
Member

#88 (comment)

OK by seeing above comment, the documentation needs to mention that CORD needs to be running to test/run the SDK.
We can point out the documentation of setting up of CORD as a redirect as part mandatory pre-requisite.

@SGCODEX
Copy link

SGCODEX commented Oct 19, 2024

Please assign this issue to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C4GT Community documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

10 participants