add checkpoint file for testnet
This commit is contained in:
parent
3f2f50e60e
commit
d625d14ffc
|
@ -4,6 +4,7 @@ import static org.bitcoinj.script.ScriptOpCodes.OP_RETURN;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.InputMismatchException;
|
import java.util.InputMismatchException;
|
||||||
|
@ -14,6 +15,7 @@ import joptsimple.OptionSet;
|
||||||
import joptsimple.OptionSpec;
|
import joptsimple.OptionSpec;
|
||||||
import org.abstractj.kalium.keys.SigningKey;
|
import org.abstractj.kalium.keys.SigningKey;
|
||||||
import org.abstractj.kalium.keys.VerifyKey;
|
import org.abstractj.kalium.keys.VerifyKey;
|
||||||
|
import org.bitcoinj.core.CheckpointManager;
|
||||||
import org.bitcoinj.core.Coin;
|
import org.bitcoinj.core.Coin;
|
||||||
import org.bitcoinj.core.ECKey;
|
import org.bitcoinj.core.ECKey;
|
||||||
import org.bitcoinj.core.InsufficientMoneyException;
|
import org.bitcoinj.core.InsufficientMoneyException;
|
||||||
|
@ -117,7 +119,7 @@ public class App {
|
||||||
if (params.getId().equals(NetworkParameters.ID_REGTEST)) {
|
if (params.getId().equals(NetworkParameters.ID_REGTEST)) {
|
||||||
kit.connectToLocalHost();
|
kit.connectToLocalHost();
|
||||||
}
|
}
|
||||||
|
kit.setCheckpoints(App.class.getResourceAsStream("/" + params.getId() + ".checkpoints"));
|
||||||
// Now we start the kit and sync the blockchain.
|
// Now we start the kit and sync the blockchain.
|
||||||
// bitcoinj is working a lot with the Google Guava libraries. The
|
// bitcoinj is working a lot with the Google Guava libraries. The
|
||||||
// WalletAppKit extends the AbstractIdleService. Have a look at the
|
// WalletAppKit extends the AbstractIdleService. Have a look at the
|
||||||
|
@ -168,13 +170,6 @@ public class App {
|
||||||
// To test everything we create and print a fresh receiving address.
|
// To test everything we create and print a fresh receiving address.
|
||||||
// Send some coins to that address and see if everything works.
|
// Send some coins to that address and see if everything works.
|
||||||
String receiveStr = wallet.freshReceiveAddress().toString();
|
String receiveStr = wallet.freshReceiveAddress().toString();
|
||||||
System.out.println("send money to: " + receiveStr);
|
|
||||||
try {
|
|
||||||
System.out.print(executeCommand("qrencode -t UTF8 -o - " + receiveStr));
|
|
||||||
} catch (Exception e) {
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Scanner input = new Scanner(System.in);
|
final Scanner input = new Scanner(System.in);
|
||||||
|
|
||||||
display: while (true) {
|
display: while (true) {
|
||||||
|
@ -193,7 +188,12 @@ public class App {
|
||||||
System.out.println("Balance: " + wallet.getBalance().toFriendlyString());
|
System.out.println("Balance: " + wallet.getBalance().toFriendlyString());
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
System.out.println("send money to: " + wallet.freshReceiveAddress().toString());
|
System.out.println("send money to: " + receiveStr);
|
||||||
|
try {
|
||||||
|
System.out.print(executeCommand("qrencodes -t UTF8 -o - " + receiveStr));
|
||||||
|
} catch (Exception e) {
|
||||||
|
;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
sendOPReturn(kit);
|
sendOPReturn(kit);
|
||||||
|
|
|
@ -9,13 +9,13 @@
|
||||||
</encoder>
|
</encoder>
|
||||||
</appender>
|
</appender>
|
||||||
<logger name="org.tcpid.opretj.testapp.App" level="debug" />
|
<logger name="org.tcpid.opretj.testapp.App" level="debug" />
|
||||||
<logger name="org.tcpid.opretj.OPRETECParser" level="debug" />
|
|
||||||
<!--
|
<!--
|
||||||
|
<logger name="org.tcpid.opretj.OPRETECParser" level="debug" />
|
||||||
<logger name="eckey.OPRETSimpleLogger" level="debug" />
|
<logger name="eckey.OPRETSimpleLogger" level="debug" />
|
||||||
<logger name="eckey.OPRETSimpleParser" level="debug" />
|
<logger name="eckey.OPRETSimpleParser" level="debug" />
|
||||||
<logger name="eckey.OPRETBaseHandler" level="debug" />
|
<logger name="eckey.OPRETBaseHandler" level="debug" />
|
||||||
-->
|
-->
|
||||||
<root level="warn">
|
<root level="info">
|
||||||
<appender-ref ref="STDOUT" />
|
<appender-ref ref="STDOUT" />
|
||||||
</root>
|
</root>
|
||||||
</configuration>
|
</configuration>
|
BIN
opret-testapp/src/main/resources/org.bitcoin.test.checkpoints
Normal file
BIN
opret-testapp/src/main/resources/org.bitcoin.test.checkpoints
Normal file
Binary file not shown.
Loading…
Reference in a new issue