forked from FellowTraveler/Open-Transactions-old
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL-Mac-Linux-FreeBSD.txt
383 lines (234 loc) · 12 KB
/
INSTALL-Mac-Linux-FreeBSD.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
OpenTransactions for Mac OS X, Linux, and FreeBSD
--- Open Transactions is currently built on:
- Linux Ubuntu 2.6.32 and FreeBSD using g++/gcc.
- Mac OS X 10.7.1 (Lion) using XCode as well as gcc
- Windows 7 using MS Visual C++ 2010 Express.
- 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. (Current build is tested with 1.0.0d)
--- Let me know if there are any problems, since this is new software;
this will be a living document.
Install instructions (Wiki):
https://github.com/FellowTraveler/Open-Transactions/wiki/Install
For Troubleshooting notes:
https://github.com/FellowTraveler/Moneychanger/wiki/Troubleshooting
----------------------------------
PRE-BUILD:
--- Make sure OpenSSL 1.0.0d is installed, since earlier versions don't
have WHIRLPOOL and the software won't work without it.
To check your current version of OpenSSL, type: openssl version
* To upgrade on Mac: sudo port install openssl
If that doesn't work: sudo port install openssl-devel
* On Linux:
NOTE for 64-bit Linux: MAKE SURE you configure OpenSSL explicitly for 64-bit and for shared binaries, THEN re-build it. (OpenSSL does not come built with those options by default, on 64bit Linux.)
Again: For 64-bit Linux, run: "./configure -m64 shared" in the openssl folder BEFORE building OpenSSL 1.0.0, and then it should work when you build and run Open-Transactions.)
wget http://www.openssl.org/source/openssl-1.0.0d.tar.gz
tar -xf openssl-1.0.0d.tar.gz
cd openssl-1.0.0d
./config (SEE NOTE ABOVE: for you, this might be: ./configure -m64 shared)
make
sudo make install
* On FreeBSD (as root): cd /usr/ports/security/openssl/ && make install clean
--- cd Open-Transactions <=== ("THE MAIN FOLDER")
(See Troubleshooting doc on wiki for notes on how to use OpenSSL 1.0.0 with
Open-Transactions WITHOUT having to install it as your official system copy.)
---------------------------------------------------------------
JAVA MODE:
If you are planning to build in Java mode (to use the Java GUI aka "Moneychanger") then you will need to install the JDK.
-----------------------------
On Linux:
sudo apt-get install openjdk-6-jdk
sudo apt-get install openjdk-6-source
export JAVA_HOME=/usr/lib/jvm/java-6-openjdk
or: export JAVA_HOME=/usr/lib/jvm/openjdk-6-jdk
(Depending on which version of java you have installed. Just look and see what's there first.)
Also, to get it to find the missing libotapi.so, I needed to add a reference to the current directory:
export LD_LIBRARY_PATH=/usr/local/lib:.
-----------------------------
On Mac:
sudo port install openjdk6
---------------------------------------------------------------
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: Google's Protocol Buffers library (another data packer.)
Available here:
http://code.google.com/p/protobuf/downloads/list
------------------------------------------------------------------------
INSTALL: ZeroMQ (transport library)
Available here:
http://www.zeromq.org/intro:get-the-software
sudo port install zmq (OR)
sudo apt-get install zeromq
etc.
---------------------------------------------------------------
INSTALL: Chaiscript (scripting library)
Available here:
http://www.chaiscript.com/
---------------------------------------------------------------
XCode NOTES: These are old, and were moved to the bottom of this file.
Unless you know/care what Xcode is, then you can ignore them.
------------------------------------------------------------------------
DON'T WANT TO COMPILE OPEN-TRANSACTIONS YOUSELF?
Download pre-built binaries of Open-Transactions:
https://github.com/FellowTraveler/Open-Transactions/downloads
Download pre-built jar files of Moneychanger (GUI for OT):
https://github.com/FellowTraveler/Moneychanger/downloads
------------------------------------------------------------------------
BUILD INSTRUCTIONS
If you want to build everything yourself, use this command:
make (To build in C mode, for the OT command-line)
Or: make java (To build in Java mode, for the Moneychanger Java GUI)
Or: make PLATFORM=[darwin|linux|freebsd]
(Optional since it WILL try to auto-detect your operating system.)
Other build targets are tcp, debug, debugtcp, javadebug, and clean.
You can also build the API for several languages (python, ruby,
perl5, and php5) at the top level. For other languages, see the
below notes, as well as the testwallet/API-README.txt file. For
example:
make java
make javadebug
make python
make php5
make csharp
make ruby
Etc.
!!! For FreeBSD, make sure you have gmake installed, since the Makefiles won't
work with the default version of make. Once you install it, you can build
using these commands, depending on which options you prefer:
gmake
gmake PLATFORM=[darwin|linux|freebsd]
(Let it auto-detect. This option is only if you are desperate.)
IF THERE ARE ANY ISSUES WITH WRONG FOLDER, ETC, OPEN Open-Transactions/Makefile
AND CHECK OUT THE FOLDERS IN THERE; MAKE SURE THEY ARE CORRECT FOR YOUR SYSTEM.
If you "make java" you may need to make sure $JAVA_HOME is set.
==> SKIP DOWN TO THE "To Run" section to see how to run OT, now that it's built.
---------------------------------------------------------------
If you prefer to build all of the projects individually, they are below for
my notes. (But the above steps should be enough to take care of everything for
most people.)
--- Build the Library:
cd OTLib;
make PLATFORM=[darwin|linux|freebsd] [DYNAMIC_OTLIB=1]
output will be libOTLib.a
(The other projects/Makefiles will expect that library to be built.)
--- Build the server:
cd ../transaction;
make PLATFORM=[darwin|linux|freebsd] [TRANSPORT=ZMQ] [DYNAMIC_OTLIB=1]
--- Build the client:
cd ../testwallet;
make PLATFORM=[darwin|linux|freebsd] [TRANSPORT=ZMQ]
If you fail to use TRANSPORT=ZMQ, then OT will build in TCP/SSL mode,
instead of ZeroMQ mode. (You don't want that.)
Make sure you use DYNAMIC_OTLIB=1 whenever building OT for other languages.
For example, Java, Python, Ruby, etc. OT must be built in dynamic mode since
those languages load it as a DLL, or shared library.
---------------------------------------------------------------
With the above steps, the library, server, and test client are now built and ready to run.
--- OPTIONAL: Native APIs available for C, C++, C#, Obj-C, Java, Ruby, Python, Perl, Php, Lisp, etc.
cd Open-Transactions/testwallet; make clean;
make -f Makefile.API [TRANSPORT=ZMQ] PLATFORM=[darwin|linux|freebsd] LANGUAGE=[c|csharp|java|ruby|python|perl|php|tcl|lisp]
NOTE:
For some languages (Python) on some platforms (Linux) it might require that OTLib
is built with the variable DYNAMIC_OTLIB=1. So if you get a build error while building
the API, do this:
cd ../OTLib; make clean; make DYNAMIC_OTLIB=1; cd ../testwallet
(Now try to build your API interface again.)
More detailed notes in Open-Transactions/testwallet/API-README.txt
--------------------------------------------------------
** INSTALL, CONFIG FILES AND INI FILE **
In the "Open-Transactions" folder, type:
sudo make install
FYI, This copies transaction/transaction.exe to /usr/local/bin/ot_server,
and it copies testwallet/testwallet.exe to /usr/local/bin/ot
It also creates the ~/.ot folder, and copies the contents of ot-sample-data
into that folder.
Important configuration data is located in the various .cfg and .opt files
located in ~/.ot
(I suggest you check them out.)
--------------------------------------------------------
TO START THE SERVER
ot_server
It will probably ask you to enter a password and a path. Don't worry,
it gives clear instructions. Also see the INSTALL docs.
-----------------------------------
OT GUI (MONEYCHANGER)
To start Moneychanger, just double click the jar file.
Or type: java -jar JavaWrapper.jar
You will need to select the data folder for the client.
This is located in: ~/.ot/client_data
==> Make sure the Moneychanger lib folder is also there with the jar.
==> Also, make sure OT is built in java mode. If it's not, then go to
the Open-Transactions folder and type this:
make clean && make java
-----------------------------------
To use the OT COMMAND-LINE...
In a new shell, run the command-line utility like this:
ot -?
The instructions for using OT at the command-line will be provided.
(NOTE: for now, do not run multiple clients AT THE SAME TIME against
the SAME data folder!)
-----------------------------------
OT PROMPT
If you prefer to use the OT PROMPT, then type "ot" with NO ARGUMENTS,
and it will drop into the OT PROMPT, which looks like this: OT>
-----------------------------------
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.
**** READ: ~/.ot/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?
------------------------------------
------------------------------------------------------------------------
NOTE: These are old notes and I would be wary of, at least step 2.
XCode NOTES: (IGNORE this section if you aren't using XCode on Mac.)
It's better to just use the Makefile. But if you prefer to use the XCode
project files, then you need to fix the REDACTED inside those.
XCode project files are:
Open-Transactions/OTLib/OTLib.xcodeproj/project.pbxproj
Open-Transactions/testwallet/testwallet.xcodeproj/project.pbxproj
Open-Transactions/transaction/transaction.xcodeproj/project.pbxproj
Edit those three files and fix wherever it says REDACTED (it will be
a path -- just set it to whatever path is correct for your own system,
you will see what I mean.)
To search for all occurrences, use this command from the "main" folder:
fgrep -n REDACTED * */* */*/* */*/*/*
Make sure to replace the REDACTED (entire path) with whatever
path is appropriate for your system.
TWO more XCode notes:
1) The include path issue is addressed by changing:
Search Paths->Header Search Paths = "/opt/local/include" instead
of "/usr/local/include" (So you get the macports version of OpenSSL,
which is 1.0.0c, instead of the default version, which is 0.9.8)
2) You also have to change a couple links that the Mac system uses to
point at the "current" OpenSSL:
sudo rm /usr/lib/libcrypto.dylib
sudo ln -s /opt/local/lib/libcrypto.1.0.0.dylib /usr/lib/libcrypto.dylib
sudo rm /usr/lib/libssl.dylib
sudo ln -s /opt/local/lib/libssl.1.0.0.dylib /usr/lib/libssl.dylib
Now you should be good to go with XCode!
------------------------------------------------------------------------