Examples of peerGroup()


Examples of com.google.bitcoin.kits.WalletAppKit.peerGroup()

        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

Examples of org.bitcoinj.kits.WalletAppKit.peerGroup()

        log.info("bitcoinj initialised");

        // Don't start up fully until we're properly set up. Eventually this can go away.
        // TODO: Make this also check for NODE_GETUTXOS flag.
        log.info("Waiting to find a peer that supports getutxo");
        kit.peerGroup().waitForPeersOfVersion(minPeersSupportingGetUTXO, GetUTXOsMessage.MIN_PROTOCOL_VERSION).get();
        log.info("Found ... starting web server on port {}", portFlag.value(options));

        // This app is mostly single threaded. It handles all requests and state changes on a single thread.
        // Speed should ideally not be an issue, as the backend blocks only rarely. If it's a problem then
        // we'll have to split the backend thread from the http server thread.
View Full Code Here

Examples of org.bitcoinj.kits.WalletAppKit.peerGroup()

        // This app is mostly single threaded. It handles all requests and state changes on a single thread.
        // Speed should ideally not be an issue, as the backend blocks only rarely. If it's a problem then
        // we'll have to split the backend thread from the http server thread.
        AffinityExecutor.ServiceAffinityExecutor executor = new AffinityExecutor.ServiceAffinityExecutor("server");
        server.setExecutor(executor);
        LighthouseBackend backend = new LighthouseBackend(SERVER, kit.peerGroup(), kit.chain(), (PledgingWallet) kit.wallet(), executor);
        backend.setMinPeersForUTXOQuery(minPeersSupportingGetUTXO);
        server.createContext(LHUtils.HTTP_PATH_PREFIX, new ProjectHandler(backend));
        server.createContext("/", exchange -> {
            log.warn("404 Not Found: {}", exchange.getRequestURI());
            exchange.sendResponseHeaders(404, -1);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.