Author

Topic: BitcoinJ Maven (Read 3115 times)

sr. member
Activity: 476
Merit: 250
April 12, 2012, 09:35:33 AM
#11
testnet rules from bitcoin-QT (satoshi client) have changed and those rules are only in 0.5-SNAPSHOT or in one of the upcoming 0.5 releases

Thanks for the help, tried that, but it still won't work (at least not consistently). Looks like it depends on the peer it connects to, sometimes it downloads 50k+ blocks and sometimes only 47k. Meh, I think I'll go with the way Jim uses.
hero member
Activity: 668
Merit: 501
April 12, 2012, 05:01:59 AM
#10
testnet rules from bitcoin-QT (satoshi client) have changed and those rules are only in 0.5-SNAPSHOT or in one of the upcoming 0.5 releases
legendary
Activity: 1708
Merit: 1066
April 12, 2012, 04:30:11 AM
#9
Hi vuce,

I do not know the status of testnet actually.  I do all my dev against the production network moving millis around.   You probably end up waiting longer for blocks to confirm but get your code exposed earlier to the vagaries of the network.

There is a pretty responsive google group for bitcoinj that might know.
https://groups.google.com/forum/?fromgroups#!forum/bitcoinj

Jim

sr. member
Activity: 476
Merit: 250
April 12, 2012, 03:58:35 AM
#8
Jim, just one more question, does the testnet work at all (I'm using bitcoinj 0.4, that's what's in the multibit pom also)? I get stuck with 7539 blocks to go... I'm guessing the change in the testnet difficulty rules might have something to do with that?
sr. member
Activity: 476
Merit: 250
April 10, 2012, 01:35:49 PM
#7
Hi vuce,

I see from your previous posts that you are working on a prototype for commitcoin.

Feel free to reuse any of the multibit code for the bitcoinj side of things if it saves you time. It is all MIT licence.
You might be interested in the MultiBitService for a bit of network abstraction or the various actions (it should be fairly clear from the name what they do. The ones with the Submit in are the ones that actually perform the task).

Jim

Went through the code, it will certainly come in handy. Cheers!
legendary
Activity: 1708
Merit: 1066
April 10, 2012, 05:10:44 AM
#6
Hi vuce,

I see from your previous posts that you are working on a prototype for commitcoin.

Feel free to reuse any of the multibit code for the bitcoinj side of things if it saves you time. It is all MIT licence.
You might be interested in the MultiBitService for a bit of network abstraction or the various actions (it should be fairly clear from the name what they do. The ones with the Submit in are the ones that actually perform the task).

Jim
sr. member
Activity: 476
Merit: 250
April 10, 2012, 04:53:41 AM
#5
your error message means that
Code:
SECNamedCurves.getByName("secp256k1")
returned null.

Propably you have the wrong BouncyCastle lib installed. the version used in BitcoinJ is 1.46 (see pom.xml)

you Sir are correct. Thanks a bunch!

MultiBit uses bitcoinj via Maven so you should be able to use the POM for the dependencies:

https://github.com/jim618/multibit/tree/v0.3

Note also that bitcoinj runs it's own repo so you need to have a couple of entries in for that.

There is quite a lot of 'packaging cruft' in that POM so let me know if you have any problems.

I have multibit pointing at the last stable release (0.4) but you might want to sit on the bleeding edge and go to 0.5-SNAPSHOT.

Will check it out, thank you so much!
legendary
Activity: 1708
Merit: 1066
April 10, 2012, 04:51:16 AM
#4
MultiBit uses bitcoinj via Maven so you should be able to use the POM for the dependencies:

https://github.com/jim618/multibit/tree/v0.3

Note also that bitcoinj runs it's own repo so you need to have a couple of entries in for that.

There is quite a lot of 'packaging cruft' in that POM so let me know if you have any problems.

I have multibit pointing at the last stable release (0.4) but you might want to sit on the bleeding edge and go to 0.5-SNAPSHOT.
hero member
Activity: 668
Merit: 501
April 10, 2012, 04:29:51 AM
#3
your error message means that
Code:
SECNamedCurves.getByName("secp256k1")
returned null.

Propably you have the wrong BouncyCastle lib installed. the version used in BitcoinJ is 1.46 (see pom.xml)
sr. member
Activity: 476
Merit: 250
April 10, 2012, 03:53:11 AM
#2
Tried putting the libraries together manually:

Code:
Exception in thread "main" java.lang.ExceptionInInitializerError
at myproject.Myproject.main(Myproject.java:33)
Caused by: java.lang.NullPointerException
at com.google.bitcoin.core.ECKey.(ECKey.java:53)
... 1 more
Java Result: 1

Myproject.java:33
Code:
ECKey key = new ECKey();

Any help would be much appreciated.
sr. member
Activity: 476
Merit: 250
April 10, 2012, 03:43:21 AM
#1
Does anyone know how to set this up so it'll work? Followed the instructions in the wiki but it won't collect dependencies...

Code:
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  4.0.0

  com.mycompany
  connectcoinm
  1.0-SNAPSHOT
  jar

  connectcoinm
  http://maven.apache.org

 
    UTF-8
 


 
   
     bitcoinj-release
     
     http://nexus.bitcoinj.org/content/repositories/releases
   

   
     bitcoinj-snapshot
     
     http://nexus.bitcoinj.org/content/repositories/snapshots
   

 


 
   
      junit
      junit
      3.8.1
      test
   

 
 
    com.google
    bitcoinj
    0.3
    compile
 

 



This is what I get:
Code:
Failed to execute goal on project connectcoinm: Could not resolve dependencies for project com.mycompany:connectcoinm:jar:1.0-SNAPSHOT: Failed to collect dependencies for [junit:junit:jar:3.8.1 (test), com.google:bitcoinj:jar:0.3 (compile)]: Failed to read artifact descriptor for com.google:bitcoinj:jar:0.3: Could not transfer artifact com.google:bitcoinj:pom:0.3 from/to bitcoinj-release (http://nexus.bitcoinj.org/content/repositories/releases): Failed to transfer file: http://nexus.bitcoinj.org/content/repositories/releases/com/google/bitcoinj/0.3/bitcoinj-0.3.pom. Return code is: 502, ReasonPhrase:Bad Gateway. -> [Help 1]
Jump to: