Re: Issue for send from one address to another Within same Wallet

2019-07-10 Thread Kunal Ransing
Hi  @Andreas Schildbach

Can you help please ?

On Friday, 5 July 2019 12:17:04 UTC+5:30, Kunal Ransing wrote:
>
> Hi,
>
> Please check below log. We used bitcoinj-0.14.7
>
> 2019-07-04 07:08:52,316 INFO  [BTCConfig] (EJB default - 3) 
> BTCConfig_sendCoin[null]:Amount[0.0010],CAddress[
> mjfk9eH6bL3kWB2rxCvEpVeebh3Re2qHNq]
> 2019-07-04 07:08:52,470 INFO  [BTCConfig] (bitcoinj user thread) BTCConfig
> :Received tx for 0.18099586 BTC:   
> 1a27cdb394e9b8700315931d434f1d048c830e55ea113937f5c6657e933c
>   updated: 2019-07-04T07:08:52Z
>  in   PUSHDATA(71)[
> 30440220671380ce916eea30e963ec8321795b38f40a7eda7307dd840b8134b8d24c43de02203555cada51f267afb9bdf04babd846d8f5d9ca9e25ebf158a3d9778af3f30f7e01
> ] PUSHDATA(33)[
> 02e38ebbaf270bffa495b4289886c3a9797ecd1395edf6c3ff64a442f542077217] 
> 0.18104586 BTC
>   outpoint:
> bdc18f7bd931976853435f52ad8cce3670b3a656f1f8315ce72a2e5cfdd63bbf:1 hash160
> :3cb538db83e92d4e6213331a38324042f8fed0b5
>  out  DUP HASH160 PUSHDATA(20)[
> 2d8a1bd06754b28a4a408235997beffc5314f5ad] EQUALVERIFY CHECKSIG 0.001 BTC
>  out  DUP HASH160 PUSHDATA(20)[
> c1acb7a6d334990cec9a1a0c59d1bd7fbc2ac845] EQUALVERIFY CHECKSIG 0.17999586 
> BTC
>  fee  0.0002 BTC/kB, 0.5 BTC for 225 bytes
>  prps USER_PAYMENT
>
>
> 2019-07-04 07:08:52,470 INFO  [BTCConfig] (bitcoinj user thread) 
> BTCConfig_updateTxResult:Receivedtx[
> 1a27cdb394e9b8700315931d434f1d048c830e55ea113937f5c6657e933c] of 
> block depth[0] for amount[0.18099586 BTC] foraddress[
> mjfk9eH6bL3kWB2rxCvEpVeebh3Re2qHNq]
>
>
>
> On Thursday, 4 July 2019 19:14:21 UTC+5:30, Andreas Schildbach wrote:
>>
>> Can you post the toString() of the transaction in question? 
>>
>>
>> On 04/07/2019 15.22, Kunal Ransing wrote: 
>> > We have a wallet that has many testnet addresses, We tried performing a 
>> > "Send" Transaction from one address to another (Within same Wallet). 
>> > Q1. We found that the sent amount did not match the receiving amount. 
>> We 
>> > this feature is a necessity, Could you please mention drawbacks of this 
>> > approach? 
>> > Q2. Is there any way that will return all Addresses generated under 
>> > particular Wallet? 
>> > 
>> > -- 
>> > 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 bitc...@googlegroups.com 
>> > <mailto:bitc...@googlegroups.com>. 
>> > To view this discussion on the web visit 
>> > 
>> https://groups.google.com/d/msgid/bitcoinj/52da624b-9b97-471f-8cdb-29f47ff95bae%40googlegroups.com
>>  
>> > <
>> https://groups.google.com/d/msgid/bitcoinj/52da624b-9b97-471f-8cdb-29f47ff95bae%40googlegroups.com?utm_medium=email_source=footer>.
>>  
>>
>> > 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bitcoinj/d5d761fd-9eb3-4b1c-895f-0b7a968a6e67%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Issue for send from one address to another Within same Wallet

2019-07-05 Thread Kunal Ransing
Hi,

Please check below log. We used bitcoinj-0.14.7

