• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java WalletAppKit类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.bitcoinj.kits.WalletAppKit的典型用法代码示例。如果您正苦于以下问题:Java WalletAppKit类的具体用法?Java WalletAppKit怎么用?Java WalletAppKit使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



WalletAppKit类属于org.bitcoinj.kits包,在下文中一共展示了WalletAppKit类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: startDownload

import org.bitcoinj.kits.WalletAppKit; //导入依赖的package包/类
public void startDownload() {
    BriefLogFormatter.init();
    String filePrefix = "voting-wallet";
    File walletFile = new File(Environment.getExternalStorageDirectory() + "/" + Util.FOLDER_DIGITAL_VOTING_PASS);
    if (!walletFile.exists()) {
        walletFile.mkdirs();
    }
    kit = new WalletAppKit(params, walletFile, filePrefix);

    //set the observer
    kit.setDownloadListener(progressTracker);

    kit.setBlockingStartup(false);

    PeerAddress peer = new PeerAddress(params, peeraddr);
    kit.setPeerNodes(peer);
    kit.startAsync();
}
 
开发者ID:digital-voting-pass,项目名称:polling-station-app,代码行数:19,代码来源:BlockChain.java


示例2: execute

import org.bitcoinj.kits.WalletAppKit; //导入依赖的package包/类
/**
 *
 * @param callbacks
 */
@Override
public void execute(CoinActionCallback<CurrencyCoin>... callbacks) {
    _callbacks = callbacks;
   // reinitWallet();

    final DeterministicSeed seed = createDeterministicSeed();

    _bitcoinManager.getCurrencyCoin().getWalletManager().addListener(new Service.Listener() {
        @Override
        public void terminated(Service.State from) {
            super.terminated(from);
            WalletAppKit appKit = setupWallet();

            appKit.setDownloadListener(BitcoinRecoverAction.this)
                    .setBlockingStartup(false)
                    .setUserAgent(ServiceConsts.SERVICE_APP_NAME, "0.1")
                    .restoreWalletFromSeed(seed);

            _bitcoinManager.getCurrencyCoin().setWalletManager(appKit);
            _bitcoinManager.getCurrencyCoin().getWalletManager().startAsync();
        }
    }, Executors.newSingleThreadExecutor());

    _bitcoinManager.getCurrencyCoin().getWalletManager().stopAsync();
}
 
开发者ID:ehanoc,项目名称:xwallet,代码行数:30,代码来源:BitcoinRecoverAction.java


示例3: setupWallet

import org.bitcoinj.kits.WalletAppKit; //导入依赖的package包/类
/**
 *
 */
private WalletAppKit setupWallet() {

    final WalletAppKit appKit = new WalletAppKit(Constants.NETWORK_PARAMETERS,
            _bitcoinManager.getCurrencyCoin().getDataDir(),
            ServiceConsts.SERVICE_APP_NAME + "-" + Constants.NETWORK_PARAMETERS.getPaymentProtocolId()) {
        @Override
        protected void onSetupCompleted() {
            super.onSetupCompleted();

            peerGroup().setFastCatchupTimeSecs(wallet().getEarliestKeyCreationTime());
           // wallet().allowSpendingUnconfirmedTransactions();
        }
    };

    return appKit;
}
 
开发者ID:ehanoc,项目名称:xwallet,代码行数:20,代码来源:BitcoinRecoverAction.java


示例4: setupWalletKit

import org.bitcoinj.kits.WalletAppKit; //导入依赖的package包/类
public void setupWalletKit(@Nullable DeterministicSeed seed) {
    // If seed is non-null it means we are restoring from backup.
    bitcoin = new WalletAppKit(params, new File("."), WALLET_FILE_NAME) {
        @Override
        protected void onSetupCompleted() {
            // Don't make the user wait for confirmations for now, as the intention is they're sending it
            // their own money!
            bitcoin.wallet().allowSpendingUnconfirmedTransactions();
            Platform.runLater(controller::onBitcoinSetup);
        }
    };
    // Now configure and start the appkit. This will take a second or two - we could show a temporary splash screen
    // or progress widget to keep the user engaged whilst we initialise, but we don't.
    if (params == RegTestParams.get()) {
        bitcoin.connectToLocalHost();   // You should run a regtest mode bitcoind locally.
    } else if (params == TestNet3Params.get()) {
        // As an example!
        bitcoin.useTor();
        // bitcoin.setDiscovery(new HttpDiscovery(params, URI.create("http://localhost:8080/peers"), ECKey.fromPublicOnly(BaseEncoding.base16().decode("02cba68cfd0679d10b186288b75a59f9132b1b3e222f6332717cb8c4eb2040f940".toUpperCase()))));
    }
    bitcoin.setDownloadListener(controller.progressBarUpdater())
           .setBlockingStartup(false)
           .setUserAgent(APP_NAME, "1.0");
    if (seed != null)
        bitcoin.restoreWalletFromSeed(seed);
}
 
