summaryrefslogtreecommitdiff
path: root/00/add8d645f6da9b4c0aabeb0f1ba1bab4755159
blob: e80837c76e820d8c57d147f5da0ab5e76660475a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191]
	helo=mx.sourceforge.net)
	by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76)
	(envelope-from <mh.in.england@gmail.com>) id 1XEgDp-0001Rb-Bj
	for bitcoin-development@lists.sourceforge.net;
	Tue, 05 Aug 2014 15:00:17 +0000
Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of gmail.com
	designates 209.85.214.179 as permitted sender)
	client-ip=209.85.214.179; envelope-from=mh.in.england@gmail.com;
	helo=mail-ob0-f179.google.com; 
Received: from mail-ob0-f179.google.com ([209.85.214.179])
	by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128)
	(Exim 4.76) id 1XEgDo-0006AB-BE
	for bitcoin-development@lists.sourceforge.net;
	Tue, 05 Aug 2014 15:00:17 +0000
Received: by mail-ob0-f179.google.com with SMTP id wn1so768529obc.24
	for <bitcoin-development@lists.sourceforge.net>;
	Tue, 05 Aug 2014 08:00:10 -0700 (PDT)
MIME-Version: 1.0
X-Received: by 10.182.19.135 with SMTP id f7mr6514406obe.40.1407250810788;
	Tue, 05 Aug 2014 08:00:10 -0700 (PDT)
Sender: mh.in.england@gmail.com
Received: by 10.76.35.234 with HTTP; Tue, 5 Aug 2014 08:00:10 -0700 (PDT)
Date: Tue, 5 Aug 2014 17:00:10 +0200
X-Google-Sender-Auth: HdhZRoJBtfuPqC-HiVWrZ5Uoxeg
Message-ID: <CANEZrP1mU6iS6NRyK6iJtg4BEQ3nQRFc-dVwaOd+P_NFThqxjw@mail.gmail.com>
From: Mike Hearn <mike@plan99.net>
To: Bitcoin Dev <bitcoin-development@lists.sourceforge.net>
Content-Type: multipart/alternative; boundary=001a11c29966afe34e04ffe31cdf
X-Spam-Score: -0.5 (/)
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 FREEMAIL_FROM Sender email is commonly abused enduser mail provider
	(mh.in.england[at]gmail.com)
	-0.0 SPF_PASS               SPF: sender matches SPF record
	1.0 HTML_MESSAGE           BODY: HTML included in message
	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: 1XEgDo-0006AB-BE
Subject: [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: <bitcoin-development.lists.sourceforge.net>
List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/bitcoin-development>,
	<mailto:bitcoin-development-request@lists.sourceforge.net?subject=unsubscribe>
List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=bitcoin-development>
List-Post: <mailto:bitcoin-development@lists.sourceforge.net>
List-Help: <mailto:bitcoin-development-request@lists.sourceforge.net?subject=help>
List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/bitcoin-development>,
	<mailto:bitcoin-development-request@lists.sourceforge.net?subject=subscribe>
X-List-Received-Date: Tue, 05 Aug 2014 15:00:17 -0000

--001a11c29966afe34e04ffe31cdf
Content-Type: text/plain; charset=UTF-8

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.

--001a11c29966afe34e04ffe31cdf
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I just checked in a change to bitcoinj git master that mak=
es it much easier to create a pull tester jar. Here are instructions for ho=
w to do it.<div><br></div><div>You will need:</div><div><ul><li>A Java Deve=
lopment Kit (JDK), version 6 or up should work. As Java 6 was released eigh=
t years ago, this should not be a challenging requirement. If you have a Ma=
c just running &quot;java&quot; from the command line should give you a GUI=
 prompt to install it automatically. Otherwise apt-get or fetch the latest =
from the interwebs.<br>
<br></li><li>Apache Maven. This is a rough equivalent of autotools, except =
it does dependency resolution for you. Grab it from=C2=A0<a href=3D"http://=
maven.apache.org/download.cgi">http://maven.apache.org/download.cgi</a> the=
n 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 pla=
ce.<br>
<br></li><li>git</li></ul></div><div>Make sure you can run &quot;javac&quot=
; from the command line, then make sure you can run &quot;mvn&quot;, it sho=
uld complain it can&#39;t find a POM (this is a build config file) and not,=
 say, that it can&#39;t find Java.</div>
<div><br></div><div>Now grab bitcoinj from git master:</div><div><br></div>=
<div><font face=3D"courier new, monospace">git clone=C2=A0<a href=3D"https:=
//github.com/bitcoinj/bitcoinj.git">https://github.com/bitcoinj/bitcoinj.gi=
t</a></font></div>
<div><br></div><div>... and build ....</div><div><br></div><div><font face=
=3D"courier new, monospace">cd bitcoinj</font></div><div><font face=3D"cour=
ier new, monospace">mvn -DskipTests package</font></div><div><br></div><div=
>
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:</div>
<div><br></div><div><font face=3D"courier new, monospace">./bitcoind -regte=
st -connect=3D0.0.0.0 -listen -whitelist=3D127.0.0.1 -datadir=3D/tmp/pullte=
ster</font></div><div><font face=3D"courier new, monospace">java -jar core/=
target/pull-tests.jar</font></div>
<div><br></div><div>It should go ahead and print lots of debug spew, then a=
t the end say it&#39;s happy.</div><div><br></div><div>Let me know if you e=
ncounter any problems with this.</div><div><br></div><div>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.</div>
</div>

--001a11c29966afe34e04ffe31cdf--