forked from FellowTraveler/Open-Transactions-old
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathINSTALL-Windows.txt
434 lines (259 loc) · 15.8 KB
/
INSTALL-Windows.txt
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
OpenTransactions for WINDOWS
--- Open Transactions is currently built on:
- Windows 7 using MS Visual C++ 2010 Express.
- Mac OS X 10.7.1 (Lion) using XCode as well as gcc
- Linux Ubuntu 2.6.32 and FreeBSD using g++/gcc.
- Android 8 using NDK.
--- OpenSSL version 1.0.0a (at least) is necessary, since the SAMY hash uses WHRLPOOL. (XOR'd with SHA-512.) WHIRLPOOL is a new addition to OpenSSL.
Currently OpenSSL is up to 1.0.0d.
--- Let me know if there are any problems, since this is new software; this will be a living document.
FOR MICROSOFT WINDOWS:
1) I used Microsoft Visual C++ 2010 Express, which is free, to build Open Transactions on Windows 7.
------------
2) Windows transport should now be operational since switching to the ZeroMQ library.
------------
3) I had to install OpenSSL for Windows, (version 1.0.0 at least is necessary for Open Transactions to function properly.) The download page is here:
http://www.slproweb.com/products/Win32OpenSSL.html
(I found it by looking here: http://www.openssl.org/related/binaries.html)
The specific OpenSSL version that I installed was this one:
Win32 OpenSSL v1.0.0d (32 BIT)
http://www.slproweb.com/download/Win32OpenSSL-1_0_0d.exe
Win64 OpenSSL v1.0.0d (64 BIT)
http://www.slproweb.com/download/Win64OpenSSL-1_0_0d.exe
There may be errors when using OpenSSL stemming from missing redistributables.
If so, you can download them here:
32 bit x86 Visual C++ 2008 redistributable DLLs:
http://www.microsoft.com/downloads/details.aspx?familyid=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF
64 bit x64 Visual C++ 2008 redistributable DLLs (x64):
http://www.microsoft.com/downloads/details.aspx?familyid=bd2a6171-e2d6-4230-b809-9a8d7548c1b6
-----------------------
IMPORTANT: While the default install folder for OpenSSL is:
"C:\OpenSSL-Win32", DO NOT USE THIS LOCATION!
I HAVE INSTEAD INSTALLED IT HERE: "C:\~\OpenSSL-Win32"
(This is at the request of our only known Windows developer. Notice the TILDE character in that path!)
THEREFORE, make sure you install OpenSSL to that folder, again: C:\~\OpenSSL-Win32
...since that is where the project will assume that it can be found. If you prefer to install to the default location, be warned that you need to update the path in various project files in order for it to work.
IF YOU ARE USING 64-BIT WINDOWS, AGAIN, I HAVE NOT TESTED ON THAT PLATFORM.
PRESUMABLY, YOU WOULD STILL NEED TO NAME THE FOLDER "OpenSSL-Win32" SINCE
THE PROJECT FILE LOOKS IN THAT LOCATION. (YOU CAN ALWAYS EDIT THE PROJECT
FILE TO CHANGE IT.)
---------------------------------------------------------------
INSTALL: MsgPack Library (data packing library now used by OT.)
Available here: msgpack.org
To install from command line: port install msgpack
(OR) brew install msgpack
Install instructions for all platforms:
http://wiki.msgpack.org/display/MSGPACK/QuickStart+for+C+Language
Install to: C:\~\msgpack\
(VC++ Project files expect it to be there.)
Before building msgpack, go to the project properties (release mode),
Configuration projects, C/C++, Code Generation, and set the Runtime
library to Multi-threaded (/MT).
(OT defaults to release mode, so make sure you build this in release mode also.)
---------------------------------------------------------------
INSTALL: Google's Protocol Buffers library (another data packer.)
Available here:
http://code.google.com/p/protobuf/downloads/list
I used this one:
http://protobuf.googlecode.com/files/protobuf-2.4.1.zip
Install to: C:\~\protobuf\
(VC++ Project files expect it to be there.)
(OT defaults to release mode, so make sure you build this in release mode also.)
Before building protobuf, go to the project properties (release mode),
Configuration projects, C/C++, Code Generation, and set the Runtime
library to Multi-threaded (/MT).
---------------------------------------------------------------
INSTALL: ZeroMQ (transport library)
Available here:
http://www.zeromq.org/intro:get-the-software
Install to: C:\~\zeromq\
(VC++ Project files expect it to be there.)
To build ZMQ, the Windows project files are here:
C:\~\zeromq\builds\msvc\libzmq
(OT defaults to release mode, so make sure you build this in release mode also.)
Before building protobuf, go to the project properties (release mode),
Configuration projects, C/C++, Code Generation, and set the Runtime
library to Multi-threaded (/MT).
---------------------------------------------------------------
INSTALL: Chaiscript (scripting library)
Available here:
http://www.chaiscript.com/
---------------------------------------------------------------
4) Then I had to download these header files:
http://code.google.com/p/msinttypes/downloads/detail?name=msinttypes-r26.zip&can=2&q=
Once you download the header files, unzip them so that they appear in your C:\~\OpenSSL-Win32\include folder, (and this path is specified in the OTLib project, so make sure you use the same path.)
(Those were headers that are included in Unix but not Windows, so you just have to download them separately and put them into an include folder. That's what this step (4) does.)
------
YOU'RE BASICALLY DONE. Build OTLib, then CPP_API_Windows, then JNI_API_WINDOWS.
(Or build the testwallet if you prefer, but I prefer you use the Java API...)
---------------------------------------------------------------
JDK
ONE MORE THING: If you don't have the JDK for Windows, then the JNI_API_Windows project obviously won't build.
I installed it from here: http://jdk6.java.net/download.html
The JNI_API_Windows project file is configured to use various Java folders, such as this one:
C:\Program Files\Java\jdk1.6.0\include\win32
You may notice, after installing the JDK, that a build number is appended, like this:
C:\Program Files\Java\jdk1.6.0_27\include\win32
But again, Open-Transactions is looking for this:
C:\Program Files\Java\jdk1.6.0\include\win32
Therefore, it's best if you rename that folder after installing the JDK, so that the OT project file will be able to find it.
(Otherwise you'll need to edit the OT project file.)
BELOW ARE ONLY FOR MY NOTES:
------------
5) Then I created a Win32 command-line application and chose 'library' as the type.
(YOU DON'T HAVE TO WORRY ABOUT THIS STEP, since it's already done: I have included the project files with this distribution.)
FYI, then I copied all of the OTLib files into the new Win32 OTLib folder for my new project.
I also created Visual C++ projects for transaction and testwallet (the server and client.) I created them as normal command-line applications, and I copied the files of each to their respective folders and added to each project as appropriate.
------------
The idea is for you to use C:\~\Open-Transactions as your main folder. If you do that, all the paths are ALREADY set up for you correctly.
(Otherwise you'd have to search the project and fix them all, which is not a big deal if you prefer to do that.)
CONFIG FILES:
Any path corrections should be unnecessary if you install to
C:\~\Open-Transactions
but if you prefer to use different directories, you will have to fix the path in these locations:
On Windows, if you use the VC++ project files that I distributed, the paths are in these files:
Open-Transactions\testwallet\testwallet\testwallet.vcxproj
Open-Transactions\transaction\transaction\transaction.vcxproj
Open-Transactions\OTLib\OTLib\OTLib.vcxproj
-------------------
7) The VC++ projects should be set up with precompiled headers turned OFF.
(Under C/C++, click on Precompiled Headers and made sure I set "Precompiled Header" to "Not Using Precompiled Headers".)
NOTE: You should be able to use any good C++ compiler for Windows that you want to, as long as you get the right headers and libraries etc. But VC++ 2010 is what I used, since it was free.
------
8) OTLIB INCLUDE DIRECTORIES
Under VC++ Directories -> Include Directories, the value is set to:
(SEPARATED ONTO MULTIPLE LINES FOR READABILITY...)
C:\~\Open-Transactions\OTLib\Lucre;
C:\~\OpenSSL-Win32\include;
$(IncludePath)
(I added newlines to make it easier for you to decipher.) Make sure your own project includes the OpenSSL path and the Lucre path as appropriate for your system.
-----
9) DIRECTORIES for TESTWALLET (the client software)
The VC++ project for testwallet, under VC++ Directories -> Include Directories,
it is set to:
C:\~\OpenSSL-Win32\include;
C:\~\Open-Transactions\OTLib;
$(IncludePath)
Again, I added newlines above to make it easier to read. When I copied it, this was all on a single line.
Just underneath that are the Library Directories. Mine is set to:
C:\~\OpenSSL-Win32\lib\VC;
C:\~\Open-Transactions\OTLib\OTLib\Debug;
$(LibraryPath)
Notice a couple things. (1) the newlines again, you must remove those.
(2) I am specifying the OTLib\OTLib\Debug folder as part of the library path.
That's because so far I've only been coding in Debug Mode, so I had the
debug testwallet looking in the debug folder for the debug library (which
is statically linked.)
THE SAME IS TRUE ON THE SERVER SIDE.
Notice also that OpenSSL has to be on the "Include Library" path for each project.
-----
10) TESTWALLET LINKER SETTINGS
Here are the libraries I had to link against in order to get testwallet running:
Linker -> Input -> Additional Dependencies:
winmm.lib;wininet.lib;ws2_32.lib;libeay32MT.lib;ssleay32MT.lib;OTLib.lib;CPP_API_Windows.lib;%(AdditionalDependencies)
- winmm.lib is a windows library and ws2_32.lib is Winsock2.
- (OTLib is the Open Transactions library that testwallet needs to link against
for all the OT calls that it makes.)
- libeay32 is the OpenSSL crypto lib for Windows.
- ssleay32 is the OpenSSL SSL lib for Windows.
When you install OpenSSL, it puts a bunch of different versions of these static
libraries into the C:\~\OpenSSL-Win32\lib\VC folder. Each one is for a different
build...
The versions in C:\~\OpenSSL-Win32\lib\VC are static stubs, that actually load
DLLs (surprise!) But you still link to them statically.
The versions in C:\~\OpenSSL-Win32\lib\VC\static are the full static libs,
that do NOT load DLLs, and they are considerably larger.
The suffixes stand for:
MT multi-threaded, standard C run-time libraries are statically linked.
MTd multi-threaded, standard C run-time libraries are statically linked, debug version.
MD multi-threaded, standard C run-time libraries are dynamically linked.
MDd multi-threaded, standard C run-time libraries are dynamically linked, debug version.
These have to match your project. Remember, this has nothing to do with whether
your project itself is statically or dynamically linked. Rather, it has to do with
whether the C-runtime libs used by your project are statically or dynamically linked.
If your project has the /MD flag, then you must link to the MD version of OpenSSL,
and if you project has the /MTd flag (again, for C runtime libs) then you must
link to the MTd version of OpenSSL.
*************
OPTIONAL: HIGH-LEVEL API -- Now available in C++ and Java!!
Notice there are a few extra folders in Open-Transactions\testwallet:
CPP_API_Windows
JNI_API_Windows
Each contains an MS Visual Studio 2010 Express project. Description:
CPP_API_Windows -- Build this first. It's the OT Library, but with the socket code
added as well as the high-level C++ interface. After you build it,
you can include the static lib it generates into any C++ project.
Just make sure you include OpenTransactions.h in your project.
JNI_API_Windows -- There is also a Java JNI interface. Build this next and it will create
the DLL. Then you can use OpenTransactionsJNI.java in your java projects,
and it will load the DLL as appropriate (make sure it's on the classpath.)
NOTE: You have to install the JDK for Windows in order to build this. It
uses jni.h which won't otherwise be on your machine.
Now you can include Open Transactions in your Java or C++ projects on Windows, with
a very easy, high-level interface. A trained monkey could do it!
-------
11) TRANSACTION
- transaction (the server) has the same "VC++ Directories -> Linker Input"
as testwallet does:
winmm.lib;ws2_32.lib;libeay32MTd.lib;ssleay32MTd.lib;OTLib.lib;%(AdditionalDependencies)
Also the include directories and library directories are the same:
- transaction's "VC++ Directories -> Include Directories":
C:\~\OpenSSL-Win32\include;C:\~\Open-Transactions\OTLib;$(IncludePath)
- Library Directories:
C:\~\OpenSSL-Win32\lib\VC;C:\~\Open-Transactions\OTLib\Debug;$(LibraryPath)
Obviously you will have to edit these to make them appropriate for your own system.
---------
In addition the code is now littered with "#ifdef _WIN32" directives...
----------
Also in addition, the file:
Open-Transactions\transaction\transaction\applink.c
...was added as part of making OpenSSL functional. I'm sure it's the same version
of the file that you will have also with your own OpenSSL installation, so you won't
need to replace that file. But I still wanted to make a note of it for the install notes.
There are other files in that folder that will be necessary to build on Windows,
no matter which compiler you are using.
-----------
Open Transactions now works on Linux, Windows, and Mac!
I was actually running it in the DOS prompt, but the JNI will be where the real fun begins.
-------------
TO RUN:
The client and server expect to be run from the command line in their respective folders.
(Assuming you have already built the projects, including OTLib first.)
NOTE: Make sure you fix the paths in testwallet\wallet.xml and
transaction\notaryServer.xml
SERVER
to enter the right folder: cd Open-Transactions\transaction
to run: .\transaction.exe
OR if you just built it in debug mode: .\Debug\transaction.exe
CLIENT
to enter the right folder: cd Open-Transactions\testwallet
to run: .\testwallet.exe
OR if you just built it in debug mode: .\Debug\testwallet.exe
You don't have to specify a hostname and port, because the server contract
already contains that information.
(In the server contract that comes with this test distribution,
the hostname is localhost and port is 7085.)
USING THE SOFTWARE:
I already created your user account. The password is test (always)
==> With the server, all you can do is watch the output as it runs.
==> But with the client, there is a command-line interface.
UNFORTUNATELY the command-line interface is nearly unusable on Windows.
(THE REASON this software was ported to Windows was so a Java developer
could get started on an Android client.)
**** READ: docs\CLIENT-COMMANDS.txt for a list of the Wallet's commands.
I will soon add that file to a help command inside the wallet.
You can create asset accounts, issue new asset types,
transfer assets, get inbox, process inbox,
withdraw cash, deposit cash, getcontract, getmint.
You can also create basket currencies and exchange between normal
asset accounts and basket accounts. (To the server it's just another
account type.) You can also write and deposit cheques, and withdraw
vouchers.
REMEMBER: If you move some assets, and you don't see the change show up in your
account, then you probably just need to type "get" (to get the latest copy of the
account after a change has just been made.) Another useful command is 'i' for
grabbing the inbox of any specific account. Then "get", and then "stat" to see
the balances change.
Obviously a nice client will do this automatically.
Let's organize to make a pretty GUI for various platforms, eh?
------------------------------------