开发者ID:Grant-Redmond,项目名称:cryptwallet,代码行数:27,代码来源:Main.java


示例5: run

import org.bitcoinj.kits.WalletAppKit; //导入依赖的package包/类
public void run() throws Exception {
    NetworkParameters params = RegTestParams.get();

    // Bring up all the objects we need, create/load a wallet, sync the chain, etc. We override WalletAppKit so we
    // can customize it by adding the extension objects - we have to do this before the wallet file is loaded so
    // the plugin that knows how to parse all the additional data is present during the load.
    appKit = new WalletAppKit(params, new File("."), "payment_channel_example_server") {
        @Override
        protected List<WalletExtension> provideWalletExtensions() {
            // The StoredPaymentChannelClientStates object is responsible for, amongst other things, broadcasting
            // the refund transaction if its lock time has expired. It also persists channels so we can resume them
            // after a restart.
            return ImmutableList.<WalletExtension>of(new StoredPaymentChannelServerStates(null));
        }
    };
    appKit.connectToLocalHost();
    appKit.startAsync();
    appKit.awaitRunning();

    System.out.println(appKit.wallet());

    // We provide a peer group, a wallet, a timeout in seconds, the amount we require to start a channel and
    // an implementation of HandlerFactory, which we just implement ourselves.
    new PaymentChannelServerListener(appKit.peerGroup(), appKit.wallet(), 15, Coin.valueOf(100000), this).bindAndStart(4242);
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:26,代码来源:ExamplePaymentChannelServer.java


示例6: main

import org.bitcoinj.kits.WalletAppKit; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
    BriefLogFormatter.init();
    if (args.length == 0) {
        System.err.println("Specify the fee level to test in satoshis as the first argument.");
        return;
    }

    Coin feeToTest = Coin.valueOf(Long.parseLong(args[0]));

    kit = new WalletAppKit(PARAMS, new File("."), "testfeelevel");
    kit.startAsync();
    kit.awaitRunning();
    try {
        go(feeToTest);
    } finally {
        kit.stopAsync();
        kit.awaitTerminated();
    }
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:20,代码来源:TestFeeLevel.java


示例7: setupWalletKit

import org.bitcoinj.kits.WalletAppKit; //导入依赖的package包/类
public void setupWalletKit (@Nullable DeterministicSeed seed) {
    // If seed is non-null it means we are restoring from backup.
    bitcoin = new WalletAppKit(params, new File("."), APP_NAME + "-" + params.getPaymentProtocolId() + CLIENTID) {
        @Override
        protected void onSetupCompleted () {
            // Don't make the user wait for confirmations for now, as the intention is they're sending it
            // their own money!
            bitcoin.wallet().allowSpendingUnconfirmedTransactions();
            Platform.runLater(controller::onBitcoinSetup);

        }
    };

    bitcoin.setDownloadListener(controller.progressBarUpdater())
            .setBlockingStartup(false)
            .setUserAgent(APP_NAME, "1.0");
    if (seed != null) {
        bitcoin.restoreWalletFromSeed(seed);
    }

}
 
开发者ID:matsjj,项目名称:thundernetwork,代码行数:22,代码来源:Main.java


示例8: WalletRunnable

import org.bitcoinj.kits.WalletAppKit; //导入依赖的package包/类
public WalletRunnable()
{
    super();

    log.info("Starting wallet.");

    // https://stackoverflow.com/questions/5115339/tomcat-opts-environment-variable-and-system-getenv
    File walletLoc = ServerConfig.BITMESH_TEST ?
        new File("./") :
        new File(System.getenv("persistdir"));

    if(!walletLoc.canRead() || !walletLoc.canWrite())
    {
        log.error("Cannot read or write to wallet location.");
        return;
    }

    // Initialize wallet appkit with params, location and class name
    appKit = new WalletAppKit(MainNetParams.get(), walletLoc, "mainnet");
    appKit.setAutoSave(true);

    testAppKit = new WalletAppKit(TestNet3Params.get(), walletLoc, "testnet");
    testAppKit.setAutoSave(true);
}
 
开发者ID:adonley,项目名称:LockedTransactionServer,代码行数:25,代码来源:WalletRunnable.java


示例9: main

import org.bitcoinj.kits.WalletAppKit; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
    BriefLogFormatter.initWithSilentBitcoinJ();
    if (args.length == 0) {
        System.err.println("Specify the fee level to test in satoshis as the first argument.");
        return;
    }

    Coin feeToTest = Coin.valueOf(Long.parseLong(args[0]));
    System.out.println("Fee to test is " + feeToTest.toFriendlyString());

    kit = new WalletAppKit(PARAMS, new File("."), "testfeelevel");
    kit.startAsync();
    kit.awaitRunning();
    try {
        go(feeToTest, NUM_OUTPUTS);
    } finally {
        kit.stopAsync();
        kit.awaitTerminated();
    }
}
 
