Sync too low when using BitCoinJ to create and host own wallet

2017-08-27 Thread Alex Yang


I need to use BitcoinJ to create and host wallet on my own website. 
However, it keeps downloading blocks and the sync seems taking forever. I 
need to be able to create a wallet within a few seconds.

Could anyone please advice what should i do to optimize the sync time?

ECKey key = new ECKey();
Address addressFromKey = key.toAddress(params);

Wallet wallet = new Wallet(params);
wallet.importKey(key);

File blockFile = new File(“/tmp/bitcoinblocks”);
BlockStore blockStore = new MemoryBlockStore(params);
BlockChain chain = new BlockChain(params,blockStore);
PeerGroup peerGroup = new PeerGroup(params, chain);
peerGroup.addPeerDiscovery(new DnsDiscovery(params));
peerGroup.addWallet(wallet);
peerGroup.start();
peerGroup.downloadedBlockChain(); 

-- 
You received this message because you are subscribed to the Google Groups 
"bitcoinj" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bitcoinj+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Sync too low when using BitCoinJ to create and host own wallet

2017-08-28 Thread Alex Yang
Thanks Andreas! Do we need to install and run bitcoin-core or we just need 
to set up the checkpointing?

在 2017年8月28日星期一 UTC+8下午2:38:51,Andreas Schildbach写道:
>
> See this document on how set up checkpointing: 
>
> https://bitcoinj.github.io/speeding-up-chain-sync 
>
>
> On 08/27/2017 07:22 PM, Alex Yang wrote: 
> > I need to use BitcoinJ to create and host wallet on my own website. 
> > However, it keeps downloading blocks and the sync seems taking forever. 
> > I need to be able to create a wallet within a few seconds. 
> > 
> > Could anyone please advice what should i do to optimize the sync time? 
> > 
> > |ECKey key = new ECKey(); Address addressFromKey = 
> key.toAddress(params); 
> > Wallet wallet = new Wallet(params); wallet.importKey(key); File 
> > blockFile = new File(“/tmp/bitcoinblocks”); BlockStore blockStore = new 
> > MemoryBlockStore(params); BlockChain chain = new 
> > BlockChain(params,blockStore); PeerGroup peerGroup = new 
> > PeerGroup(params, chain); peerGroup.addPeerDiscovery(new 
> > DnsDiscovery(params)); peerGroup.addWallet(wallet); peerGroup.start(); 
> > peerGroup.downloadedBlockChain(); | 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "bitcoinj" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> > an email to bitcoinj+u...@googlegroups.com  
> > <mailto:bitcoinj+u...@googlegroups.com >. 
> > For more options, visit https://groups.google.com/d/optout. 
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"bitcoinj" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bitcoinj+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Sync too low when using BitCoinJ to create and host own wallet

2017-08-29 Thread Alex Yang
What I need is to create the wallet and just call 3rd party APIs to make 
the transactions.

In this case,  Do we need to set up a bitcoin node or we can just use 
bitcoinj to create a wallet and then use 3rd party APIs(The APIs will 
handle the sync etc.)? 

在 2017年8月28日星期一 UTC+8下午11:00:25,Andreas Schildbach写道:
>
> You will need at least one node to sync from, typically Bitcoin Core or 
> some fork of it. PeerGroup automatically discovers peers and connects to 
> a number of them. 
>
>
> On 08/28/2017 10:57 AM, Alex Yang wrote: 
> > Thanks Andreas! Do we need to install and run bitcoin-core or we just 
> > need to set up the checkpointing? 
> > 
> > 在 2017年8月28日星期一 UTC+8下午2:38:51,Andreas Schildbach写道: 
> > 
> > See this document on how set up checkpointing: 
> > 
> > https://bitcoinj.github.io/speeding-up-chain-sync 
> > <https://bitcoinj.github.io/speeding-up-chain-sync> 
> > 
> > 
> > On 08/27/2017 07:22 PM, Alex Yang wrote: 
> > > I need to use BitcoinJ to create and host wallet on my own 
> website. 
> > > However, it keeps downloading blocks and the sync seems taking 
> > forever. 
> > > I need to be able to create a wallet within a few seconds. 
> > > 
> > > Could anyone please advice what should i do to optimize the sync 
> > time? 
> > > 
> > > |ECKey key = new ECKey(); Address addressFromKey = 
> > key.toAddress(params); 
> > > Wallet wallet = new Wallet(params); wallet.importKey(key); File 
> > > blockFile = new File(“/tmp/bitcoinblocks”); BlockStore blockStore 
> > = new 
> > > MemoryBlockStore(params); BlockChain chain = new 
> > > BlockChain(params,blockStore); PeerGroup peerGroup = new 
> > > PeerGroup(params, chain); peerGroup.addPeerDiscovery(new 
> > > DnsDiscovery(params)); peerGroup.addWallet(wallet); 
> > peerGroup.start(); 
> > > peerGroup.downloadedBlockChain(); | 
> > > 
> > > -- 
> > > You received this message because you are subscribed to the Google 
> > > Groups "bitcoinj" group. 
> > > To unsubscribe from this group and stop receiving emails from it, 
> > send 
> > > an email to bitcoinj+u...@googlegroups.com 
> > > <mailto:bitcoinj+u...@googlegroups.com>. 
> > > For more options, visit https://groups.google.com/d/optout 
> > <https://groups.google.com/d/optout>. 
> > 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "bitcoinj" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> > an email to bitcoinj+u...@googlegroups.com  
> > <mailto:bitcoinj+u...@googlegroups.com >. 
> > For more options, visit https://groups.google.com/d/optout. 
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"bitcoinj" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bitcoinj+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Sync too low when using BitCoinJ to create and host own wallet

