Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1XEh1i-0001AA-Mi for bitcoin-development@lists.sourceforge.net; Tue, 05 Aug 2014 15:51:50 +0000 Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of bitpay.com designates 209.85.213.182 as permitted sender) client-ip=209.85.213.182; envelope-from=jgarzik@bitpay.com; helo=mail-ig0-f182.google.com; Received: from mail-ig0-f182.google.com ([209.85.213.182]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1XEh1h-0008F7-EB for bitcoin-development@lists.sourceforge.net; Tue, 05 Aug 2014 15:51:50 +0000 Received: by mail-ig0-f182.google.com with SMTP id c1so1387238igq.3 for ; Tue, 05 Aug 2014 08:51:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=VEEAw3FI4KksFwfsWwT/fD4+JCDd6EGL/WMunONZH/o=; b=J5jUjWNiwjL/A626dEVnE+s1QTfpXpwpA/jFRa/GSEVymRf4RMWmgqRBmnMBCINVKb KmiFf7cS/kEbbBazOtnT3XdqhzfHffPW7c5IkxuP0La6Gct6mRq+ln8EC/gq7hP/I5SB JpoAStaNZysDdX7OiL5hLgoOPFN5YZwcgKob/kamnZjfeDk1DqsGkIp2/y0I+ztDEvYQ 8mUMKsGPJgjO+r/MtXwXEcCNRORJUNmZkWqXOB6pJ2DL15JRQ26rL6n2dqQB0GG/A+QB 67lfJyC2BJ0k3HSpG0evimrtSjepNfeCtCT6DlmVFZ3H++EJJAHrq6ktearibWZ2NGa+ juwQ== X-Gm-Message-State: ALoCoQlWVWRhL6WxpEpB6ueQ39nVHmuQv+Dg9O+8e/EhFxKQPLegFofwuFCMYWFviOiQk9DFdJw8 X-Received: by 10.42.178.133 with SMTP id bm5mr6477905icb.75.1407253556141; Tue, 05 Aug 2014 08:45:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.10.78 with HTTP; Tue, 5 Aug 2014 08:45:35 -0700 (PDT) In-Reply-To: References: From: Jeff Garzik Date: Tue, 5 Aug 2014 11:45:35 -0400 Message-ID: To: Mike Hearn Content-Type: multipart/alternative; boundary=90e6ba6e8d9052b66c04ffe3c0cb X-Spam-Score: -0.6 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record 1.0 HTML_MESSAGE BODY: HTML included in message -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-Headers-End: 1XEh1h-0008F7-EB Cc: Bitcoin Dev Subject: Re: [Bitcoin-development] How to create a pull tester JAR X-BeenThere: bitcoin-development@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 15:51:50 -0000 --90e6ba6e8d9052b66c04ffe3c0cb Content-Type: text/plain; charset=UTF-8 Thanks for posting that (and implicitly archiving the knowledge). Anything that makes test improvement easier is welcomed. On Tue, Aug 5, 2014 at 11:00 AM, Mike Hearn wrote: > I just checked in a change to bitcoinj git master that makes it much > easier to create a pull tester jar. Here are instructions for how to do it. > > You will need: > > - A Java Development Kit (JDK), version 6 or up should work. As Java 6 > was released eight years ago, this should not be a challenging requirement. > If you have a Mac just running "java" from the command line should give you > a GUI prompt to install it automatically. Otherwise apt-get or fetch the > latest from the interwebs. > > - Apache Maven. This is a rough equivalent of autotools, except it > does dependency resolution for you. Grab it from > http://maven.apache.org/download.cgi then unzip it and make sure the > bin directory is in your PATH. You may need to set the JAVA_HOME > environment variable if you installed Java to an odd place. > > - git > > Make sure you can run "javac" from the command line, then make sure you > can run "mvn", it should complain it can't find a POM (this is a build > config file) and not, say, that it can't find Java. > > Now grab bitcoinj from git master: > > git clone https://github.com/bitcoinj/bitcoinj.git > > ... and build .... > > cd bitcoinj > mvn -DskipTests package > > It will go off and download the libraries needed, compile, and create a > bundled executable JAR called core/target/pull-tests.jar. This is sort of > analogous to static linking in the Java world. It should be fast - expect a > full build plus downloads to take less than a minute. You can use it either > with the QA scripts in the bitcoin core qa/pull-tester directory or just > run things directly: > > ./bitcoind -regtest -connect=0.0.0.0 -listen -whitelist=127.0.0.1 > -datadir=/tmp/pulltester > java -jar core/target/pull-tests.jar > > It should go ahead and print lots of debug spew, then at the end say it's > happy. > > Let me know if you encounter any problems with this. > > Java JARs (which are just zip files renamed) are easily reproduced if you > use the same version of javac and the same bitcoinj version. The ZIP > container has timestamps, but unzipping them and simply diffing the files > between two builds should reveal no differences. I am happy to provide a > pull-tests.jar from my local machine if anyone would like to do this. > > > ------------------------------------------------------------------------------ > Infragistics Professional > Build stunning WinForms apps today! > Reboot your WinForms applications with our WinForms controls. > Build a bridge from your legacy apps to the future. > > http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk > _______________________________________________ > Bitcoin-development mailing list > Bitcoin-development@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bitcoin-development > > -- Jeff Garzik Bitcoin core developer and open source evangelist BitPay, Inc. https://bitpay.com/ --90e6ba6e8d9052b66c04ffe3c0cb Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks for posting that (and implicitly archiving the= knowledge).=C2=A0 Anything that makes test improvement easier is welcomed.=



On Tue, Aug 5, 2014 at 11:00 AM, Mike Hearn <mike@plan99.net><= /span> wrote:
I just checked in a change = to bitcoinj git master that makes it much easier to create a pull tester ja= r. Here are instructions for how to do it.

You will need:
  • A Java Development Kit (JDK= ), version 6 or up should work. As Java 6 was released eight years ago, thi= s should not be a challenging requirement. If you have a Mac just running &= quot;java" from the command line should give you a GUI prompt to insta= ll it automatically. Otherwise apt-get or fetch the latest from the interwe= bs.

  • Apache Maven. This is a rough equivalent of autotools, except = it does dependency resolution for you. Grab it from=C2=A0http://maven.apache.org/do= wnload.cgi then unzip it and make sure the bin directory is in your PAT= H. You may need to set the JAVA_HOME environment variable if you installed = Java to an odd place.

  • git
Make sure you can run "javac"= ; from the command line, then make sure you can run "mvn", it sho= uld complain it can't find a POM (this is a build config file) and not,= say, that it can't find Java.

Now grab bitcoinj from git master:

=

... and build ....

cd bitcoinj
mvn -DskipTests package

It will go off and download the libraries needed, compile, and create a bun= dled executable JAR called core/target/pull-tests.jar. This is sort of anal= ogous to static linking in the Java world. It should be fast - expect a ful= l build plus downloads to take less than a minute. You can use it either wi= th the QA scripts in the bitcoin core qa/pull-tester directory or just run = things directly:

./bitcoind -regte= st -connect=3D0.0.0.0 -listen -whitelist=3D127.0.0.1 -datadir=3D/tmp/pullte= ster
java -jar core/= target/pull-tests.jar

It should go ahead and print lots of debug spew, then a= t the end say it's happy.

Let me know if you e= ncounter any problems with this.

Java JARs (which = are just zip files renamed) are easily reproduced if you use the same versi= on of javac and the same bitcoinj version. The ZIP container has timestamps= , but unzipping them and simply diffing the files between two builds should= reveal no differences. I am happy to provide a pull-tests.jar from my loca= l machine if anyone would like to do this.

-----------------------------------------------------------------------= -------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gam= pad/clk?id=3D153845071&iu=3D/4140/ostg.clktrk
__________________= _____________________________
Bitcoin-development mailing list
Bitcoin-develo= pment@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitcoin-de= velopment




--
Jeff Garzik
Bitc= oin core developer and open source evangelist
BitPay, Inc. =C2=A0 =C2=A0= =C2=A0https://bitpay.com= / --90e6ba6e8d9052b66c04ffe3c0cb--