开发者ID:HashEngineering,项目名称:dashj,代码行数:21,代码来源:TestFeeLevel.java


示例10: setupWalletKit

import org.bitcoinj.kits.WalletAppKit; //导入依赖的package包/类
public void setupWalletKit(@Nullable DeterministicSeed seed) {
    // If seed is non-null it means we are restoring from backup.
    bitcoin = new WalletAppKit(params, new File("."), WALLET_FILE_NAME) {
        @Override
        protected void onSetupCompleted() {
            // Don't make the user wait for confirmations for now, as the intention is they're sending it
            // their own money!
            bitcoin.wallet().allowSpendingUnconfirmedTransactions();
            Platform.runLater(controller::onBitcoinSetup);
        }
    };
    // Now configure and start the appkit. This will take a second or two - we could show a temporary splash screen
    // or progress widget to keep the user engaged whilst we initialise, but we don't.
    if (params == RegTestParams.get()) {
        bitcoin.connectToLocalHost();   // You should run a regtest mode bitcoind locally.
    }
    bitcoin.setDownloadListener(controller.progressBarUpdater())
           .setBlockingStartup(false)
           .setUserAgent(APP_NAME, "1.0");
    if (seed != null)
        bitcoin.restoreWalletFromSeed(seed);
}
 
开发者ID:bitcoinj,项目名称:bitcoinj,代码行数:23,代码来源:Main.java


示例11: main

import org.bitcoinj.kits.WalletAppKit; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
    BriefLogFormatter.initWithSilentBitcoinJ();
    if (args.length == 0) {
        System.err.println("Specify the fee rate to test in satoshis/kB as the first argument.");
        return;
    }

    Coin feeRateToTest = Coin.valueOf(Long.parseLong(args[0]));
    System.out.println("Fee rate to test is " + feeRateToTest.toFriendlyString() + "/kB");

    kit = new WalletAppKit(PARAMS, new File("."), "testfeelevel");
    kit.startAsync();
    kit.awaitRunning();
    try {
        go(feeRateToTest, NUM_OUTPUTS);
    } finally {
        kit.stopAsync();
        kit.awaitTerminated();
    }
}
 
开发者ID:bitcoinj,项目名称:bitcoinj,代码行数:21,代码来源:TestFeeLevel.java


示例12: setupWalletKit

import org.bitcoinj.kits.WalletAppKit; //导入依赖的package包/类
public void setupWalletKit(@Nullable DeterministicSeed seed) {
    // If seed is non-null it means we are restoring from backup.
    bitcoin = new WalletAppKit(params, new File("."), APP_NAME + "-" + params.getPaymentProtocolId()) {
        @Override
        protected void onSetupCompleted() {
            // Don't make the user wait for confirmations for now, as the intention is they're sending it
            // their own money!
            bitcoin.wallet().allowSpendingUnconfirmedTransactions();
            Platform.runLater(controller::onBitcoinSetup);
        }
    };
    // Now configure and start the appkit. This will take a second or two - we could show a temporary splash screen
    // or progress widget to keep the user engaged whilst we initialise, but we don't.
    if (params == RegTestParams.get()) {
        bitcoin.connectToLocalHost();   // You should run a regtest mode bitcoind locally.
    } else if (params == TestNet3Params.get()) {
        // As an example!
        bitcoin.useTor();
        // bitcoin.setDiscovery(new HttpDiscovery(params, URI.create("http://localhost:8080/peers"), ECKey.fromPublicOnly(BaseEncoding.base16().decode("02cba68cfd0679d10b186288b75a59f9132b1b3e222f6332717cb8c4eb2040f940".toUpperCase()))));
    } else {
        bitcoin.useTor();
    }
    bitcoin.setDownloadListener(controller.progressBarUpdater())
           .setBlockingStartup(false)
           .setUserAgent(APP_NAME, "1.0");
    if (seed != null)
        bitcoin.restoreWalletFromSeed(seed);
}
 
