The text on this page was automatically translated and hence may differ from the original. No rights can be derived from this translation.
Roll up your sleeves!
Getting started: what do you need?
To set up a simple blockchain, you can use software that is freely available on the internet. This software typically works on Windows and Mac computers. In this example, we will use the Ethereum platform. Ethereum is a publicly accessible blockchain – transactions on the blockchain are settled using the digital currency 'ether'. In this example, we will use the software under the Ethereum blockchain to create our own private clone.
Installing the client
To begin, you need a client. This is a piece of software that manages blockchain communication with other computers ('nodes'). By starting the client, you become part of the blockchain and can store new contracts on the blockchain. Download the 'Go Ethereum' client from this page and install it. After installation, it is advisable to check if the client has been installed correctly. To do this, go to the Start menu in Windows, select 'Run', type 'cmd', and press 'OK' (Mac users open the Applications folder, then the Utilities folder, and select the 'Terminal' program; the remaining instructions are the same). In the screen that appears, type 'geth version' followed by pressing Enter. If everything is in order, you will see an overview of the installed version of Go-Ethereum.

The start of the chain: the blockchain genesis
Now that the software is installed, it's time to start building the blockchain. As mentioned before, a blockchain consists of a chain of 'blocks'. The first block is called the 'genesis block' and is special because it is the first block trusted by all participants without further verification. All blocks that follow the genesis block are part of the blockchain.
First, download the file genesis.json and place it on your desktop. This file describes how the genesis block should look. Next, execute the following command in the command prompt:
geth –datadir %USERPROFILE%/Desktop/data –networkid 3336 init %USERPROFILE%/Desktop/genesis.json

If everything went well, you will see a message confirming that the genesis block has been created successfully. A 'data' folder will appear on your desktop – this is where the client stores all the data needed to participate in the blockchain.
With the genesis block created, it's time to start the blockchain! Use the following command:
geth –datadir %USERPROFILE%\Desktop\data –ipcpath ./geth.ipc –rpc –rpccorsdomain “*” –networkid 3336

Once the message 'IPC endpoint opened' appears, the client is ready for use. You can stop the client by pressing 'Ctrl-C' in the command prompt. Now, it's time to actually start using the blockchain. This can be done in several ways; firstly, you can access the blockchain through the 'console'. This is an environment where you can execute commands on the blockchain. Keep the client running and open a new command prompt window (Start, Run, cmd or Terminal on Mac) and enter the following command:
geth attach \\.\pipe\geth.ipc
If everything is correct, you will see “Welcome to the Geth JavaScript console!” and some version numbers. First, we need to create an account – an account grants you access to the blockchain and is protected by a password. To create a new account, use the following command:
personal.newAccount()
Subsequently, each time the client restarts, you will need to open (‘unlock’) the account. This can be done with the following command (which prompts for the previously set password):
personal.unlockAccount(personal.listAccounts[0])
To add blocks to the chain via the client, 'mining' needs to be done. Start the mining process as follows:
miner.setEtherbase(personal.listAccounts[0]) miner.start(1)
Since mining requires significant computing power, here we limit the speed by setting the number '1', indicating only one processor in your computer is used for mining. In a 'real' network, you would utilise all the computational power available. When you start mining for the first time, you will notice a delay before blocks actually appear (the client screen will show “Generating DAG” several times). After this, you should see a new block appearing every few seconds:

Since the genesis file specifies that mining blocks is easy, new blocks appear rapidly. In a 'real' blockchain, mining is more challenging, and blocks appear slower. However, for testing a blockchain, it is advantageous when blocks appear quickly as it ensures speedy processing of smart contracts.
You can exit the console by typing 'exit'. It's actually fine to leave the console open.
Writing smart contracts
To write and deploy smart contracts on the blockchain, you can use the Solidity programming environment. Download Solidity from this link – extract the zip file and double-click on the 'index.html' file. If successful, a blank text field will appear:

First, we need to instruct the Solidity editor to communicate with our own blockchain (via our own client). To do this, go to the 'Contract' tab and select 'Web3 provider' under 'Select execution environment'. Then, click through any notifications.
You are now ready to write your first smart contract! In the upcoming articles, we will delve into various smart contracts. Below is an extremely simple contract that does very little but enables us to test the blockchain:
pragma solidity ^0.4.0; contract Hello { address public owner; function Hello() { owner = msg.sender; } // No payments can be sent function () { throw; } }
What does this code do? The first line indicates the version of the programming language to be used (0.4.0) after which the contract begins (“contract Hello”). The line 'address public owner' signifies that one piece of data is stored in this contract, namely the address ('account number') of the person who created the contract. The 'function Hello' specifies what should happen when this contract is created. Currently, we only store the creator of the contract in the previously mentioned address field. Finally, there are some lines ensuring that blockchain money cannot be transferred to the contract.
Think of the code for a contract as a blueprint – you can instantiate one or more contracts that operate according to this code (similar to how in the world of 'ordinary' contracts, multiple 'purchase agreements' can be concluded for different houses, yet appear the same in form).
To create a new contract, click on 'Create' in Solidity under the 'Contract' tab. Initially, it should display 'waiting for transaction to be published'. If an error message appears, your account may have been 'locked' again. In this case, re-execute the command 'personal.unlockAccount(personal.listAccounts[0])' in the console. If all is well, you will eventually see a block showing 'Untitled:Hello at' followed by a long number. This number is the contract's address, essentially the contract number. You can perform specific actions with the contract using this number – we will elaborate on this later. Inside the block, you will find the properties of the contract, including the 'owner's' account number. For now, let's conclude here – you have created your first smart contract!

Finally
Based on your own blockchain, you can potentially develop various applications using smart contracts. However, using your own blockchain for this purpose may not always be the wisest choice. The first question you need to ask yourself is whether using a blockchain is truly necessary. If all parties involved trust each other completely, a 'simple' shared database might suffice. If you still wish to use a blockchain, it is advisable to connect to existing blockchains: they have the critical mass to fully leverage the benefits of blockchain technology.