本文整理汇总了Java中org.bitcoinj.kits.WalletAppKit.setAutoSave方法的典型用法代码示例。如果您正苦于以下问题:Java WalletAppKit.setAutoSave方法的具体用法?Java WalletAppKit.setAutoSave怎么用?Java WalletAppKit.setAutoSave使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bitcoinj.kits.WalletAppKit
的用法示例。
在下文中一共展示了WalletAppKit.setAutoSave方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
示例2: 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;
}
示例3: 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());
}