Package com.google.bitcoin.kits

Examples of com.google.bitcoin.kits.WalletAppKit


            filePrefix = "regtest-";
        }

        final int port = Integer.parseInt(options.valueOf("port").toString());

        WalletAppKit appkit = new WalletAppKit(params, new File("."), filePrefix + "payfile-server-" + port) {
            @Override
            protected void addWalletExtensions() throws Exception {
                super.addWalletExtensions();
                wallet().addExtension(new StoredPaymentChannelServerStates(wallet(), peerGroup()));
            }
        };
        if (params == RegTestParams.get()) {
            appkit.connectToLocalHost();
        }
        appkit.setUserAgent("PayFile Server", "1.0").startAndWait();

        System.out.println(appkit.wallet().toString(false, true, true, appkit.chain()));

        ServerSocket socket = new ServerSocket(port);
        Socket clientSocket;
        do {
            clientSocket = socket.accept();
            final Server server = new Server(appkit.wallet(), appkit.peerGroup(), clientSocket);
            Thread clientThread = new Thread(server, clientSocket.toString());
            clientThread.start();
        } while (true);
    }
View Full Code Here


        // we give to the app kit is currently an exception and runs on a library thread. It'll get fixed in
        // a future version. Also note that this doesn't affect the default executor for ListenableFutures.
        // That must be specified each time.
        Threading.USER_THREAD = Platform::runLater;
        // Create the app kit. It won't do any heavyweight initialization until after we start it.
        bitcoin = new WalletAppKit(params, new File("."), filePrefix + APP_NAME ) {
            @Override
            protected void addWalletExtensions() throws Exception {
                super.addWalletExtensions();
                wallet().addExtension(new StoredPaymentChannelClientStates(wallet(), peerGroup()));
            }
View Full Code Here

    private PayFileClient client;
    private List<PayFileClient.File> files;
    private WalletAppKit appkit;

    public CLI(Socket socket) throws IOException {
        appkit = new WalletAppKit(params, new File("."), filePrefix + "payfile-cli") {
            @Override
            protected void addWalletExtensions() throws Exception {
                super.addWalletExtensions();
                wallet().addExtension(new StoredPaymentChannelClientStates(wallet(), peerGroup()));
            }
View Full Code Here

TOP

Related Classes of com.google.bitcoin.kits.WalletAppKit

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.