Understanding Blockchain using Blockchain CLI

in #writing7 years ago (edited)

Blockchain Noobs 101.jpg

It has been ten months since I am actively and passively involved in the world of cryptocurrency. And through this post, I am going to share my findings in an attempt to understand how the system works. It was not easy for me to understand,as I come from a liberal arts background. However, It was not a significant obstacle, and I've finally begun to comprehend a tiny fragment of the blockchain technology.

Two days ago, while I was sipping my coffee on the patio, and browsing aimlessly, I found a fascinating read on the blockchain technology. It was very exceptional that I finally able to learn more than just about the blockchain. So to say, I am also learning more about coding and continuously into it.

Okay, enough with my boring story. Now let's have a little fun learning the blockchain.

There are three things that you have to install to have this little fun

If you already have those open source program installed on your personal computer then let's get into the game!

Step 1

  • Go to your command line by pressing windows button + R and type cmd and then click ok
  • As soon as you get into command line type this following command

npm install blockchain-cli -g

Capture1.PNG

Step 2

  • Clone the repository of Blockchain interface using installed Git Cmd and type this following command
    git clone https://github.com/seanseany/blockchain-cli

  • Go into the repository
    cd blockchain-cli

  • Install dependencies
    npm install

  • Run the app
    npm start

Note: Since I have it installed already you should see something like this

capture 2.PNG

Step 3

  • Let's mine some randomshit

Capture 1.3.PNG

  • This will be the result

result.PNG

An Explanation of Information shown above

Index (Block #): Which block is it? (Genesis block has index 0)
Hash: Is the block valid?
Previous Hash: Is the previous block valid?
Timestamp: When was the block added?
Data: What information is stored on the block?
Nonce: How many iterations did we go through before we found a valid block?
Source : How does blockchain really work? I built an app to show you.

Breaking it down to pieces

Block records some or all recent transaction in the system, and once it's completed another one will be generated.(based on my understanding, this will create different block each time we input data into the system)

Hash is a unique identifier for data which contains fixed numeric value. Each mined block contains previous hash.

a valid hash has at least four leading 0’s. As the difficulty increases, the number of possible valid hashes decreases. With less possible valid hashes, it takes more processing power to find a valid hash. The process of finding a nonce that corresponds to a valid hash is mining.
Source : How does blockchain really work? I built an app to show you.

Data is an input or more like the information we stored in the blockchain.( like in steemit, it's in form of a post).

Nonce this is a concept I barely understand. But, from what I've read it is a number to find a valid hash.

How does mining works ?

My assumption is that you have installed all required programs. Now, let's understand how mining works.

  • Repeat the steps of opening command line

capture 1.PNG

  • Then it will appear something like this

Capture2.PNG

  • Type on blockchain to know the current state of blockchain and it will appear something like this

capture 3.PNG

  • Let's do a comparation with this new mined block as an illustration I use the word "steem". You can use the word " shit" " cat" whatever at your own fancy.

capture4.PNG

If you look at the the previous hash, it is containing the first block mined then it generates another identifier (hash) for the current mined block. The cycle won't stop as long as there is always new data to be mined.

I still sound too practical and technical. I have yet to demonstrate in dummy way but well I hope you get what I am writing.If not then you get git installed and you can explore cool open sources code and do some experiments.

References : 1 2 34

Sort:  

This is something I neee to read after work. That is why I am commenting here so that the post is

:D yup have fun trying !

Pleased this got resteemed, everyone should read this post if they are using or holding crypto.

@newsdesk oh well yes, if you're holding a crypto or using a crypto above is the way to understand what's mining and how the system works. I am still on a progress in finishing that. I'll try to finish it today.

this post is so helpful
i haven't found an easier explanation before
resteemed

Thank you for the resteem. The post is still on progress but anyway thank you and you can try those things above on your own :)

This post received a 11.7% vote by @msp-lovebot courtesy of @clayboyn from the Minnow Support Project ( @minnowsupport ). Join us in Discord.

Upvoting this comment will help support @minnowsupport.

This post received a 11.7% vote by @minnowsupport courtesy of @clayboyn from the Minnow Support Project ( @minnowsupport ). Join us in Discord.

Upvoting this comment will help support @minnowsupport.

This post has been resteemed by @minnowsupport courtesy of @clayboyn from the Minnow Support Project ( @minnowsupport ). Join us in Discord.

Upvoting this comment will help support @minnowsupport.

Great post, I'm looking forward to the rest of it.
And future articles, eg some practical simple tutorials on doing stuff
perhaps finding a block or listing all new blocks that meet some criteria
eg a list every time some whale votes or posts or something
Thanks for posting

Thank you, I am still in progress working for this. I am trying to find another resource to understand several things above but if you have node.js installed and git for windows then sky is the limit for you to explore.