dhiway / cord.js

Cord JS API
Apache License 2.0
35 stars 46 forks source link

[DMP 2024]: Create a core modules of cord.js sdk in Golang #165

Open NiranjanAP opened 5 months ago

NiranjanAP commented 5 months ago

Description

cord.js is an SDK to connect to CORD. We have a requirement to write the same SDK in Golang. As part of this we have to first create the core SDK modules that include the DID and Chainspace. Scope of this issue it to create an SDK in Golang along with any dependencies.

Goals

Expected Outcome

We should have a functioning sdk written in Golang that connects to CORD and is able to make calls to CORD

Acceptance Criteria

Fully functioning SDK written in Golang with all the available methods/functions implemented A working demo script similar to https://github.com/dhiway/cord.js/blob/develop/demo/src/func-test.ts All the unit test cases implemented

Implementation Details

Refer cord.js repo for reference SDK written in typescript, this needs to be replicated in Golang Refer to the documentation https://docs.cord.network/cordjs/integratecord/ for the detailed explanation on the working of demo script https://github.com/dhiway/cord.js/blob/develop/demo/src/func-test.ts Note: There will be some dependency modules before these two modules can work

Mockups/Wireframes

NA

Product Name

cord sdk in Golang

Organisation Name

Dhiway

Domain

Open Source Library

Tech Skills Needed

Go, TypeScript

Mentors

@vatsa287 @adi-a11y @amarts @NiranjanAP

Category

Other

Shruti3004 commented 4 months ago

Want to know more about CORD? Check the whitepaper here.

Dushyantbha012 commented 3 months ago

I have forked the cord.js repository and read the CORD white papers but still I am not able to figure out the whole flow of code. Could you please tell me what should I do to proceed further to understand the CORD.js and its connection with CORD, I know both GoLang and TypeScript but have not worked with blockchains much so I am able to understand code in chunks but I am not able to understand how are we setting up connection with the blockchain and transferring data. @adi-a11y @NiranjanAP @amarts

rohitkori commented 3 months ago

Hi @NiranjanAP, I am interested in this project. I have experience working on various projects and have worked with various tech stacks like Node.js, Django, and ReactJs, as well as DevOps tools such as Docker and Kubernetes. Additionally, I am one of the coordinators of the open-source community at my college and have worked on open-source projects. Could you please provide me with more details about the project description and approach? I would appreciate your help in gaining further insights.

yuvrajrathva commented 3 months ago

Hi @adi-a11y , @amarts , and @NiranjanAP , I'm Yuvraj Rathva, a Computer Science and Engineering student from IIT Jodhpur. The cord sdk in Golang project by Dhiway has captured my interest, and I'm eager to contribute. With expertise in Go and JavaScript(can work with TypeScript), I believe I can effectively contribute to achieving the project goals.

This project interests me because I have an interest in Go development and have experience in using Go routines, interfaces, WaitGroup, etc. in my networking projects, along with 2 year long experience in JavaScript will definitely help me in working with TypeScript. To know more about my experiences and projects, you can check my Github or Portfolio.

Here's how I can contribute:

I'm excited to contribute to this project and help create a functioning SDK in Golang for connecting to CORD. Looking forward to collaborating with you all!

AbhimanyuSamagra commented 3 months ago

Do not ask process related questions about how to apply and who to contact in the above ticket. The only questions allowed are about technical aspects of the project itself. If you want help with the process, you can refer instructions listed on Unstop and any further queries can be taken up on our Discord channel titled DMP queries.

nikhil822 commented 3 months ago

The local development environment guide does not seem to work for me when I am trying to set up cord.js. I have followed the guide, but when building/installing the modules, I get the following errors: I get this error when running “yarn build” : The command failed for workspaces that are depended upon by other workspaces; can’t satisfy the dependency graph Failed with errors in 29s, 500ms

Can somebody help me out?

Thanks in advance

NiranjanAP commented 3 months ago