2017-08-31 Thread Alex Yang
Such as the blockcypher API which is allows the users to create both 
bitcoin/ethereum wallets with a token.
With that token, we can also manipulate the wallets such as make 
transactions etc.

The problem with bitcoinj is that we have to create and maintain a 
blockchain node?

在 2017年8月30日星期三 UTC+8下午4:16:38,Andreas Schildbach写道:
>
> What do you mean by 3rd party API? What does that API do? Bitcoinj is 
> designed to use the Bitcoin P2P protocol. 
>
>
> On 08/30/2017 04:12 AM, Alex Yang wrote: 
> > What I need is to create the wallet and just call 3rd party APIs to make 
> > the transactions. 
> > 
> > In this case,  Do we need to set up a bitcoin node or we can just use 
> > bitcoinj to create a wallet and then use 3rd party APIs(The APIs will 
> > handle the sync etc.)? 
> > 
> > 在 2017年8月28日星期一 UTC+8下午11:00:25,Andreas Schildbach写道: 
> > 
> > You will need at least one node to sync from, typically Bitcoin Core 
> or 
> > some fork of it. PeerGroup automatically discovers peers and 
> >     connects to 
> > a number of them. 
> > 
> > 
> > On 08/28/2017 10:57 AM, Alex Yang wrote: 
> > > Thanks Andreas! Do we need to install and run bitcoin-core or we 
> just 
> > > need to set up the checkpointing? 
> > > 
> > > 在 2017年8月28日星期一 UTC+8下午2:38:51,Andreas Schildbach写道: 
> > > 
> > > See this document on how set up checkpointing: 
> > > 
> > > https://bitcoinj.github.io/speeding-up-chain-sync 
> > <https://bitcoinj.github.io/speeding-up-chain-sync> 
> > > <https://bitcoinj.github.io/speeding-up-chain-sync 
> > <https://bitcoinj.github.io/speeding-up-chain-sync>> 
> > > 
> > > 
> > > On 08/27/2017 07:22 PM, Alex Yang wrote: 
> > > > I need to use BitcoinJ to create and host wallet on my own 
> > website. 
> > > > However, it keeps downloading blocks and the sync seems 
> taking 
> > > forever. 
> > > > I need to be able to create a wallet within a few seconds. 
> > > > 
> > > > Could anyone please advice what should i do to optimize the 
> > sync 
> > > time? 
> > > > 
> > > > |ECKey key = new ECKey(); Address addressFromKey = 
> > > key.toAddress(params); 
> > > > Wallet wallet = new Wallet(params); wallet.importKey(key); 
> File 
> > > > blockFile = new File(“/tmp/bitcoinblocks”); BlockStore 
> > blockStore 
> > > = new 
> > > > MemoryBlockStore(params); BlockChain chain = new 
> > > > BlockChain(params,blockStore); PeerGroup peerGroup = new 
> > > > PeerGroup(params, chain); peerGroup.addPeerDiscovery(new 
> > > > DnsDiscovery(params)); peerGroup.addWallet(wallet); 
> > > peerGroup.start(); 
> > > > peerGroup.downloadedBlockChain(); | 
> > > > 
> > > > -- 
> > > > You received this message because you are subscribed to the 
> > Google 
> > > > Groups "bitcoinj" group. 
> > > > To unsubscribe from this group and stop receiving emails 
> > from it, 
> > > send 
> > > > an email to bitcoinj+u...@googlegroups.com 
> > > > <mailto:bitcoinj+u...@googlegroups.com>. 
> > > > For more options, visit https://groups.google.com/d/optout 
> > <https://groups.google.com/d/optout> 
> > > <https://groups.google.com/d/optout 
> > <https://groups.google.com/d/optout>>. 
> > > 
> > > 
> > > -- 
> > > You received this message because you are subscribed to the Google 
> > > Groups "bitcoinj" group. 
> > > To unsubscribe from this group and stop receiving emails from it, 
> > send 
> > > an email to bitcoinj+u...@googlegroups.com 
> > > <mailto:bitcoinj+u...@googlegroups.com>. 
> > > For more options, visit https://groups.google.com/d/optout 
> > <https://groups.google.com/d/optout>. 
> > 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "bitcoinj" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> > an email to bitcoinj+u...@googlegroups.com  
> > <mailto:bitcoinj+u...@googlegroups.com >. 
> > For more options, visit https://groups.google.com/d/optout. 
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"bitcoinj" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bitcoinj+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


how can we support our users to buy bitcoin?

2017-09-02 Thread Alex Yang


My project creates a wallet for each user. and we support the user transfer 
their bitcoin from the wallet to any other bitcoin address. The scenario is 
as below:

1.The user creates an account in our website AND login.
2.we assign the user an bitcoin address with bitcoinj.
3.The user buys bitcoin from us and put it to this address.
4.The user transfers the bitcoin to any other external address.


My question are:

When the user buys bitcoin, where should we actually get the bitcoin and charge 
it to the user's address? 

Should we buy some bitcoin to our own wallet first so when the user buys 
Bitcoin, we make the transfer from our own ETH wallet?

Or is there any other way?

-- 
You received this message because you are subscribed to the Google Groups 
"bitcoinj" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bitcoinj+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.