private static void doResync() throws IOException { List<String> sources = new ArrayList<String>((List) options.valuesOf("resync")); List<String> nonOptions = new ArrayList<String>((List) options.nonOptionArguments()); for (String opt : nonOptions) { sources.addAll(asList(opt.split(","))); } cleanNonOptionalArguments(sources); for (int s = 0; s < sources.size(); s++) { String source = sources.get(s); ItemResult ir = getClientNetwork().resync(source); report("Node has reported the state:"); report(ir.toString()); } finish(); }
try { ItemResult r1 = clientNetworks.get(index).register(c.getPackedTransaction()); System.out.println("result from thread (" + index + "): " + r1.toString()); } catch (IOException e) { if (e.getCause() instanceof SocketTimeoutException) {
/** * Register a specified contract. * * @param contract must be a sealed binary. * @param waitTime - wait time for responce. * @param fromPackedTransaction - register contract with Contract.getPackedTransaction() */ @Deprecated public static void registerContract(Contract contract, int waitTime, Boolean fromPackedTransaction) throws IOException { // checkContract(contract); List<ErrorRecord> errors = contract.getErrors(); if (errors.size() > 0) { report("contract has errors and can't be submitted for registration"); report("contract id: " + contract.getId().toBase64String()); addErrors(errors); } else { // contract.seal(); ItemResult r; if (fromPackedTransaction) { r = getClientNetwork().register(contract.getPackedTransaction(), waitTime); } else { r = getClientNetwork().register(contract.getLastSealedBinary(), waitTime); } report("submitted with result:"); report(r.toString()); } }
/** * Register a specified parcel. * @param parcel must be ready for register * @param waitTime wait time for responce. * @return ItemResult for parcel's payload * @throws IOException */ public static ItemResult registerParcel(Parcel parcel, int waitTime) throws IOException { getClientNetwork().registerParcel(parcel.pack(), waitTime); ItemResult r = getClientNetwork().check(parcel.getPayloadContract().getId()); report("paid contract " + parcel.getPayloadContract().getId() + " submitted with result: " + r.toString()); report("payment became " + parcel.getPaymentContract().getId()); report("payment rev 1 " + parcel.getPaymentContract().getRevoking().get(0).getId()); return r; }