@vatsa287 can you please help the contributors here?

vatsa287 commented 3 months ago

The local development environment guide does not seem to work for me when I am trying to set up cord.js. I have followed the guide, but when building/installing the modules, I get the following errors: I get this error when running “yarn build” : The command failed for workspaces that are depended upon by other workspaces; can’t satisfy the dependency graph Failed with errors in 29s, 500ms

Can somebody help me out?

Thanks in advance

@nikhil822 Can you please share the screenshot. Please do yarn then yarn build.

vatsa287 commented 3 months ago

I have forked the cord.js repository and read the CORD white papers but still I am not able to figure out the whole flow of code. Could you please tell me what should I do to proceed further to understand the CORD.js and its connection with CORD, I know both GoLang and TypeScript but have not worked with blockchains much so I am able to understand code in chunks but I am not able to understand how are we setting up connection with the blockchain and transferring data. @adi-a11y @NiranjanAP @amarts

@Dushyantbha012 So with substrate we have something called a type bundle, which is similar to an interface which defines all the extrinsics supported by the chain. We connect to the chain at running port using Cord.connect(networkAddress), you can see this and execute demo scripts(made for understanding the interaction with the chain: repo-link-for-cord-demo-scripts . We load all the type bundles and set the api as init to all sdk methods.

Then use that api variable as conn variable which includes version, typebundles etc to call required methods to interact with the chain.

nikhil822 commented 3 months ago

image

@vatsa287 Here is the screenshot. I had done both yarn and yarn build

vatsa287 commented 3 months ago

@nikhil822 are you running it on windows?

nikhil822 commented 3 months ago

@nikhil822 are you running it on windows?

Yes

vatsa287 commented 3 months ago

@nikhil822 are you running it on windows?

Yes

Please build on a virtual machine with Linux OS which is preferred for your case.

Savio629 commented 3 months ago

@nikhil822 You can test it on codespace or gitpod if you don't have Linux locally Works well image

nikhil822 commented 3 months ago

@nikhil822 You can test it on codespace or gitpod if you don't have Linux locally Works well image

Will try and let you know

EuclidStellar commented 3 months ago

HI @NiranjanAP @vatsa287 @Shruti3004 @nikhil822 @Dushyantbha012 ,

I'm Gaurav Singh, a sophomore at AKGEC Ghaziabad, with a passion for coding and technology. I've had hands-on experience with both Go and JavaScript, making me well-equipped for the task ahead. As a Full Stack Developer, I've delved into various projects, including working with @Blockchain-Research-Lab honing my skills in both backend and frontend development.

For the "cord sdk in Golang" project with Dhiway, my role will be crucial in spearheading the development of the Go SDK to connect to CORD. Leveraging my experience with Go, I'll meticulously craft the core SDK modules, focusing on the DID and Chainspace components. Drawing from my background in JavaScript, particularly with TypeScript, I'll closely reference the existing cord.js repository to ensure a seamless transition of functionality into Golang.

In terms of documentation and engineering, I'll adopt a systematic approach. I'll diligently document each step of the development process, ensuring clarity and transparency for future contributors. This documentation will include detailed explanations of implementation choices, code structures, and usage guidelines for the SDK. Additionally, I'll prioritize writing comprehensive unit tests for both the DID and Chainspace modules, ensuring robustness and reliability of the SDK.

Overall, my proficiency in both Go and JavaScript, coupled with my experience in software development and open-source contributions, positions me well to take on this project. I'm excited to collaborate with mentors and fellow contributors at Dhiway to deliver a high-quality Go SDK for CORD.

Here's my GitHub: @euclidstellar

AbhimanyuSamagra commented 2 months ago

Do not ask process related questions about how to apply and who to contact in the above ticket. The only questions allowed are about technical aspects of the project itself. If you want help with the process, you can refer instructions listed on Unstop and any further queries can be taken up on our Discord channel titled DMP queries. Here's a Video Tutorial on how to submit a proposal for a project.