Skip to content

Instantly share code, notes, and snippets.

View AkshayCHD's full-sized avatar

Akshay Kumar AkshayCHD

View GitHub Profile

Fossasia CodeHeat

Akshay Kumar | FOSSASIA

Overview:

I started my codeheat journey in October last year which was the time when I myself started with open source. During Codeheat all the work I did was on Open Event Android project. Broadly i worked on creating menu options for showing event details to the users

Code Contributions:

Open Event Android:

@AkshayCHD
AkshayCHD / Hyperledger_Fabric.md
Created December 31, 2018 04:46
Details regarding Hyperlegger Fabric

Blockchain Developer Primariy interests

Application

Provides end user the ability to interact with the Blockchain

Smart Contract

Bussiness logic that governs the working of data on the blockchain

They do not have to care about

Peers

Security

Concensus

@AkshayCHD
AkshayCHD / gist:1883f2aed56859f358620d3d5198c34f
Last active March 6, 2020 08:36
Fabric samples balance transfer

Balance transfer

A sample Node.js app to demonstrate fabric-client & fabric-ca-client Node.js SDK APIs

Prerequisites and setup:

Node js Tutorial

First app

firstly to run a node js file, we save the file, lets say the file is named app.js so we execute

node app.js 

Using contents from different files

Node Basics

What is Node js

We call node js a run time environment for executing javascript code. Before node we use javascript only to run applications that run inside the browser, they cannot use the resources of the machine they were working on. So to get that working every browser had a javascript engine that converted for example microsoft edge uses chakra, firefox uses spidermonkey and chrome uses v8(which is the fastest).

In 2019 Ryan Dhal came up with an extraordinary idea. He took the fastest javascript engine and eclosed it in a c++ program and called it node.exe. So similar to a browser node is a runtime environment for javascript code that has the capability of running javascript code outside the browser. It provides us the capability to interact with several objects that can provide us the functionality to perform tasks that cannot be performed on the browser. Like the filesystem(fs) module or the http module. Both chrome and node share the same javascript engines but provide different run

Express Framework Tutorial

Why Express ?

Since we can create and manage web servers using the http module why do you think there is a need for a framework like express. To understand that Let us create a server

const http = require('http');

const server = http.createServer((req, res) => {
    if(req.url == '/') {
        console.log("base url hit")

Setting up Fabric-ca

Cloning up fabric-ca

  1. clone the repository https://github.com/hyperledger/fabric-ca in the directory where you have your golang installed and inside the directory into the following subdirectory /src/github.com/hyperledger
  2. cd into the cloned fabric-ca directory
  3. run the command make fabric-ca-server and make fabric-ca-client inside fabric-ca, to generate the client and server executable which would be located inside the bin folder of the current directory.

fabric-ca-server setup

  1. export the following path variable export PATH=$PATH:~/go/src/github.com/hyperledger/fabric-ca/bin

Gcompris

Multiple dataset Migration of an Activity

This post is a step by step tutorial for adding multiple datasets to an activity in Gcompris.
The procedure of adding multiple datasets to an activity is fairly simple in Gcompris. The steps for it are given below.
Note: In these steps we'll refer the activity in consideration as current_activity. Also we assume that we plan to add 3 datasets to current_activity.

PROCEDURE

  • Add the following line to current_activity/ActivityInfo.qml file
    levels: "1,2,3"
    

Adding Org to the Balance Transfer network

I was trying to add a new org to my existing network using the Hyperledger Fabric node sdk. I turorial that i refrenced was https://fabric-sdk-node.github.io/tutorial-channel-create.html. Although the tutorial is for adding a new channel to a network, I assumed that the approach for updating the channel configs would be somewhat similar to creating a new channel configuration.

The api that I created using the tutorial and referencing the existing apis in the project is as follows.

/**
 * Copyright 2017 IBM All Rights Reserved.

Overview

For Google Summer of Code 2019, I am working on KDE community's project Gcompris. GCompris is a high quality educational software suite, including a large number of activities for children aged 2 to 10. Currently GCompris offers more than 100 activities, and more are being developed. For me the journey from making my first contribution to Gcompris, to my Google Summer of Code Project has been very interesting, and in this post I'll be discussing about my GSoC project i.e Adding multiple datasets to Gcompris

What are multiple datasets ?

Most of the activities are provided a dataset in json(mostly) format, which contains data about the various parameters of an activity separated in various levels that determine the functioning of the activity.