2019-07-04 07:08:52,316 INFO  [BTCConfig] (EJB default - 3) 
BTCConfig_sendCoin[null]:Amount[0.0010],CAddress[
mjfk9eH6bL3kWB2rxCvEpVeebh3Re2qHNq]
2019-07-04 07:08:52,470 INFO  [BTCConfig] (bitcoinj user thread) BTCConfig:
Received tx for 0.18099586 BTC:   
1a27cdb394e9b8700315931d434f1d048c830e55ea113937f5c6657e933c
  updated: 2019-07-04T07:08:52Z
 in   PUSHDATA(71)[
30440220671380ce916eea30e963ec8321795b38f40a7eda7307dd840b8134b8d24c43de02203555cada51f267afb9bdf04babd846d8f5d9ca9e25ebf158a3d9778af3f30f7e01
] PUSHDATA(33)[
02e38ebbaf270bffa495b4289886c3a9797ecd1395edf6c3ff64a442f542077217] 
0.18104586 BTC
  outpoint:
bdc18f7bd931976853435f52ad8cce3670b3a656f1f8315ce72a2e5cfdd63bbf:1 hash160:
3cb538db83e92d4e6213331a38324042f8fed0b5
 out  DUP HASH160 PUSHDATA(20)[2d8a1bd06754b28a4a408235997beffc5314f5ad] 
EQUALVERIFY CHECKSIG 0.001 BTC
 out  DUP HASH160 PUSHDATA(20)[c1acb7a6d334990cec9a1a0c59d1bd7fbc2ac845] 
EQUALVERIFY CHECKSIG 0.17999586 BTC
 fee  0.0002 BTC/kB, 0.5 BTC for 225 bytes
 prps USER_PAYMENT


2019-07-04 07:08:52,470 INFO  [BTCConfig] (bitcoinj user thread) 
BTCConfig_updateTxResult:Receivedtx[
1a27cdb394e9b8700315931d434f1d048c830e55ea113937f5c6657e933c] of block 
depth[0] for amount[0.18099586 BTC] foraddress[
mjfk9eH6bL3kWB2rxCvEpVeebh3Re2qHNq]



On Thursday, 4 July 2019 19:14:21 UTC+5:30, Andreas Schildbach wrote:
>
> Can you post the toString() of the transaction in question? 
>
>
> On 04/07/2019 15.22, Kunal Ransing wrote: 
> > We have a wallet that has many testnet addresses, We tried performing a 
> > "Send" Transaction from one address to another (Within same Wallet). 
> > Q1. We found that the sent amount did not match the receiving amount. We 
> > this feature is a necessity, Could you please mention drawbacks of this 
> > approach? 
> > Q2. Is there any way that will return all Addresses generated under 
> > particular Wallet? 
> > 
> > -- 
> > 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 bitc...@googlegroups.com  
> > <mailto:bitc...@googlegroups.com >. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/bitcoinj/52da624b-9b97-471f-8cdb-29f47ff95bae%40googlegroups.com
>  
> > <
> https://groups.google.com/d/msgid/bitcoinj/52da624b-9b97-471f-8cdb-29f47ff95bae%40googlegroups.com?utm_medium=email_source=footer>.
>  
>
> > 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bitcoinj/78e4794a-055f-4ce3-8c5f-674fdf2453a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Issue for send from one address to another Within same Wallet

2019-07-05 Thread Kunal Ransing
Hi,

Please check below log:
2019-07-04 07:08:52,316 INFO  [BTCConfig] (EJB default - 3) 
BTCConfig_sendCoin[null]:Amount[*0.0010*],CAddress[
mjfk9eH6bL3kWB2rxCvEpVeebh3Re2qHNq]
2019-07-04 07:08:52,470 INFO  [BTCConfig] (bitcoinj user thread) BTCConfig:
Received tx for *0.18099586* BTC:   
1a27cdb394e9b8700315931d434f1d048c830e55ea113937f5c6657e933c
  updated: 2019-07-04T07:08:52Z
 in   PUSHDATA(71)[
30440220671380ce916eea30e963ec8321795b38f40a7eda7307dd840b8134b8d24c43de02203555cada51f267afb9bdf04babd846d8f5d9ca9e25ebf158a3d9778af3f30f7e01
] PUSHDATA(33)[
02e38ebbaf270bffa495b4289886c3a9797ecd1395edf6c3ff64a442f542077217] 
0.18104586 BTC
  outpoint:
