public class Blockchain { private static List
blockchain = new ArrayList<>(); private static int difficulty = 5;
public static void main(String[] args) { // Add the first block to the blockchain blockchain.add(new Block("Hello, I am the first block", "0")); System.out.println("Trying to Mine block 1... "); blockchain.get(0).mineBlock(difficulty);
// Add the second block to the blockchain
blockchain.add(newBlock("I am the second block", blockchain.get(blockchain.size()-1).hash));
System.out.println("Trying to Mine block 2... ");
blockchain.get(1).mineBlock(difficulty);
// Add a third block to the blockchain
blockchain.add(newBlock("I am the third block", blockchain.get(blockchain.size()-1).hash));
System.out.println("Trying to Mine block 3... ");
blockchain.get(2).mineBlock(difficulty);
System.out.println("\nBlockchain is Valid: " + isChainValid());
String blockchainJson = StringUtil.getJson(blockchain);
System.out.