Creating (and Debugging) Your Own Blockchain

--

So many people talk about blockchain and DLTs (Distributed Ledger Technology), but have little idea about what happens underneath. This can often lead to a naive approach. So, let’s create our own blockchain, and test it. First, we open up remix (https://remix.ethereum.org/) and add our smart contract. This contact just has four methods which can be used to add [add()], subtract [sub()], multiply [mul()], square [sqr()] and take a square root [sqrt()]:

Now, we need to install Ganache (https://trufflesuite.com/ganache/index.html). After this is installed we can run Ganache, and we should see that it has created a new blockchain for us:

This includes 10 accounts, and which each has 100 Eth in its account. These accounts can then be used to perform transactions on the blockchain. The server places itself on a certain port. In the example above, this port is TCP port 8545. This port will be used to connect from Remix…

--

--

Prof Bill Buchanan OBE FRSE
ASecuritySite: When Bob Met Alice

Professor of Cryptography. Serial innovator. Believer in fairness, justice & freedom. Based in Edinburgh. Old World Breaker. New World Creator. Building trust.