开发者ID:Techsoul192,项目名称:legendary-guide,代码行数:29,代码来源:Main.java


示例13: initWallet

import org.bitcoinj.kits.WalletAppKit; //导入依赖的package包/类
/**
     *
     */
    private void initWallet(final NetworkParameters netParams) {
        //File dataDir = getDir("consensus_folder", Context.MODE_PRIVATE);

      //  _bitcoinJContext = new org.bitcoinj.core.Context(netParams);

        // Start up a basic app using a class that automates some boilerplate. Ensure we always have at least one key.
        _walletKit = new WalletAppKit(Constants.NETWORK_PARAMETERS,
                _bitcoin.getDataDir(),
                ServiceConsts.SERVICE_APP_NAME + "-" + netParams.getPaymentProtocolId()) {

            /**
             *
             */
            @Override
            protected void onSetupCompleted() {
                System.out.println("Setting up wallet : " + wallet().toString());

                // This is called in a background thread after startAndWait is called, as setting up various objects
                // can do disk and network IO that may cause UI jank/stuttering in wallet apps if it were to be done
                // on the main thread.
                if (wallet().getKeyChainGroupSize() < 1)
                    wallet().importKey(new ECKey());

                peerGroup().setFastCatchupTimeSecs(wallet().getEarliestKeyCreationTime());
                peerGroup().addPeerDiscovery(new DnsDiscovery(netParams));

//                wallet.removeCoinsReceivedEventListener(_bitcoinManger);
//                wallet.addCoinsReceivedEventListener(_bitcoinManger);

                _bitcoin.setWalletManager(_walletKit);
            }
        };
    }
 
开发者ID:ehanoc,项目名称:xwallet,代码行数:37,代码来源:BitcoinSetupAction.java


示例14: initKit

import org.bitcoinj.kits.WalletAppKit; //导入依赖的package包/类
private WalletAppKit initKit(@Nullable DeterministicSeed seed) {
   //initialize files and stuff here, add our address to the watched ones
   WalletAppKit kit = new WalletAppKit(params, new File("./spv"), fileprefix);
   kit.setAutoSave(true);
   kit.useTor();
   kit.setDiscovery(new DnsDiscovery(params));
   // fresh restore if seed provided
   if (seed != null) {
      kit.restoreWalletFromSeed(seed);
   }
   // startUp WalletAppKit
   kit.startAndWait();
   return kit;
}
 
开发者ID:DanielKrawisz,项目名称:Shufflepuff,代码行数:15,代码来源:BitcoinCrypto.java


示例15: testSend

import org.bitcoinj.kits.WalletAppKit; //导入依赖的package包/类
@Test
public void testSend() throws Exception {
   WalletAppKit nomKit = bitcoinCryptoNoP.getKit();
   Wallet wallet = nomKit.wallet();
   System.out.println("Current Receive Address: " + wallet.currentReceiveAddress().toString() + "\nIssued Receive Addresses: \n" + wallet.getIssuedReceiveAddresses().toString() + "\nMnemonic: " + wallet.getActiveKeychain().getMnemonicCode().toString() + "\nWallets Balance: " + wallet.getBalance().toPlainString() + " BTC");
   // Get a ready to send TX in its Raw HEX format
   System.out.println("Raw TX HEX: " + bitcoinCryptoNoP.sendOffline("n2ooxjPCQ19f56ivrCBq93DM6a71TA89bc", 10000));
   // Create and send transaciton using the wallets broadcast
   org.bitcoinj.core.Transaction sentTransaction = bitcoinCryptoNoP.send("n2ooxjPCQ19f56ivrCBq93DM6a71TA89bc", 10000);
   System.out.println("Transaction sent. Find txid: " + sentTransaction.getHashAsString());
}
 
开发者ID:DanielKrawisz,项目名称:Shufflepuff,代码行数:12,代码来源:BitcoinCryptoTest.java