bdc18f7bd931976853435f52ad8cce3670b3a656f1f8315ce72a2e5cfdd63bbf:1 hash160:
3cb538db83e92d4e6213331a38324042f8fed0b5
 out  DUP HASH160 PUSHDATA(20)[2d8a1bd06754b28a4a408235997beffc5314f5ad] 
EQUALVERIFY CHECKSIG 0.001 BTC
 out  DUP HASH160 PUSHDATA(20)[c1acb7a6d334990cec9a1a0c59d1bd7fbc2ac845] 
EQUALVERIFY CHECKSIG 0.17999586 BTC
 fee  0.0002 BTC/kB, 0.5 BTC for 225 bytes
 prps USER_PAYMENT


2019-07-04 07:08:52,470 INFO  [BTCConfig] (bitcoinj user thread) 
BTCConfig_updateTxResult:Received tx[
1a27cdb394e9b8700315931d434f1d048c830e55ea113937f5c6657e933c] of block 
depth[0] for amount[0.18099586 BTC] for address[
mjfk9eH6bL3kWB2rxCvEpVeebh3Re2qHNq]


On Thursday, 4 July 2019 19:14:21 UTC+5:30, Andreas Schildbach wrote:
>
> Can you post the toString() of the transaction in question? 
>
>
> On 04/07/2019 15.22, Kunal Ransing wrote: 
> > We have a wallet that has many testnet addresses, We tried performing a 
> > "Send" Transaction from one address to another (Within same Wallet). 
> > Q1. We found that the sent amount did not match the receiving amount. We 
> > this feature is a necessity, Could you please mention drawbacks of this 
> > approach? 
> > Q2. Is there any way that will return all Addresses generated under 
> > particular Wallet? 
> > 
> > -- 
> > 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 bitc...@googlegroups.com  
> > <mailto:bitc...@googlegroups.com >. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/bitcoinj/52da624b-9b97-471f-8cdb-29f47ff95bae%40googlegroups.com
>  
> > <
> https://groups.google.com/d/msgid/bitcoinj/52da624b-9b97-471f-8cdb-29f47ff95bae%40googlegroups.com?utm_medium=email_source=footer>.
>  
>
> > 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bitcoinj/6216c348-1818-461c-a894-09a4768b5dfe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Issue for send from one address to another Within same Wallet

2019-07-04 Thread Kunal Ransing
We have a wallet that has many testnet addresses, We tried performing a 
"Send" Transaction from one address to another (Within same Wallet).
Q1. We found that the sent amount did not match the receiving amount. We 
this feature is a necessity, Could you please mention drawbacks of this 
approach?
Q2. Is there any way that will return all Addresses generated under 
particular Wallet?

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bitcoinj/52da624b-9b97-471f-8cdb-29f47ff95bae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Issue for send from one address to another Within same Wallet

2019-07-04 Thread Kunal Ransing
Hi,
We have a wallet that has many testnet addresses, We tried performing a 
"Send" Transaction from one address to another (Within same Wallet).
Q. We found that the sent amount did not match the receiving amount. We 
this feature is a necessity, 
Could you please mention drawbacks of this approach?

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bitcoinj/e28a220e-a83e-4d6f-8ae2-edf4642b3144%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Restore from seed wallet balance is 0

2019-03-22 Thread Kunal Ransing
Hi,
Have you solved problem ? I am using version *0.15. and I am also getting 
balance 0.*

@Andreas Schildbach  Problem with 0.15?  A year ago I worked with 0.14.4 & 
working fine. 

On Sunday, 10 March 2019 12:03:58 UTC+5:30, jh...@seekerslab.com wrote:
>
> and lost every path when restore from seed...
>
>
> what happens?
>

-- 
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: How to get notification one receiving coins after 6 confirmations

2018-01-22 Thread Kunal Ransing
Hi,

Please check below code:

kit.wallet().addCoinsReceivedEventListener(new 
WalletCoinsReceivedEventListener() {
  @Override
  public void onCoinsReceived(Wallet w, final Transaction tx, 
Coin prevBalance, Coin newBalance) {
  
  Futures.addCallback(tx.getConfidence().getDepthFuture(*6*), 
new FutureCallback() {
  @Override
  public void onSuccess(TransactionConfidence result) 
  {
  //Updated tx status to confirm when depth become 
6 block
  }

  @Override
  public void onFailure(Throwable t) {
  // This kind of future can't fail, just rethrow 
in case something weird happens.
  //throw new RuntimeException(t);
  }
  });
  
  }
  });

