diff --git a/.gitignore b/.gitignore
index 0cc252c..fed61f6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@ venv/
build/
dist/
blockshell/
+blockshell.egg-info/
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..d5be28f
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2018 Daxeel Soni
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/README.md b/README.md
index 398b024..9ba3058 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,71 @@
-# blockshell
-A command line utility for learning Blockchain.
+# BlockShell
+A command line utility for learning Blockchain technical concepts likechaining, mining, proof of work etc.
+
+
+
+
+## About
+Anyone who wants to understand how blockchain technology works, then BlockShell should be a great start. Because I have created BlockShell keeping blockchain fundamentals in the center of development. With BlockShell you will actually create a tiny blockchain in your system where you can create blocks with data, explore blocks etc.
+
+So, by using BlockShell anyone can learn following blockchain concepts,
+* Block & Chaining
+* Hashing
+* Mining
+* Proof of Work
+
+## BlockShell Web Explorer
+
BlockShell comes with built-in blockchain explorer by which you can actully see how blocks are mined and what is stored and where.
+ +Latest Mined Blocks | Block Details +:------------------------------:|:-------------------------: + |  + +## Installation +Step 1 - Create project directory +``` +mkdir
+
+## Lanuch BlockShell Web
+Step 1 - Start new terminal window, go to cloned directory
+
+Step 2 - Start web.py
+```
+python web.py
+```
+
+Step 3 - Go to 127.0.0.1:5000 address in browser and boom!
+
diff --git a/bscli.py b/bscli.py
index 4423018..4c02c65 100644
--- a/bscli.py
+++ b/bscli.py
@@ -1,11 +1,25 @@
# -*- coding: utf-8 -*-
-# import modules
+# ==================================================
+# ==================== META DATA ===================
+# ==================================================
+__author__ = "Daxeel Soni"
+__url__ = "https://daxeel.github.io"
+__email__ = "daxeelsoni44@gmail.com"
+__license__ = "MIT"
+__version__ = "0.1"
+__maintainer__ = "Daxeel Soni"
+
+# ==================================================
+# ================= IMPORT MODULES =================
+# ==================================================
import click
import urllib
import json
from blockchain.chain import Block, Blockchain
-# Supported commands
+# ==================================================
+# ===== SUPPORTED COMMANDS LIST IN BLOCKSHELL ======
+# ==================================================
SUPPORTED_COMMANDS = [
'dotx',
'allblocks',
@@ -19,9 +33,14 @@ coin = Blockchain()
# Create group of commands
@click.group()
def cli():
+ """
+ Create a group of commands for CLI
+ """
pass
-# Start lbc cli
+# ==================================================
+# ============= BLOCKSHELL CLI COMMAND =============
+# ==================================================
@cli.command()
@click.option("--difficulty", default=3, help="Difine dufficulty level of blockchain.")
def init(difficulty):
@@ -36,19 +55,23 @@ def init(difficulty):
> A command line utility for learning Blockchain concepts.
> Type 'help' to see supported commands.
+ > Project by Daxeel Soni - https://daxeel.github.io
"""
# Set difficulty of blockchain
coin.difficulty = difficulty
- # Start lbc chell
+ # Start blockshell shell
while True:
cmd = raw_input("[BlockShell] $ ")
processInput(cmd)
-# Process input from LBC shell
+# Process input from Blockshell shell
def processInput(cmd):
+ """
+ Method to process user input from Blockshell CLI.
+ """
userCmd = cmd.split(" ")[0]
if len(cmd) > 0:
if userCmd in SUPPORTED_COMMANDS:
@@ -58,10 +81,14 @@ def processInput(cmd):
msg = "Command not found. Try help command for documentation"
throwError(msg)
-# ------------------------------------
-# Supported Commands Methods
-# ------------------------------------
+
+# ==================================================
+# =========== BLOCKSHELL COMMAND METHODS ===========
+# ==================================================
def dotx(cmd):
+ """
+ Do Transaction - Method to perform new transaction on blockchain.
+ """
txData = cmd.split("dotx ")[-1]
if "{" in txData:
txData = json.loads(txData)
@@ -69,12 +96,18 @@ def dotx(cmd):
coin.addBlock(Block(data=txData))
def allblocks(cmd):
+ """
+ Method to list all mined blocks.
+ """
print ""
for eachBlock in coin.chain:
print eachBlock.hash
print ""
def getblock(cmd):
+ """
+ Method to fetch the details of block for given hash.
+ """
blockHash = cmd.split(" ")[-1]
for eachBlock in coin.chain:
if eachBlock.hash == blockHash:
@@ -83,10 +116,16 @@ def getblock(cmd):
print ""
def help(cmd):
+ """
+ Method to display supported commands in Blockshell
+ """
print "Commands:"
print " dotx