示例16: main

import org.bitcoinj.kits.WalletAppKit; //导入依赖的package包/类
public static void main(String[] args) {

        // First we configure the network we want to use.
        // The available options are:
        // - MainNetParams
        // - TestNet3Params
        // - RegTestParams
        // While developing your application you probably want to use the Regtest mode and run your local bitcoin network. Run bitcoind with the -regtest flag
        // To test you app with a real network you can use the testnet. The testnet is an alternative bitcoin network that follows the same rules as main network. Coins are worth nothing and you can get coins for example from http://faucet.xeno-genesis.com/
        // 
        // For more information have a look at: https://bitcoinj.github.io/testing and https://bitcoin.org/en/developer-examples#testing-applications
        NetworkParameters params = TestNet3Params.get();

        // Now we initialize a new WalletAppKit. The kit handles all the boilerplate for us and is the easiest way to get everything up and running.
        // Have a look at the WalletAppKit documentation and its source to understand what's happening behind the scenes: https://github.com/bitcoinj/bitcoinj/blob/master/core/src/main/java/org/bitcoinj/kits/WalletAppKit.java
        WalletAppKit kit = new WalletAppKit(params, new File("."), "walletappkit-example");

        // In case you want to connect with your local bitcoind tell the kit to connect to localhost.
        // You must do that in reg test mode.
        //kit.connectToLocalHost();

        // Now we start the kit and sync the blockchain.
        // bitcoinj is working a lot with the Google Guava libraries. The WalletAppKit extends the AbstractIdleService. Have a look at the introduction to Guava services: https://code.google.com/p/guava-libraries/wiki/ServiceExplained
        kit.startAsync();
        kit.awaitRunning();

        // To observe wallet events (like coins received) we implement a EventListener class that extends the AbstractWalletEventListener bitcoinj then calls the different functions from the EventListener class
        WalletListener wListener = new WalletListener();
        kit.wallet().addEventListener(wListener);

        // Ready to run. The kit syncs the blockchain and our wallet event listener gets notified when something happens.
        // To test everything we create and print a fresh receiving address. Send some coins to that address and see if everything works.
        System.out.println("send money to: " + kit.wallet().freshReceiveAddress().toString());

        // Make sure to properly shut down all the running services when you manually want to stop the kit. The WalletAppKit registers a runtime ShutdownHook so we actually do not need to worry about that when our application is stopping.
        //System.out.println("shutting down again");
        //kit.stopAsync();
        //kit.awaitTerminated();
    }
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:40,代码来源:Kit.java


示例17: setupWalletKit

import org.bitcoinj.kits.WalletAppKit; //导入依赖的package包/类
public void setupWalletKit(@Nullable DeterministicSeed seed) {
    // If seed is non-null it means we are restoring from backup.
    bitcoin = new WalletAppKit(params, new File("."), APP_NAME) {
        @Override
        protected void onSetupCompleted() {
            // Don't make the user wait for confirmations for now, as the intention is they're sending it
            // their own money!
            bitcoin.wallet().allowSpendingUnconfirmedTransactions();
            if (params != RegTestParams.get())
                bitcoin.peerGroup().setMaxConnections(11);
            bitcoin.peerGroup().setBloomFilterFalsePositiveRate(0.00001);
            Platform.runLater(controller::onBitcoinSetup);
        }
    };
    // Now configure and start the appkit. This will take a second or two - we could show a temporary splash screen
    // or progress widget to keep the user engaged whilst we initialise, but we don't.
    if (params == RegTestParams.get()) {
        bitcoin.connectToLocalHost();   // You should run a regtest mode bitcoind locally.
    } else if (params == MainNetParams.get()) {
        // Checkpoints are block headers that ship inside our app: for a new user, we pick the last header
        // in the checkpoints file and then download the rest from the network. It makes things much faster.
        // Checkpoint files are made using the BuildCheckpoints tool and usually we have to download the
        // last months worth or more (takes a few seconds).
        bitcoin.setCheckpoints(getClass().getResourceAsStream("checkpoints"));
    } else if (params == TestNet3Params.get()) {
        bitcoin.setCheckpoints(getClass().getResourceAsStream("checkpoints.testnet"));
        // As an example!
        bitcoin.useTor();
    }
    bitcoin.setDownloadListener(controller.progressBarUpdater())
           .setBlockingStartup(false)
           .setUserAgent(APP_NAME, "1.0");
    if (seed != null)
        bitcoin.restoreWalletFromSeed(seed);
}
 
