Search in sources :

Example 1 with NetworkParamsRegShard

use of snowblossom.lib.NetworkParamsRegShard in project snowblossom by snowblossomcoin.

the class ShardTestFullClaw method shardTest.

@Test
public void shardTest() throws Exception {
    File snow_path = setupSnow("regshard");
    Random rnd = new Random();
    int port = 20000 + rnd.nextInt(30000);
    SnowBlossomNode node = startNode(port, "regshard");
    Thread.sleep(100);
    KeyPair key_pair = KeyUtil.generateECCompressedKey();
    AddressSpec claim = AddressUtil.getSimpleSpecForKey(key_pair.getPublic(), SignatureUtil.SIG_TYPE_ECDSA_COMPRESSED);
    AddressSpecHash to_addr = AddressUtil.getHashForSpec(claim);
    SnowBlossomMiner miner = startMiner(port, to_addr, snow_path, "regshard");
    Thread.sleep(60000);
    for (int i = 0; i <= Math.min(10, new NetworkParamsRegShard().getMaxShardId()); i++) {
        waitForShardHead(node, i);
    }
    miner.stop();
    Thread.sleep(500);
    node.stop();
}
Also used : KeyPair(java.security.KeyPair) SnowBlossomMiner(snowblossom.miner.SnowBlossomMiner) SnowBlossomNode(snowblossom.node.SnowBlossomNode) File(java.io.File) AddressSpecHash(snowblossom.lib.AddressSpecHash) NetworkParamsRegShard(snowblossom.lib.NetworkParamsRegShard) Test(org.junit.Test)

Aggregations

File (java.io.File)1 KeyPair (java.security.KeyPair)1 Test (org.junit.Test)1 AddressSpecHash (snowblossom.lib.AddressSpecHash)1 NetworkParamsRegShard (snowblossom.lib.NetworkParamsRegShard)1 SnowBlossomMiner (snowblossom.miner.SnowBlossomMiner)1 SnowBlossomNode (snowblossom.node.SnowBlossomNode)1