diff --git a/templates/guide.html b/templates/guide.html new file mode 100644 index 0000000..dec6799 --- /dev/null +++ b/templates/guide.html @@ -0,0 +1,56 @@ + + +
+ +
Blockshell works on blockchain concepts and it creates a tiny blockchain in your local system. So, you will actually learn the concepts like blocks, mining, hashing, proof of work and lot more.
+So, with blockshell you will be creating blocks with simple commands and rest of the tasks will be handled by Blockshell. In this wiki I will try to explain how Blockshell works behind every commands and how it is executing blockchain.
+Letās get start!
+First we will initialize the new blockchain with following command in blockshell CLI.
+[BLOCKSHELL] $ blockshell init --difficulty 3
+Above command initializes new blockchain and creates chain.txt in your working directory where our blockchain data will be stored. You can compare this chain.txt file as real world blockchainās ledger.
+ādifficulty number indicates the difficulty level for blockchainās proof of work. More the number, more time will be taken to mine new block in our blockchain.
+In our blockchain we have Initial Zeros Proof of Work algorithm. So, when we want to mine new block, our PoW will look for the hash that has the initial 3 characters are zeros(0) as right now our blockchainās difficulty level is set to 3 at the time of initialization.
+Eg. hash
+0002fdd96ffec46277a753fa983773599c816dcf100c956afae0a4853fd1ce32
+Letās store some data and Mine very first block of our blockchain by doing PoW.
+[BlockShell] $ dotx hello blockchain
+Blockshell comes with build-in command dotx which is used to create a new transaction and this will mine new block with given data (eg. hello blockchain)
+Output
+[Status] Mining block (1) with PoW ...
+[ Info ] Time Elapsed : 0.0164740085602 seconds.
+[ Info ] Mined Hash : 000eea381e45c9f6c1c330cf991b5b1e7d15f739da3894b703e412881b2c2edd
+Mining this block will depend on the difficulty level of the blockchain. Right now difficulty is of 3 and thats why our block mined in less than a second. After mining action, we received hash of that block with 3 initials as zero as difficulty is 3.
+First block in blockchain is known as Genesis block and which is created manually at the time of blockchain development. In our case, creation of this genesis block is handled by Blockshell. When we initialized the blockchain, it also created genesis block. Lets check this out.
+Now, we have 2 blocks in our blockchain. First is genesis block and other we created in previous step and that contains data hello blockchain
+List all blocks in blockchain with following command
+[BlockShell] $ allblocks
+This lists hashes of all the blocks. Output
+338a2d1ac1b8135283ae19a304b2b426b69b9caba7ef462f246fc577a0297230
+000eea381e45c9f6c1c330cf991b5b1e7d15f739da3894b703e412881b2c2edd
+Letās check whatās inside
+ + + diff --git a/web.py b/web.py index 1bf2c48..0e5e51c 100644 --- a/web.py +++ b/web.py @@ -18,6 +18,10 @@ import json # Init flask app app = Flask(__name__) +# @app.route('/') +# def index(): +# return render_template('guide.html') + @app.route('/') def mined_blocks(): """