Examples of Miner


Examples of org.ethereum.mine.Miner

        Block block = new Block(blockRaw);
        Block newBlock = MinerThread.createBlock(block, coinbase);
        newBlock.setStateRoot(Hex.decode("43bb67bea1931eca8f9e06f9cca66a9f9914cc3e3d4e9ceb2e08e58ab9f92bab"));

        Miner miner = new Miner();
        miner.mine(newBlock, newBlock.getDifficulty());

        System.out.println(newBlock);

        //f8f9f8f5a0a02852f3f5e7d06936bd5f39e7cc65a9f11e37656255f92c7eb32cb878a70213a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d4934794cd2a3d9f938e13cd947ec05abc7fe734df8dd826a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421808301ef4e518609184e72a000830e1c69808601499c9bf5dd80a0000000000000000000000000000000000000000000000000000000000000f599c0c0
View Full Code Here

Examples of org.ethereum.mine.Miner

    if(miningTestEnabled) {
      Block block = createBlock(null);
      assertEquals(rlpWithoutNonce, Hex.toHexString(block.getEncodedWithoutNonce()));
      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
View Full Code Here

Examples of org.ethereum.mine.Miner

            logger.info("Minning on block: [{}] ", block.getNumber());
//            assertEquals(rlpWithoutNonce, Hex.toHexString(block.getEncodedWithoutNonce()));
//            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){

                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()));
View Full Code Here

Examples of us.jyg.freshet.util.Miner

                    if (building) {
                        log.debug("Seeker waiting for db to finish building...");
                    } else {
                        log.debug("Seeker starting again...");
                        for(int i=0; i< paths.length; i++) {
                            Miner miner = new Miner(paths[i]);
                            log.debug("Seeker mining at: " + paths[i]);
                            File f;
                            while( (f=miner.next()) != null) {
                                if (f.getName().matches(".*[mM][pP]3")) {
                                    if (!finalSongManager.songIsInDb(f)) {
                                        try {
                                            SongData songData = new SongData(f);
                                            Song song = finalSongManager.saveSong(songData);
View Full Code Here

Examples of us.jyg.freshet.util.Miner

    private void build(String path) {
        build(path, 0);
    }

    private void build(String path, int delay) {
        Miner miner = new Miner(path);
    File f;
    while( (f=miner.next()) != null) {
      try {
        if (f.getName().matches(".*[mM][pP]3")) {
          SongData songData = new SongData(f);
          songManager.saveSong(songData);
//          log.debug("Saved: " + song.getName() + " ("+song.getId() +")"+
View Full Code Here

Examples of us.jyg.freshet.util.Miner

  public void onSetUpBeforeTransaction() {
    setDefaultRollback(new Boolean(false));
  }
   
    public void testSaveSong() { 
    Miner miner = new Miner("test/data");
    File f;
    while( (f=miner.next()) != null) {
      try {
        if (f.getName().matches(".*[mM][pP]3")) {
          SongData songData = new SongData(f);
          Song song = songManager.saveSong(songData);
          log.debug("Saved: " + song.getName() + " ("+song.getId() +")"+
View Full Code Here

Examples of us.jyg.freshet.util.Miner

public class SongDaoTest extends BaseDaoTest {

  static int testSongCount = 0;

  public void testSaveSong() {
    Miner miner = new Miner("test/data/mp3");
    File f;
    while( (f=miner.next()) != null) {
      try {
        if (f.getName().matches(".*[mM][pP]3")) {
          SongData songData = new SongData(f);
          Album album = albumDao.getAlbum(songData.getAlbum());
          Artist artist = artistDao.getArtist(songData.getArtist());
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.