How to make a blockchain in five steps

in #life8 years ago

The basic blockchain technologies are available in open source and in fact any developer can implement it and run it on a network of a few machines.

To do this, proceed as follows, referring to five steps.

Select the platform
Let's start by choosing the blockchain network. Currently Ethereum is the one that gathers the unanimity of the consensus. Thanks to the dynamism and reactivity of its community but also to the richness of its documentation, this open source environment has been chosen by almost all the companies involved in blockchain projects.

Client environments for Ethereum are based on the most common languages ​​such as C +++ (Cpp-ethereum), Haskell (ethereumH), JavaScript (EthereumJS-lib) or Python (Pyethapp).

The advice is to use the one based on Go (Go-ethereum or Geth ). It is the most used client in the Ethereum world. By default, it connects to Homestead, the platform's main network. The first step is to install Geth on the workstation (it exists for Linux, iOS, Android, MacOS and Windows).

Initialize the blockchain
To initialize the blockchain, you must manually create the first block that must contain all the characteristics of the string. They will then be shared to all nodes (or endpoints ) of the network. To define this block, you need to create a Json file.

Several parameters must be inserted: "nonce" (or random value used by the cryptographic hash), Difficulty (difficulty level associated with cryptographic processing), timestamp (validation time between two successive blocks), and so on.

Once the Json file has been compiled, it is up to the Geth client to create the folder containing the blockchain and initialize it. The goal is to replicate the commands as many times as the network has nodes , the latter set according to the first.

In order for them to communicate within the blockchain they must be connected to each other. In order for Geth to connect to a node on the network and coordinate the collection, it must retrieve its identifier called enode on Ethereum. To ensure the propagation of the node-node program on Ethereum, it will be necessary to possess cryptocurrencies in Gas to acquire the necessary computing power.

Choose the right protocol
The concept of proof of work, which allows to validate and guarantee the content of the blocks, assumes its full meaning in a public blockchain due to the critical mass and the competition among the nodes.

The number of actors in a private blockchain is limited and are identified. In this configuration, therefore, other consent protocols will be used. It is possible to move towards proof-of-stake or proof-of-authority. The latter lends itself more easily to a private network.

Execution of the first contract
The realization of the blockchain is useful only if it is possible to execute a smart contract on it. It is a contract that is self-executed by a predefined threshold, which can be a date, an amount or any authenticated event. The reference language for developing such applications on Ethereum is Solidity .

In its grammar, this language is relatively simple and approaches an object-oriented programming environment with notions of class, attribute and function.

Debugging and sizing
Debugging a blockchain is not easy and seems to have left its mark on those who have practiced it. In fact, it is a complex process and contrary to a classic application in which a new version overwrites the previous one, the slightest correction or addition of functionality within a string of blocks is historicized for life.

A smart contract remains stored in the blockchain. To solve the problem, you will have to create a new one and wait for the chain to propagate the changes. Finally, like open source platforms, the code is constantly evolving. And the updates tend then to break the existing smart contracts.

Coin Marketplace

STEEM 0.04
TRX 0.31
JST 0.074
BTC 63571.03
ETH 1680.88
USDT 1.00
SBD 0.41