On Thursday, 18 January 2018 00:06:43 UTC+5:30, v e wrote:
>
> Hi,
>
> I am new to bitcoinJ library and looking to notify some listener when i 
> get a particular transaction confirmed.Here is my code so far
>
> receiverW.wallet.addCoinsReceivedEventListener(new 
> WalletCoinsReceivedEventListener() {
> public void onCoinsReceived(Wallet wallet, Transaction tx, Coin coin, 
> Coin coin1) {
> tx.getConfidence();
> System.out.println("-> coins resceived: " + tx.getHashAsString());
> System.out.println("received: " + tx.getValue(wallet));
> }
> });
>
> However, when i ran the code, the above method got invoked when the 
> transaction is placed in the block but not when it is confirmed.
>
>
> What logic do i need to add for confirmation of the transaction?
>
>
> thanks
>
>

-- 
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.


Is it possible to figure out whether two addresses are in the same wallet?

2017-12-14 Thread Kunal Ransing
Hi,

I am using bitcoinj-core-0.14.5.
I am creating addresses for my users using below:
kit.wallet().freshReceiveAddress().toString();

Now I want to avoid user's sending coin to another user's address that 
belongs to my wallet.
How we can identify that both addresses belong to my wallet?

Thanks.

-- 
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: bitcoinj-0.14 : wallet backup - proper way ?

2017-07-14 Thread Kunal Ransing
Hi,

Thanks for reply.
I got mnemonicCode by below:

kit.wallet().decrypt(---key--);
DeterministicSeed seed = kit.wallet().getKeyChainSeed();
LOGGER.info("PayConfig_backupWalletToMnemonicSeed: Seed=" + 
seed.toString());

LOGGER.info("PayConfig_backupWalletToMnemonicSeed: Creation time= " 
+ seed.getCreationTimeSeconds());
LOGGER.info("PayConfig_backupWalletToMnemonicSeed: mnemonicCode= " 
+ Joiner.on(" ").join(seed.getMnemonicCode()));
kit.wallet().encrypt("--key-");

mnemonicCode is plain collection of words like "yard impulse luxury drive 
today throw farm pepper survey wreck glass federal"

Q1. How to keep this secure ? keep mnemonicCode in encrypted form ?
Q2. I tried to run RestoreFromSeed which given in sample examples. It is 
running from last 4-5 hours. How much time required to restore wallet ?





On Thursday, 13 July 2017 19:55:38 UTC+5:30, Anton wrote:
>
> you can call `wallet.getKeyChainSeed` while it's decrypted and then 
> something like `TextUtils.join("\u0020", seed.getMnemonicCode)` to get a 
> readable mnemonic.
>

-- 
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: bitcoinj-0.14 : wallet backup - proper way ?

2017-07-13 Thread Kunal Ransing
Hi,

Thanks for reply.
I am using WalletAppKit & my wallet is encrypted. How to do 
this WalletAppKit ?

On Thursday, 13 July 2017 17:29:13 UTC+5:30, Anton wrote:
>
> Why not just save a BIP39 mnemonic once instead of constant backups? 
> bitcoinj supports that.
>

-- 
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.


bitcoinj 0.14.4 : Send coin - get callback in receiveCoin too

2017-07-10 Thread Kunal Ransing
Hi

When I send coins I got callback in broadcastComplete as well 
as onCoinsReceived.

I added receive listner as below:

  // We want to know when we receive money.
  kit.wallet().*addCoinsReceivedEventListener*(new 
*WalletCoinsReceivedEventListener*() {
  @Override
  public void *onCoinsReceived*(Wallet w, final Transaction tx, 
Coin prevBalance, Coin newBalance) {
  Coin value = tx.getValueSentToMe(w);
 
  updateTxResult(tx, value, tx.getConfidence());
  
  Futures.addCallback(tx.getConfidence().getDepthFuture(6), 
new FutureCallback() {
  @Override
  public void onSuccess(TransactionConfidence result) 
  {
//Updated tx status to confirm when depth become 6 
block
  updateTxResult(tx, value,result);
  }

  });
  }
  });


