Showing posts with label blocks. Show all posts
Showing posts with label blocks. Show all posts

Monday, 1 October 2018

Workshop 1: Creating a Hyperledger Fabric network

Hyperledger Fabric Network

Creating a first hyperledger fabric network through Amazon AWS
  1. create an AWS account
  2. I created an AWS student account through www.awseducate.com
    Through your workbench, go to AWS console and create an EC2 instance
    Go to Services-> ec2-> launchinstance-> Ubuntu Server 16.04 LTS (HVM), SSD Volume Type-> m4large
    Add tag->basicnetwork, Create a new key-pair, Download key pair and click launch instance
  3. Connecting to the instance
  4. Once the instance has started, you can connect it through Putty
    Before connecting, convert the .pem file (key pair) into .ppk file using PuttyGen. This step is required because Putty requires a .ppk file and cannot connect using .pem file
    Now add .ppk file to Putty, and connect to the IP of the running AWS instance
  5. Creating first network - installing prerequisites
    1. Install cURL
    2. Type on the terminal cURL command to check if its installed or run cURL --version. If it is not installed you can install it through below command
      sudo apt-get install curl
    3. Install Docker and Docker Compose
    4. and
    5. Install GO Programming Language
    6. Don't forget to set the path. Run command export PATH=$PATH:$GOPATH/bin
    7. Install Node.js Runtime and NPM
    8. Install Python
    9. Retrieve the Python version 2.7, which is goof for running Fabric Node.js SDK, by using command sudo apt-get install python
      You can also check python version by command "python --version"
      You are essentially done for installing the prerequisites. You can refer to detailed installation article herehttps://hyperledger-fabric.readthedocs.io/en/latest/prereqs.html
  6. Installing Sample Binaries and Docker Images
  7. Once you are ready, and in the directory into which you will install the Fabric Samples and binaries, go ahead and execute the following command: curl -sSL http://bit.ly/2ysbOFE | bash -s 1.2.0
    then, curl -sSL http://bit.ly/2ysbOFE | bash -s curl -sSL http://bit.ly/2ysbOFE | bash -s 1.2.0 1.2.0 0.4.10
    I faced an issue of Docker permission denied while trying to connect to the Docker daemon socket
    I solved the issue with command sudo usermod -a -G docker $USER . Don't forget to completely log out of your account and log back in (if in doubt, reboot!):
  8. Running first network
  9. cd fabric-samples/first-network
    Ready to give it a go. Run the command: ./byfn.sh generate
    This command generates all the certificates. And after this, bring up the network
    ./byfn.sh up
    If you’d like to run through this tutorial with node chaincode, pass the following command instead:
    we use the -l flag to specify the chaincode language forgoing the -l flag will default to Golang
    ./byfn.sh up -l node
    Bring down the network with the command ./byfn.sh down

Sunday, 9 September 2018

Blockchain basics

→ Blockchain is a decentralized, incorruptible digital ledger that can record transactions (like, but not limited to, financial transactions) directly among peers without having involvement of a third party or centralized system. 

As an analogy, it can be thought of as a distributed database that maintains a shared list of records. These records are called blocks. Each encrypted block holds the history of blocks that came before it, with timestamped transaction data which chain the blocks together and hence termed as blockchain.

The blockchain is also called public ledger because it is openly available for everyone to read.

Its main characteristics are:

  1. Decentralized peer to peer network
  2. Establishing trust among unknown peers
  3. Recording the transaction in immutable, distributed ledger
How is trust achieved?
  1. Validate, Verify and confirm transactions
  2. Record the transactions in a distributed ledger of blocks
  3. Create a tamper-proof chain of blocks
  4. Implement a consensus protocol for agreement on the block to be added in the chain


Distributed Ledger

In its simplest form, a distributed ledger is a database held and updated independently by each participant (or node) in a large network. The distribution is unique: records are not communicated to various nodes by a central authority but are instead independently constructed and held by every node. That is, every single node on the network processes every transaction, coming to its own conclusions and then voting on those conclusions to make certain the majority agree with the conclusions.
Once there is this consensus, the distributed ledger has been updated, and all nodes maintain their own identical copy of the ledger. This architecture allows for a new dexterity as a system of record that goes beyond being a simple database.


From <https://www.coindesk.com/information/what-is-a-distributed-ledger/