开发者ID:HashEngineering,项目名称:namecoinj,代码行数:36,代码来源:Main.java


示例18: setupWalletKit

import org.bitcoinj.kits.WalletAppKit; //导入依赖的package包/类
public void setupWalletKit(@Nullable DeterministicSeed seed) {
    // If seed is non-null it means we are restoring from backup.
    bitcoin = new WalletAppKit(params, new File("."), APP_NAME) {
        @Override
        protected void onSetupCompleted() {
            // Don't make the user wait for confirmations for now, as the intention is they're sending it
            // their own money!
            bitcoin.wallet().allowSpendingUnconfirmedTransactions();
            if (params != RegTestParams.get())
                bitcoin.peerGroup().setMaxConnections(11);
            bitcoin.peerGroup().setBloomFilterFalsePositiveRate(0.00001);
            Platform.runLater(controller::onBitcoinSetup);
        }
    };
    // Now configure and start the appkit. This will take a second or two - we could show a temporary splash screen
    // or progress widget to keep the user engaged whilst we initialise, but we don't.
    if (params == RegTestParams.get()) {
        bitcoin.connectToLocalHost();   // You should run a regtest mode bitcoind locally.
    } else if (params == TestNet3Params.get()) {
        // As an example!
        //bitcoin.useTor();
        // bitcoin.setDiscovery(new HttpDiscovery(params, URI.create("http://localhost:8080/peers"), ECKey.fromPublicOnly(BaseEncoding.base16().decode("02cba68cfd0679d10b186288b75a59f9132b1b3e222f6332717cb8c4eb2040f940".toUpperCase()))));
    }
    bitcoin.setDownloadListener(controller.progressBarUpdater())
           .setBlockingStartup(false)
           .setUserAgent(APP_NAME, "1.0");
    if (seed != null)
        bitcoin.restoreWalletFromSeed(seed);
}
 
开发者ID:egordon,项目名称:CoinJoin,代码行数:30,代码来源:Main.java


示例19: setupWalletKit

import org.bitcoinj.kits.WalletAppKit; //导入依赖的package包/类
public void setupWalletKit(@Nullable DeterministicSeed seed) {
    // If seed is non-null it means we are restoring from backup.
    bitcoin = new WalletAppKit(params, new File("."), APP_NAME) {
        @Override
        protected void onSetupCompleted() {
            // Don't make the user wait for confirmations for now, as the intention is they're sending it
            // their own money!
            bitcoin.wallet().allowSpendingUnconfirmedTransactions();
            if (params != RegTestParams.get())
                bitcoin.peerGroup().setMaxConnections(11);
            bitcoin.peerGroup().setBloomFilterFalsePositiveRate(0.00001);
            Platform.runLater(controller::onBitcoinSetup);
        }
    };
    // Now configure and start the appkit. This will take a second or two - we could show a temporary splash screen
    // or progress widget to keep the user engaged whilst we initialise, but we don't.
    if (params == RegTestParams.get()) {
        bitcoin.connectToLocalHost();   // You should run a regtest mode bitcoind locally.
    } else if (params == TestNet3Params.get()) {
        // As an example!
        bitcoin.useTor();
    }
    bitcoin.setDownloadListener(controller.progressBarUpdater())
           .setBlockingStartup(false)
           .setUserAgent(APP_NAME, "1.0");
    if (seed != null)
        bitcoin.restoreWalletFromSeed(seed);
}
 
开发者ID:DigiByte-Team,项目名称:digibytej-alice,代码行数:29,代码来源:Main.java


示例20: setUp

import org.bitcoinj.kits.WalletAppKit; //导入依赖的package包/类
@Before
public void setUp() throws Exception
{
    appKit = new WalletAppKit(TestNet3Params.get(), walletLocation, TransactionServletTest.class.getName().toString());
    appKit.setAutoSave(true);
    appKit.startAsync();
    appKit.awaitRunning();
    appKit.setBlockingStartup(true);
    wallet = appKit.wallet();
    log.info("Wallet Address " + wallet.currentReceiveAddress());
}
 
开发者ID:adonley,项目名称:LockedTransactionServer,代码行数:12,代码来源:TransactionServletTest.java



注:本文中的org.bitcoinj.kits.WalletAppKit类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DefaultLogger类代码示例发布时间:2022-05-21
下一篇:
Java ClassFormatException类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap