Main createMain(String name, String postfix, boolean nolog) throws InterruptedException { String path = new File("src/test_node_config_v2" + postfix + "/" + name).getAbsolutePath(); System.out.println(path); String[] args = new String[]{"--test", "--config", path, nolog ? "--nolog" : ""}; List<Main> mm = new ArrayList<>(); Thread thread = new Thread(() -> { try { Main m = new Main(args); try { m.config.addTransactionUnitsIssuerKeyData(new KeyAddress("Zau3tT8YtDkj3UDBSznrWHAjbhhU4SXsfQLWDFsv5vw24TLn6s")); } catch (KeyAddress.IllegalAddressException e) { e.printStackTrace(); } //m.config.getKeysWhiteList().add(m.config.getUIssuerKey()); m.waitReady(); mm.add(m); } catch (InterruptedException e) { e.printStackTrace(); } }); thread.setName("Node Server: " + name); thread.start(); while (mm.size() == 0) { Thread.sleep(100); } return mm.get(0); }
Main createMainFromDb(String dbUrl, boolean nolog) throws InterruptedException { String[] args = new String[]{"--test","--database", dbUrl, nolog ? "--nolog" : ""}; List<Main> mm = new ArrayList<>(); Thread thread = new Thread(() -> { try { Main m = new Main(args); try { m.config.addTransactionUnitsIssuerKeyData(new KeyAddress("Zau3tT8YtDkj3UDBSznrWHAjbhhU4SXsfQLWDFsv5vw24TLn6s")); } catch (KeyAddress.IllegalAddressException e) { e.printStackTrace(); } //m.config.getKeysWhiteList().add(m.config.getUIssuerKey()); m.waitReady(); mm.add(m); } catch (InterruptedException e) { e.printStackTrace(); } }); thread.setName("Node Server: " + dbUrl); thread.start(); while (mm.size() == 0) { Thread.sleep(100); } return mm.get(0); }
static Main createMain(String name,boolean nolog) throws InterruptedException { String path = new File("src/test_node_config_v2/"+name).getAbsolutePath(); System.out.println(path); String[] args = new String[]{"--test", "--config", path, nolog ? "--nolog" : ""}; Main main = new Main(args); try { main.config.addTransactionUnitsIssuerKeyData(new KeyAddress("Zau3tT8YtDkj3UDBSznrWHAjbhhU4SXsfQLWDFsv5vw24TLn6s")); } catch (KeyAddress.IllegalAddressException e) { e.printStackTrace(); } try { //main.config.getKeysWhiteList().add(CLIMain.getPrivateKey().getPublicKey()); main.config.getAddressesWhiteList().add(new KeyAddress(CLIMain.getPrivateKey().getPublicKey(), 0, true)); } catch (IOException e) { e.printStackTrace(); } //main.config.getKeysWhiteList().add(main.config.getUIssuerKey()); main.waitReady(); return main; }
m.waitReady(); mm.add(m); } catch (InterruptedException e) {
m.waitReady(); mm.add(m); } catch (InterruptedException e) {
"70 8E 29 AF A1 C1").getData()); m.config.getAddressesWhiteList().add(new KeyAddress(pk, 0, true)); m.waitReady(); mm.add(m); } catch (Exception e) {
m.waitReady(); mm.add(m); } catch (InterruptedException e) {
String[] args = new String[]{"--test", "--config", path, "--nolog"}; Main main = new Main(args); main.waitReady(); BufferedLogger l = main.logger;