Building the blockchain database