Package org.ethereum.core

Examples of org.ethereum.core.Block.validateNonce()


      System.out.println("Searching for nonce of following block: \n" + block.toString());
     
      Miner miner = new Miner();
      boolean mined = miner.mine(block, block.getDifficulty());
      assertTrue(mined);
      boolean valid = block.validateNonce();
      assertTrue(valid);
     
      // expectedHash is the actual hash from block#32 in PoC5 chain based on nonce below
      String expectedHash = "ce7201f6cc5eb1a6f35c7dda8acda111647a0f8a5bf0518e46579b03e29fe14b";
      assertEquals(expectedHash, Hex.toHexString(block.getHash()));
View Full Code Here


//            System.out.println("Searching for nonce of following block: \n" + block.toString());

            Miner miner = new Miner();
            boolean mined = miner.mine(block, block.getDifficulty());
            assertTrue(mined);
            boolean valid = block.validateNonce();
            assertTrue(valid);
            logger.info("found nonce: [{}]", Hex.toHexString(block.getNonce()));

            while(true){
View Full Code Here

            while(true){

                Block newBlock = createBlock(block);
                mined = miner.mine(newBlock, newBlock.getDifficulty());
                assertTrue(mined);
                valid = newBlock.validateNonce();
                assertTrue(valid);
                block = newBlock;
                logger.info("found nonce: [{}]", Hex.toHexString(newBlock.getNonce()));
                logger.info("block.number: [{}], added to the chain", newBlock.getNumber());
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.