Skip to content

Instantly share code, notes, and snippets.

View 26rahulsingh's full-sized avatar

Rahul Singh 26rahulsingh

View GitHub Profile
@26rahulsingh
26rahulsingh / hyperledger-composer-setup.txt
Created January 2, 2019 05:47
hyperledger composer setup.
1. Run following command to create .bna file -
composer archive create -t dir -n .
2. Go to fabric-dev-servers folder and create PeerAdminCard
./createPeerAdminCard.sh
3. Go to fabric-dev-servers folder and start fabric
./startFabric.sh
4. Run command to check available card list
@26rahulsingh
26rahulsingh / eos-setup.txt
Created January 2, 2019 05:44
EOS Single and Multi Node Setup
================== Local Single Node Setup =============
1. cd eos
2. Build eos -> eosio_build.sh
3. Install eos -> eosio_install.sh
4. cd eos/build/programs/nodeos
5. ./nodeos -e -p eosio --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin
@26rahulsingh
26rahulsingh / cordite-network-map.sh
Created January 2, 2019 05:40
This script sets up a network map using docker and registers a notary and a regular node that are run using java.
#!/bin/bash
# This example sets up a network map using docker and registers a notary and a regular node that are run using java
# Make sure your node's node.conf has the following:
#
# compatibilityZoneURL="http://localhost:8080"
# devMode=false
# keyStorePassword="cordacadevpass"
# trustStorePassword="trustpass"
/**
* Base contract that all upgradeable contracts should use.
*
* Contracts implementing this interface are all called using delegatecall from
* a dispatcher. As a result, the _sizes and _dest variables are shared with the
* dispatcher contract, which allows the called contract to update these at will.
*
* _sizes is a map of function signatures to return value sizes. Due to EVM
* limitations, these need to be populated by the target contract, so the
* dispatcher knows how many bytes of data to return from called functions.
pragma solidity ^0.4.17;
import './MedicalRecord.sol';
contract Hospital {
MedicalRecord public medicalRecord;
struct Patient {
bytes32 fullName;
bool access;
@26rahulsingh
26rahulsingh / Donation.sol
Created December 3, 2018 07:41 — forked from fabdarice/Donation.sol
Relay contract that contains only one state variable 'user_amounts' - Link first to Donation contract, then update to DonationNew to add the cancelDonation function.
contract Donation {
mapping (address => uint) user_amounts;
/* DOES THIS METHODS MODIFY user_amounts of the Relay contract ??? */
function sendDonation(uint n) {
user_amounts[msg.sender] = user_amounts[msg.sender] + n
}
}
@26rahulsingh
26rahulsingh / Database.sol
Created December 3, 2018 07:37 — forked from tjade273/Database.sol
Example of separated storage and logic
contract Database{
mapping(uint => uint) public _data;
mapping(address => bool) _owners;
function Database(address[] owners){ //Called once at creation, pass in initial owners
for(uint i; i<owners.length; i++){
_owners[owners[i]]=true;
}
}
@26rahulsingh
26rahulsingh / nginx.conf
Created November 12, 2018 07:59 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048