html cleaned
This commit is contained in:
parent
3ef5d6fc1f
commit
30c0ace50e
|
|
@ -8,7 +8,6 @@
|
|||
<title>Blockshell | All Blocks</title>
|
||||
<!-- Bootstrap core CSS -->
|
||||
<link href="https://blackrockdigital.github.io/startbootstrap-bare/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
|
||||
|
||||
<!-- Custom styles for this template -->
|
||||
<style>
|
||||
body {
|
||||
|
|
@ -30,9 +29,9 @@
|
|||
color: #000;
|
||||
}
|
||||
.code {
|
||||
background: #192a56;
|
||||
color: #fff;
|
||||
padding: 10px;
|
||||
background: #192a56;
|
||||
color: #fff;
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
|
@ -57,86 +56,47 @@
|
|||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-10" style="margin-top:20px;">
|
||||
|
||||
|
||||
<!-- <p><img src="https://image.ibb.co/dHkZyb/Logomakr_3_Of_FH7.png" height="100"></p> -->
|
||||
|
||||
<h2 id="introduction">🏁 Introduction</h2>
|
||||
|
||||
<p>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.</p>
|
||||
|
||||
<p>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.</p>
|
||||
|
||||
<p>Let's get start! </p>
|
||||
|
||||
<h2 id="initializenewblockchain">🆕 Initialize New Blockchain</h2>
|
||||
|
||||
<p>First we will initialize the new blockchain with following command in blockshell CLI.</p>
|
||||
|
||||
<p class="code">[BLOCKSHELL] $ blockshell init --difficulty 3</p>
|
||||
|
||||
<p>Above command initializes new blockchain and creates <strong>chain.txt</strong> in your working directory where our blockchain data will be stored. You can compare this chain.txt file as real world blockchain's <strong>ledger</strong>.</p>
|
||||
|
||||
<p><strong>--difficulty</strong> 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.</p>
|
||||
|
||||
<p>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.</p>
|
||||
|
||||
<p>Eg. hash</p>
|
||||
|
||||
<p class="code">0002fdd96ffec46277a753fa983773599c816dcf100c956afae0a4853fd1ce32
|
||||
</p>
|
||||
|
||||
<h2 id="minefirstblock">⛏️ Mine First Block</h2>
|
||||
|
||||
<p>Let's store some data and Mine very first block of our blockchain by doing PoW.</p>
|
||||
|
||||
<p class="code">[BlockShell] $ dotx hello blockchain
|
||||
</p>
|
||||
|
||||
<p>Blockshell comes with build-in command <strong>dotx</strong> which is used to create a new transaction and this will mine new block with given data (eg. hello blockchain)</p>
|
||||
|
||||
<p>Output</p>
|
||||
|
||||
<p class="code">[Status] Mining block (1) with PoW ...<br>
|
||||
[ Info ] Time Elapsed : 0.0164740085602 seconds.<br>
|
||||
[ Info ] Mined Hash : 000eea381e45c9f6c1c330cf991b5b1e7d15f739da3894b703e412881b2c2edd
|
||||
</p>
|
||||
|
||||
<p>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.</p>
|
||||
|
||||
<h2 id="genesisblocks">📦 Genesis Blocks</h2>
|
||||
|
||||
<p>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.</p>
|
||||
|
||||
<h2 id="exploreblockchain">🕸️ Explore Blockchain</h2>
|
||||
|
||||
<p>Now, we have 2 blocks in our blockchain. First is <strong>genesis block</strong> and other we created in previous step and that contains data <strong>hello blockchain</strong></p>
|
||||
|
||||
<p>List all blocks in blockchain with following command</p>
|
||||
|
||||
<p class="code">[BlockShell] $ allblocks
|
||||
</p>
|
||||
|
||||
<p>This lists hashes of all the blocks.
|
||||
Output</p>
|
||||
|
||||
<p class="code">338a2d1ac1b8135283ae19a304b2b426b69b9caba7ef462f246fc577a0297230
|
||||
000eea381e45c9f6c1c330cf991b5b1e7d15f739da3894b703e412881b2c2edd
|
||||
</p>
|
||||
|
||||
<h2 id="viewblockdata">ℹ️ View Block Data</h2>
|
||||
|
||||
<p>Let's check what's inside each block. For this Blockshell has <strong>getblock</strong> command.</p>
|
||||
|
||||
<p>Here, <strong>338a2d1ac1b8135283ae19a304b2b426b69b9caba7ef462f246fc577a0297230</strong> is genesis block. Let's look inside our genesis block</p>
|
||||
|
||||
<p class="code">[BlockShell] $ getblock 338a2d1ac1b8135283ae19a304b2b426b69b9caba7ef462f246fc577a0297230
|
||||
</p>
|
||||
|
||||
<p>Output</p>
|
||||
|
||||
|
||||
<pre><code><p class="code">{
|
||||
<!-- <p><img src="https://image.ibb.co/dHkZyb/Logomakr_3_Of_FH7.png" height="100"></p> -->
|
||||
<h2 id="introduction">🏁 Introduction</h2>
|
||||
<p>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.</p>
|
||||
<p>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.</p>
|
||||
<p>Let's get start! </p>
|
||||
<h2 id="initializenewblockchain">🆕 Initialize New Blockchain</h2>
|
||||
<p>First we will initialize the new blockchain with following command in blockshell CLI.</p>
|
||||
<p class="code">[BLOCKSHELL] $ blockshell init --difficulty 3</p>
|
||||
<p>Above command initializes new blockchain and creates <strong>chain.txt</strong> in your working directory where our blockchain data will be stored. You can compare this chain.txt file as real world blockchain's <strong>ledger</strong>.</p>
|
||||
<p><strong>--difficulty</strong> 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.</p>
|
||||
<p>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.</p>
|
||||
<p>Eg. hash</p>
|
||||
<p class="code">0002fdd96ffec46277a753fa983773599c816dcf100c956afae0a4853fd1ce32</p>
|
||||
<h2 id="minefirstblock">⛏️ Mine First Block</h2>
|
||||
<p>Let's store some data and Mine very first block of our blockchain by doing PoW.</p>
|
||||
<p class="code">[BlockShell] $ dotx hello blockchain</p>
|
||||
<p>Blockshell comes with build-in command <strong>dotx</strong> which is used to create a new transaction and this will mine new block with given data (eg. hello blockchain)</p>
|
||||
<p>Output</p>
|
||||
<p class="code">[Status] Mining block (1) with PoW ...<br>
|
||||
[ Info ] Time Elapsed : 0.0164740085602 seconds.<br>
|
||||
[ Info ] Mined Hash : 000eea381e45c9f6c1c330cf991b5b1e7d15f739da3894b703e412881b2c2edd
|
||||
</p>
|
||||
<p>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.</p>
|
||||
<h2 id="genesisblocks">📦 Genesis Blocks</h2>
|
||||
<p>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.</p>
|
||||
<h2 id="exploreblockchain">🕸️ Explore Blockchain</h2>
|
||||
<p>Now, we have 2 blocks in our blockchain. First is <strong>genesis block</strong> and other we created in previous step and that contains data <strong>hello blockchain</strong></p>
|
||||
<p>List all blocks in blockchain with following command</p>
|
||||
<p class="code">[BlockShell] $ allblocks</p>
|
||||
<p>This lists hashes of all the blocks.
|
||||
Output
|
||||
</p>
|
||||
<p class="code">338a2d1ac1b8135283ae19a304b2b426b69b9caba7ef462f246fc577a0297230
|
||||
000eea381e45c9f6c1c330cf991b5b1e7d15f739da3894b703e412881b2c2edd
|
||||
</p>
|
||||
<h2 id="viewblockdata">ℹ️ View Block Data</h2>
|
||||
<p>Let's check what's inside each block. For this Blockshell has <strong>getblock</strong> command.</p>
|
||||
<p>Here, <strong>338a2d1ac1b8135283ae19a304b2b426b69b9caba7ef462f246fc577a0297230</strong> is genesis block. Let's look inside our genesis block</p>
|
||||
<p class="code">[BlockShell] $ getblock 338a2d1ac1b8135283ae19a304b2b426b69b9caba7ef462f246fc577a0297230</p>
|
||||
<p>Output</p>
|
||||
<pre><code><p class="code">{
|
||||
'nonce': 0,
|
||||
'index': 0,
|
||||
'hash': '338a2d1ac1b8135283ae19a304b2b426b69b9caba7ef462f246fc577a0297230',
|
||||
|
|
@ -145,16 +105,10 @@ Output</p>
|
|||
'data': 'Genesis Block'
|
||||
}
|
||||
</p></code></pre>
|
||||
|
||||
|
||||
<p>Similarly, let's check what's inside our own created block.</p>
|
||||
|
||||
<p class="code">[BlockShell] $ getblock 000eea381e45c9f6c1c330cf991b5b1e7d15f739da3894b703e412881b2c2edd
|
||||
</p>
|
||||
|
||||
<p>Output</p>
|
||||
|
||||
<pre><code>
|
||||
<p>Similarly, let's check what's inside our own created block.</p>
|
||||
<p class="code">[BlockShell] $ getblock 000eea381e45c9f6c1c330cf991b5b1e7d15f739da3894b703e412881b2c2edd</p>
|
||||
<p>Output</p>
|
||||
<pre><code>
|
||||
<p class="code">{
|
||||
'nonce': 1959,
|
||||
'index': 1,
|
||||
|
|
@ -164,22 +118,12 @@ Output</p>
|
|||
'data': 'hello blockchain'
|
||||
}
|
||||
</p></code></pre>
|
||||
|
||||
<h2 id="launchblockshellweb">🌐 Launch Blockshell Web</h2>
|
||||
|
||||
<p><img src="https://camo.githubusercontent.com/c9b552114993e55b13a1f6c6a25b47a4c02a3572/68747470733a2f2f707265766965772e6962622e636f2f695a61356a472f53637265656e5f53686f745f323031385f30315f32355f61745f31315f32355f32325f504d2e706e67"></p>
|
||||
|
||||
<p>Blockshell comes with built-in Blockchain web explorer. You can search blocks and data in your blockchain from your web browser.</p>
|
||||
|
||||
<p>Open new terminal, go to cloned Blockshell directory and run web.py python script.</p>
|
||||
|
||||
<p class="code">python web.py
|
||||
</p>
|
||||
|
||||
<p>Go to localhost <a href="http://127.0.0.1:5000/allblocks">127.0.0.1:5000/allblocks</a> in browser and give it a shot!</p>
|
||||
|
||||
|
||||
|
||||
<h2 id="launchblockshellweb">🌐 Launch Blockshell Web</h2>
|
||||
<p><img src="https://camo.githubusercontent.com/c9b552114993e55b13a1f6c6a25b47a4c02a3572/68747470733a2f2f707265766965772e6962622e636f2f695a61356a472f53637265656e5f53686f745f323031385f30315f32355f61745f31315f32355f32325f504d2e706e67"></p>
|
||||
<p>Blockshell comes with built-in Blockchain web explorer. You can search blocks and data in your blockchain from your web browser.</p>
|
||||
<p>Open new terminal, go to cloned Blockshell directory and run web.py python script.</p>
|
||||
<p class="code">python web.py</p>
|
||||
<p>Go to localhost <a href="http://127.0.0.1:5000/allblocks">127.0.0.1:5000/allblocks</a> in browser and give it a shot!</p>
|
||||
</div>
|
||||
<div class="col-lg-2" style="margin-top:80px;">
|
||||
<div class="card" style="width: 13rem;">
|
||||
|
|
|
|||
Loading…
Reference in New Issue