use of duckutil.ConfigMem in project snowblossom by snowblossomcoin.
the class SpoonTest method startPoolMiner.
protected PoolMiner startPoolMiner(int port, AddressSpecHash mine_to, File snow_path, String network) throws Exception {
NetworkParams params = NetworkParams.loadFromName(network);
String addr = mine_to.toAddressString(params);
System.out.println("Starting miner with " + addr);
Map<String, String> config_map = new TreeMap<>();
config_map.put("pool_host", "localhost");
config_map.put("pool_port", "" + port);
config_map.put("threads", "1");
config_map.put("mine_to_address", addr);
config_map.put("snow_path", snow_path.getPath());
config_map.put("network", network);
config_map.put("rate_limit", "10000.0");
if (port % 2 == 1) {
config_map.put("memfield", "true");
}
return new PoolMiner(new ConfigMem(config_map));
}
use of duckutil.ConfigMem in project snowblossom by snowblossomcoin.
the class SpoonTest method startMiner.
protected SnowBlossomMiner startMiner(int port, AddressSpecHash mine_to, File snow_path, String network) throws Exception {
Map<String, String> config_map = new TreeMap<>();
config_map.put("node_host", "localhost");
config_map.put("node_port", "" + port);
config_map.put("threads", "1");
config_map.put("snow_path", snow_path.getPath());
config_map.put("network", network);
NetworkParams params = NetworkParams.loadFromConfig(new ConfigMem(config_map));
config_map.put("mine_to_address", mine_to.toAddressString(params));
config_map.put("rate_limit", "10000.0");
if (port % 2 == 1) {
config_map.put("memfield", "true");
}
return new SnowBlossomMiner(new ConfigMem(config_map));
}
use of duckutil.ConfigMem in project snowblossom by snowblossomcoin.
the class SpoonTest method startPoolMinerUri.
protected PoolMiner startPoolMinerUri(String uri, AddressSpecHash mine_to, File snow_path, String network) throws Exception {
NetworkParams params = NetworkParams.loadFromName(network);
String addr = mine_to.toAddressString(params);
System.out.println("Starting miner with " + addr);
Map<String, String> config_map = new TreeMap<>();
config_map.put("pool_uri", uri);
config_map.put("threads", "1");
config_map.put("mine_to_address", addr);
config_map.put("snow_path", snow_path.getPath());
config_map.put("network", network);
config_map.put("rate_limit", "10000.0");
return new PoolMiner(new ConfigMem(config_map));
}
use of duckutil.ConfigMem in project snowblossom by snowblossomcoin.
the class WalletTest method testWalletSerialize.
@Test
public void testWalletSerialize() throws Exception {
ConfigMem config = new ConfigMem(ImmutableMap.of());
WalletDatabase.Builder builder = WalletDatabase.newBuilder();
WalletUtil.genNewKey(WalletDatabase.newBuilder().build(), builder, config, new NetworkParamsRegtest());
WalletDatabase a = builder.build();
ByteString str = a.toByteString();
WalletDatabase b = WalletDatabase.parseFrom(str);
Assert.assertEquals(a, b);
}
use of duckutil.ConfigMem in project snowblossom by snowblossomcoin.
the class NodePanel method startNode.
private void startNode() throws Exception {
// There are too many side effects to try this more than once
start_attempt = true;
TreeMap<String, String> config_map = new TreeMap();
config_map.put("network", ice_leaf.getParams().getNetworkName());
config_map.put("service_port", ice_leaf_prefs.get("node_service_port", null));
config_map.put("tls_service_port", ice_leaf_prefs.get("node_tls_service_port", null));
config_map.put("db_path", ice_leaf_prefs.get("node_db_path", null));
config_map.put("db_type", "rocksdb");
config_map.put("tls_key_path", ice_leaf_prefs.get("node_tls_key_path", null));
config_map.put("tx_index", "" + ice_leaf_prefs.getBoolean("node_tx_index", true));
config_map.put("addr_index", "" + ice_leaf_prefs.getBoolean("node_addr_index", true));
setMessageBox(config_map.toString());
ConfigMem config = new ConfigMem(config_map);
node = new SnowBlossomNode(config, ImmutableList.of(new StatusLogger(), this));
setStatusBox("Node started");
setMessageBox("");
}
Aggregations