Essential blockchain development tools to make your job easier

As blockchain technology makes its way into the mainstream and more companies implement it, developers are looking for blockchain development tools to make their jobs easier. According to Deloitte’s 2019 report, Many companies are leveraging blockchain tech for its greater security and transparency. Upwork also reports that blockchain is among the most sought-after skills on the freelance platform. It means that this technology is worth learning. 


Various blockchain tutorials tell about Solidity, Geth or Hyperledger. When you have a blockchain “backend” site you can use this set of tools to make the rest of the application. Here are a few I use. 


Truffle boxes

When you’re a novice in blockchain technology and you do not know where to start, a truffle box is the easiest way to get it. This is part of the truffle framework which contains lots of boilerplate to start a new app with blockchain connection. This is similar to ‘create-react-app’ which by one line makes you a simple app. Truffle box does the same, but with a huge number of different modules, Solidity contracts, libraries, and frontend views. For example, in react boilerplate instead of usually used webpack, etc, we can see a connection with ethereum.js or solidity. Structure of this app is simple: contracts/, migrations/ and tests/. Also to connect with the truffle framework there is executed truffle.config.js.


In the contracts folder, we can see hosts of Solidity (files with .sol) and Vyper contracts files (.vy). Here take place all smart contracts philosophy. Migrations folder hosts migrations files. These migrations deploy smart contracts on the Ethereum blockchain. In the tests folder, we can see unit tests for our smart contracts. Tests can be written in JavaScript, TypeScript, Solidity, and Vyper. Also, we have finished methods which can get user accounts from solidity or make a simple smart contract.


Web3.js


If we have a great base for our app we can start to develop. But we need some connection with blockchain. To make a relation between front and  Solidity we can use JSON RPC protocol (similar to REST). JSON RPC is a textual encoding format allowing running processes to receive data. But to make this communication easier we can use Web3.js. This is a collection of JavaScript libraries that allows programmers to interact with the Ethereum blockchain.  We can use this library for connecting to the Ethereum Network via any Ethereum node that allows access via HTTP. This may be a local node or a node provider such as MetaMask. To use web3.js we should install it by npm and use this code:

After this, we can use it to get user accounts, send transactions by one line, get gas price and many more functions that make connecting to blockchain easy.


MetaMask

To get some information about transactions, balances, and blocks the protocol requires to connect to the nodes. The nodes share new data with each other and validate it. It lets you get data that has not been tampered with and which is up-to-date. You can use two types of nodes: local and hosted. Local means that blockchain will be running only on your computer locally. You can use it for this Geth. But for the first app, it’s easier to use hosted one, which is controlled by somebody else but you can connect to it and play around with the blockchain on your own. To use this you can use MetaMask. 


According to the MetaMask website, the portal is a bridge that allows you to visit the distributed web of tomorrow in your browser today. With MetaMask you can download all transactions, manage private and public keys, and broadcast new transactions. To install it you have to download the browser extension and run it. 


Truffle contract

When you have done all configurations with blockchain you can start making smart contracts. You can do this by yourself, but this is additional work for you. One of the blockchain development tools that help with making it is Truffle contract. This framework helps you with smart contract lifecycle management. It takes care of managing your contract artifacts. Additionally, it writes automated tests for your contracts in JavaScript and Solidity.  It’s like Ruby on Rails to web programming. 

Gardener

Imagine a situation when you have some blockchain app that sells bitcoin. You can make a smart contract for this transaction, but except that you need to know what the course of bitcoin is. To make blockchain a trustless environment, you have to leave this closed, so any information from outside cannot be added. Because of security reasons, you have to use some kind of middleware that gets information from outside the app. This can be done with Gardener


It connects data on the blockchain with access to information found in standard networks. Gardener is open-source and easily deployed to existing infrastructure.  It has an off-chain server written in Node.js, ethereum libraries for integrating the oracle into contracts and a simple monitor web application connected to Meta Mask for watching what happens with requests. 


Conclusion

As you can see, blockchain technology is being developed in many fields. Because of huge interest, lots of blockchain development tools are open source or free. With Truffle Boxes we can easily start developing frontend applications. With Web3.js we can connect this with our blockchain server. MetaMask helps us use a host server, and Truffle Contracts help you with using smart contracts. If you want to expand your application with data from outside use Gardener. These tools make your development life easier.


For more information on how to use these tools or how to start a blockchain development project, drop us a line and we’ll be glad to help.