have done some rework on src/blockchain.erl