I am sending coin using below method :
  ...
  Address to = Address.fromBase58("send-address");
  SendRequest req = SendRequest.to(to, Coin.parseCoin("0.003"));
  req.aesKey = kit.wallet().getKeyCrypter().deriveKey("--my_key--");
  req.memo = msg;
  Wallet.SendResult result = kit.wallet().sendCoins(req);
  Transaction btcTx = result.tx;
  Futures.addCallback(result.*broadcastComplete*, new 
FutureCallback() {
  @Override
  public void *onSuccess*(org.bitcoinj.core.Transaction resTx) 
  {
  //Send message to core that Mark tx as completed
  }

  @Override
  public void onFailure(Throwable t) {
LOGGER.log(Level.INFO,"PayConfig_sendCoin: Something went wrong 
!!!",t);
  }
  });
  ...

When I sent coin 0.003 BTC to my mobile wallet from my backend app, I 
receive 0.000812 BTC(i.e got call in *onCoinsReceivedfor all sent of 
different coin i receive this same amount*)...also got call in *onSuccess*  
where fees for sending coin is 0.000188 BTC.

Please help me to understand this ?

Regards,
Kunal



-- 
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.


ejb using bitcoinj 0.14.4 try to re-deploy throw OverlappingFileLockException with WalletAppKit

2017-06-28 Thread Kunal Ransing
Hi,

I am getting OverlappingFileLockException when I try to redeploy my ejb 
project. 
I initiated walletkit in Singleton bean. And on destroy of bean I added 
below lines in my code
kit.stopAsync();
kit.awaitTerminated();

I think old process still holding lock. So how to stop wallet so that it 
will unlock files ? Please help!

*Exception log: *
Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: 
Expected the service to be RUNNING, but the service has FAILED
at com.eno.bitcoin.PayConfig.init(PayConfig.java:193)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at 
org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptor.java:96)
at 
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at 
org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doLifecycleInterception(Jsr299BindingsInterceptor.java:114)
at 
org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:103)
at 
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at 
org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
at 
org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:73)
at 
org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83)
at 
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at 
org.jboss.as.weld.injection.WeldInjectionInterceptor.processInvocation(WeldInjectionInterceptor.java:53)
at 
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at 
org.jboss.as.ee.component.ManagedReferenceFieldInjectionInterceptorFactory$ManagedReferenceFieldInjectionInterceptor.processInvocation(ManagedReferenceFieldInjectionInterceptorFactory.java:107)
at 
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at 
org.jboss.as.ee.component.ManagedReferenceFieldInjectionInterceptorFactory$ManagedReferenceFieldInjectionInterceptor.processInvocation(ManagedReferenceFieldInjectionInterceptorFactory.java:107)
at 
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at 
org.jboss.as.ee.component.ManagedReferenceFieldInjectionInterceptorFactory$ManagedReferenceFieldInjectionInterceptor.processInvocation(ManagedReferenceFieldInjectionInterceptorFactory.java:107)
at 
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at 
org.jboss.as.ee.component.AroundConstructInterceptorFactory$1.processInvocation(AroundConstructInterceptorFactory.java:28)
at 
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at 
org.jboss.as.weld.injection.WeldInterceptorInjectionInterceptor.processInvocation(WeldInterceptorInjectionInterceptor.java:56)
at 
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at 
org.jboss.as.weld.ejb.Jsr299BindingsCreateInterceptor.processInvocation(Jsr299BindingsCreateInterceptor.java:100)
at 
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at 
org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
at 
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at 
org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:275)
... 27 more
Caused by: java.lang.IllegalStateException: Expected the service to be 
RUNNING, but the service has FAILED
at 
com.google.common.util.concurrent.AbstractService.checkCurrentState(AbstractService.java:285)
at 
com.google.common.util.concurrent.AbstractService.awaitRunning(AbstractService.java:229)
at 
com.google.common.util.concurrent.AbstractIdleService.awaitRunning(AbstractIdleService.java:151)
at com.eno.bitcoin.PayConfig.init(PayConfig.java:146)
... 57 more
*Caused by: java.io.IOException: org.bitcoinj.store.BlockStoreException: 
java.nio.channels.OverlappingFileLockException*
at org.bitcoinj.kits.WalletAppKit.startUp(WalletAppKit.java:354)
at 
com.google.common.util.concurrent.AbstractIdleService$2$1.run(AbstractIdleService.java:54)
at com.google.common.util.concurrent.Callables$3.run(Callables.java:95)
at java.lang.Thread.run(Thread.java:745)
*Caused by: org.bitcoinj.store.BlockStoreException: 
java.nio.channels.OverlappingFileLockException*
at org.bitcoinj.store.SPVBlockStore.(SPVBlockStore.java:131)
at 

