@Before public void beforeScriptEngineTest() throws Exception { // add U issuer test key configForProvider.addTransactionUnitsIssuerKeyData(new KeyAddress("Zau3tT8YtDkj3UDBSznrWHAjbhhU4SXsfQLWDFsv5vw24TLn6s")); }
@Before public void beforeMainTest() throws Exception { // clearLedgers List<String> dbUrls = new ArrayList<>(); dbUrls.add("jdbc:postgresql://localhost:5432/universa_node_t1"); dbUrls.add("jdbc:postgresql://localhost:5432/universa_node_t2"); dbUrls.add("jdbc:postgresql://localhost:5432/universa_node_t3"); dbUrls.add("jdbc:postgresql://localhost:5432/universa_node_t4"); List<Ledger> ledgers = new ArrayList<>(); dbUrls.stream().forEach(url -> { try { clearLedger(url); PostgresLedger ledger = new PostgresLedger(url); ledgers.add(ledger); } catch (Exception e) { e.printStackTrace(); } }); // add U issuer test key configForProvider.addTransactionUnitsIssuerKeyData(new KeyAddress("Zau3tT8YtDkj3UDBSznrWHAjbhhU4SXsfQLWDFsv5vw24TLn6s")); }
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); }
@BeforeClass public static void beforeClass() throws Exception { nodeConfig = new Config(); nodeConfig.addTransactionUnitsIssuerKeyData(new KeyAddress("Zau3tT8YtDkj3UDBSznrWHAjbhhU4SXsfQLWDFsv5vw24TLn6s")); }
@BeforeClass public static void beforeClass() throws Exception { nodeConfig = new Config(); nodeConfig.addTransactionUnitsIssuerKeyData(new KeyAddress("Zau3tT8YtDkj3UDBSznrWHAjbhhU4SXsfQLWDFsv5vw24TLn6s")); }
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; }
Main m = new Main(args); try { m.config.addTransactionUnitsIssuerKeyData(new KeyAddress("Zau3tT8YtDkj3UDBSznrWHAjbhhU4SXsfQLWDFsv5vw24TLn6s")); } catch (KeyAddress.IllegalAddressException e) { e.printStackTrace();
Main m = new Main(args); try { m.config.addTransactionUnitsIssuerKeyData(new KeyAddress("Zau3tT8YtDkj3UDBSznrWHAjbhhU4SXsfQLWDFsv5vw24TLn6s")); } catch (KeyAddress.IllegalAddressException e) { e.printStackTrace();
try { Main m = new Main(args); m.config.addTransactionUnitsIssuerKeyData(new KeyAddress("Zau3tT8YtDkj3UDBSznrWHAjbhhU4SXsfQLWDFsv5vw24TLn6s"));
Main m = new Main(args); try { m.config.addTransactionUnitsIssuerKeyData(new KeyAddress("Zau3tT8YtDkj3UDBSznrWHAjbhhU4SXsfQLWDFsv5vw24TLn6s")); } catch (KeyAddress.IllegalAddressException e) { e.printStackTrace();
config_s.setNegativeConsensus(negCons); config_s.setResyncBreakConsensus(1); config_s.addTransactionUnitsIssuerKeyData(new KeyAddress("Zau3tT8YtDkj3UDBSznrWHAjbhhU4SXsfQLWDFsv5vw24TLn6s")); config_s.setPermanetMode(false);
config_s.setNegativeConsensus(4); config_s.setResyncBreakConsensus(2); config_s.addTransactionUnitsIssuerKeyData(new KeyAddress("Zau3tT8YtDkj3UDBSznrWHAjbhhU4SXsfQLWDFsv5vw24TLn6s"));
config_s.setNegativeConsensus(negCons); config_s.setResyncBreakConsensus(2); config_s.addTransactionUnitsIssuerKeyData(new KeyAddress("Zau3tT8YtDkj3UDBSznrWHAjbhhU4SXsfQLWDFsv5vw24TLn6s")); config_s.setPermanetMode(false);
config_s.setNegativeConsensus(negCons); config_s.setResyncBreakConsensus(2); config_s.addTransactionUnitsIssuerKeyData(new KeyAddress("Zau3tT8YtDkj3UDBSznrWHAjbhhU4SXsfQLWDFsv5vw24TLn6s")); config_s.setPermanetMode(true);