Re: How to Start Debugging the start up of the Bitcoin Service in Java?

2017-06-27 Thread Kunal Ransing
Hi,

If its maven project then make sure you added bitcoinj dependency like 
below:
  

  org.bitcoinj
  bitcoinj-core
  0.14.4
  compile

  

If its simple java program then make sure to add required jars in 
classpath(For Eclipse : Project->Properties->Java Build 
Path->Libraries->Add Jars)
bitcoinj-core-0.14.4.jar
core-1.51.0.0.jar
protobuf-java-2.6.1.jar
com/google/guava/guava/18.0/guava-18.0.jar
com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar
net/jcip/jcip-annotations/1.0/jcip-annotations-1.0.jar
com/lambdaworks/scrypt/1.4.0/scrypt-1.4.0.jar
org/bitcoinj/orchid/1.2.1/orchid-1.2.1.jar
com/squareup/okhttp/okhttp/2.7.2/okhttp-2.7.2.jar
com/squareup/okio/okio/1.6.0/okio-1.6.0.jar
org/slf4j/slf4j-api/1.7.20/slf4j-api-1.7.20.jar

OR
You can use all combined jar : bitcoinj-core-0.14.4-bundled.jar 
(https://search.maven.org/remotecontent?filepath=org/bitcoinj/bitcoinj-core/0.14.4/bitcoinj-core-0.14.4-bundled.jar)

Check for more details: https://bitcoinj.github.io/




On Tuesday, 27 June 2017 13:10:30 UTC+5:30, Raj Krishnan V wrote:
>
> Hi there,
> I am new to both Java and Bitcoin, can you please help me to start working 
> with Bitcoinj from Eclipse IDE. I am getting "Error: Could not find or load 
> main class 
> " when I run the ForwardingService class.
>
> On Friday, June 2, 2017 at 7:58:28 PM UTC+5:30, BitCoinX3 wrote:
>>
>> Hi All,
>> I started running the ForwardingService class in the regTest mode and I 
>> am using a valid Bitcoin address,but I am getting this error
>> Version code of address did not match acceptable versions for network: 0 
>> not in [111, 196].
>> Can anyone please help here?
>> On Friday, June 2, 2017 at 5:43:53 PM UTC+5:30, BitCoinX3 wrote:
>>>
>>> Hi All,
>>> I am new to the Bitcoin ecosystem.
>>> I wanted to start Debugging the application to just get a hang of how 
>>> everything works.
>>> How to Set the Deub Configuration of the Bitcoin Project in Eclipse?
>>> I read the below link and I understood the basic flow, but I want to run 
>>> the Bitcoin Network from the Java Code Base.
>>> It would be great if someone can give me a starting point.
>>>
>>> https://bitcoinj.github.io/getting-started
>>>
>>

-- 
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: correct way for backend(ejb) application receive payment - freshReceiveAddress() vs Payment_Request

2017-06-25 Thread Kunal Ransing
Hi,

Thank you for useful response.
I will check PaymentSession way. It seems interesting.

Actually in case refund issue we need to keep merchant's payment at our 
side for some duration. Once user is satisfy with merchant service then we 
will forward their payment. I guess bitpay.com, coinbase,com etc. doing 
same.
We can encrypt wallet for safety, right ? Also we will back encrypted 
wallet file at some other place too.
We have our own servers which are PCI-DSS complaint. Also for other case we 
use Amazon host prvoider.
What do you suggest for such use case(i.e we need to hold some merchants 
amount for bad service case) ?



On Saturday, 24 June 2017 19:22:10 UTC+5:30, Andreas Schildbach wrote:
>
> First of all, I think it is a bad idea to keep the Bitcoins of your 
> users on a server. Many of such servers have been hacked in the past, or 
> simply taken over via their hosting provider. 
>
> The advantage of the BIP70 payment protocol is you can transmit the 
> payment directly, without the need for connectivity to the Bitcoin 
> network at the moment of payment. Also, you can transmit an amount, your 
> (the payees) identity and so on. 
>
> At the end of the day, it depends on your specific use case. 
>
> Bitcoinj supports the payment protocol via the 
> org.bitcoinj.protocols.payments.PaymentSession and .PaymentProtocol 
> classes. 
>
>
> On 06/24/2017 10:22 AM, Kunal Ransing wrote: 
> > Hi, 
> > 
> > I am developing java backend(ejb) application receive payment. So 
> > creating receive address for every payment request by 
> > kit.wallet().freshReceiveAddress().toString() & displaying that on web 
> > page in plain/QR format. 
> > But i read here about Create Payment request : 
> > https://en.bitcoin.it/wiki/Payment_Request 
> > Which is correct way for receiving payment ?  How to do Payment_Request 
> > using bitcoinj lib ? 
> > Please help! 
> > 
> > Regards, 
> > Kunal 
> > 
> > -- 
> > 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.


correct way for backend(ejb) application receive payment - freshReceiveAddress() vs Payment_Request

2017-06-24 Thread Kunal Ransing
Hi,

I am developing java backend(ejb) application receive payment. So creating 
receive address for every payment request by 
kit.wallet().freshReceiveAddress().toString() & displaying that on web page 
in plain/QR format.
But i read here about Create Payment request : 
https://en.bitcoin.it/wiki/Payment_Request
Which is correct way for receiving payment ?  How to do Payment_Request 
using bitcoinj lib ?
Please help!

Regards,
Kunal

-- 
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.


Correct usage of bitcoinj 0.14.4 for my backend(java ejb) application to receive money

2017-06-21 Thread Kunal Ransing
Hi,

I am new to bitcoin system. I am checking bitcoinj-0.14.4 library.
I want build simple java-web(servlet/jsp/html) & java-ejb (backend) 
application to receive money from user then later forward to our merchant.
*Please let me know if i'm doing it correct way !*
This will do following
1. java-web will request java-ejb to generate new address to receive money  
then java-web will display 
   that address(also QR code) on web/html page so that user will pay to 
that address using any wallet he has.

   >>For this at start of java-ejb (backend) load for first time we will 
load wallet ONCE with autosave then when every time we receive payment 
request then we will create receive address & display on html page. Correct 
*?*

2. When user pay by any other wallet then our java-ejb (backend) will know 
that payment made so that we will update
   our system.

   >>For this we will do below
// We want to know when we receive money.
walletAppKit.wallet().addCoinsReceivedEventListener(new 
WalletCoinsReceivedEventListener() {
@Override
public void onCoinsReceived()
{ 
//wait for 6 block confirmation
   //our system internal order status update... 
   //forward bitcoin LATER to our merchant after delivery is ok i.e 
user satisfied.
}   
Correct *?*

3. We have installed bitcoind,bitcoin-cli on our server with all block i.e 
its in sync..everyday sync.
   >> When we use "MainNetParams" then how we can use "our own node" using 
bitcoinj *?*

3. wallet file created by walletAppKit is at our internal server. 
   But we want to create that wallet is encrypt form & can read in code 
when using "KEY".
   >> Wallet.encrypt("password");  Do we have such method for for 
walletAppKit *?*

4. How to maintain backup of wallet ?
   >> Copy "wallet" file created by walletAppKit to some remote place 
everday is enough *?*

Very sorry for long questions.
*Please let me know if i'm doing it correct way !*
Thank you very much!

-- 
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.


bitcoinj:0.14.4 stuck at kit.awaitRunning() when using regtest mode

2017-06-21 Thread Kunal Ransing
Hi,

I am new to this.
I am trying to create test program to create new address to receive 
payment. It *works well with "testnet"* mode but when using "regtest" code 
stuck at  kit.awaitRunning().

For regtest mode before running code, I did below
>bitcoind -regtest -debug -daemon

After started program I can see "connections": 1 by  running "bitcoin-cli 
-regtest getinfo" but code just stuck at walletAppKit.awaitRunning().

Please check below code & *bitcoind log* 

public static void main(String[] args) {
> //System.setProperty("-Dbitcoinj.logging", "true");
> BriefLogFormatter.init();
> NetworkParameters params = RegTestParams.get();
> String filePrefix = "forwarding-service-regtest";
> 
> WalletAppKit kit = new WalletAppKit(params, *new File(".")*, 
> filePrefix);
> if (params == RegTestParams.get()) {
>  kit.connectToLocalHost();
> }
>
>  // Download the block chain and wait until it's done.
> kit.startAsync();
>* kit.awaitRunning(); //execution just stop here and for long 
> time..*
>
> List list = kit.wallet().getWatchedAddresses();
> if (list.size() < 2) {
> 
> kit.wallet().addWatchedAddress(kit.wallet().freshReceiveAddress());
> System.out.println("New address created");
> }
>
> System.out.println("You have " + list.size() + " addresses!");
> for (Address a: list) {
> System.out.println(a.toString());
> }
>
> String balance = kit.wallet().getBalance().toFriendlyString();
> System.out.println(balance);
> }
>


*bitcoind debug log* 

2017-06-21 13:42:38 Added connection peer=1
2017-06-21 13:42:38 connection from 127.0.0.1:52972 accepted
2017-06-21 13:42:38 received: version (103 bytes) peer=1
2017-06-21 13:42:38 sending version (102 bytes) peer=1
2017-06-21 13:42:38 send version message: version 70015, blocks=101, 
us=[::]:0, peer=1
2017-06-21 13:42:38 sending verack (0 bytes) peer=1
2017-06-21 13:42:38 receive version message: /bitcoinj:0.14.4/: version 
70001, blocks=0, us=127.0.0.1:18444, peer=1
2017-06-21 13:42:38 added time data, samples 2, offset +0 (+0 minutes)
2017-06-21 13:42:38 sending alert (168 bytes) peer=1
2017-06-21 13:42:38 received: verack (0 bytes) peer=1
2017-06-21 13:42:38 sending ping (8 bytes) peer=1
2017-06-21 13:42:38 received: filterload (1935 bytes) peer=1
2017-06-21 13:42:38 received: mempool (0 bytes) peer=1
2017-06-21 13:42:38 received: getheaders (3269 bytes) peer=1
2017-06-21 13:42:38 Ignoring getheaders from peer=1 because node is in 
initial block download
2017-06-21 13:42:38 received: pong (8 bytes) peer=1
2017-06-21 13:42:40 received: ping (8 bytes) peer=1
2017-06-21 13:42:40 sending pong (8 bytes) peer=1
2017-06-21 13:42:42 received: ping (8 bytes) peer=1
2017-06-21 13:42:42 sending pong (8 bytes) peer=1
2017-06-21 13:42:44 received: ping (8 bytes) peer=1
2017-06-21 13:42:44 sending pong (8 bytes) peer=1
2017-06-21 13:42:46 received: ping (8 bytes) peer=1
2017-06-21 13:42:46 sending pong (8 bytes) peer=1
2017-06-21 13:42:48 received: ping (8 bytes) peer=1
2017-06-21 13:42:48 sending pong (8 bytes) peer=1
2017-06-21 13:42:50 received: ping (8 bytes) peer=1
2017-06-21 13:42:50 sending pong (8 bytes) peer=1
2017-06-21 13:42:52 received: ping (8 bytes) peer=1
2017-06-21 13:42:52 sending pong (8 bytes) peer=1
2017-06-21 13:42:54 received: ping (8 bytes) peer=1
2017-06-21 13:42:54 sending pong (8 bytes) peer=1
2017-06-21 13:42:56 received: ping (8 bytes) peer=1
2017-06-21 13:42:56 sending pong (8 bytes) peer=1
2017-06-21 13:42:58 received: ping (8 bytes) peer=1
2017-06-21 13:42:58 sending pong (8 bytes) peer=1
2017-06-21 13:43:00 received: ping (8 bytes) peer=1
2017-06-21 13:43:00 sending pong (8 bytes) peer=1
---same message-


 Please help me to solve this.
 Thanks

-- 
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.