Version 1.1.0.0 update

This commit is contained in:
transcoder
2014-02-12 04:09:36 -07:00
parent 58decdbca7
commit f03acc635f
481 changed files with 156398 additions and 57772 deletions

View File

@@ -28,7 +28,7 @@ DOXYFILE_ENCODING = UTF-8
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project.
PROJECT_NAME = Bitcoin
PROJECT_NAME = CasinoCoin
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
@@ -203,7 +203,7 @@ TAB_SIZE = 8
# For example adding "sideeffect=\par Side Effects:\n" will allow you to
# put the command \sideeffect (or @sideeffect) in the documentation, which
# will result in a user-defined paragraph with heading "Side Effects:".
# You can put \n's in the value part of an alias to insert newlines.
# You can put \n in the value part of an alias to insert newlines.
ALIASES =

47
doc/README.md Normal file
View File

@@ -0,0 +1,47 @@
CasinoCoin 0.8.x BETA
====================
Copyright (c) 2009-2013 Bitcoin Developers
Copyright (c) 2011-2013 CasinoCoin Developers
Distributed under the MIT/X11 software license, see the accompanying
file COPYING or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the [OpenSSL Toolkit](http://www.openssl.org/). This product includes
cryptographic software written by Eric Young ([eay@cryptsoft.com](mailto:eay@cryptsoft.com)), and UPnP software written by Thomas Bernard.
Intro
---------------------
CasinoCoin is a free open source peer-to-peer electronic cash system that is
completely decentralized, without the need for a central server or trusted
parties. Users hold the crypto keys to their own money and transact directly
with each other, with the help of a P2P network to check for double-spending.
Setup
---------------------
You need the Qt4 run-time libraries to run CasinoCoin-Qt. On Debian or Ubuntu:
`sudo apt-get install libqtgui4`
Unpack the files into a directory and run:
- bin/32/casinocoin-qt (GUI, 32-bit)
- bin/32/casinocoind (headless, 32-bit)
- bin/64/casinocoin-qt (GUI, 64-bit)
- bin/64/casinocoind (headless, 64-bit)
See the documentation at the [CasinoCoin Wiki](http://casinocoin.info)
for help and more information.
Other Pages
---------------------
- [Unix Build Notes](build-unix.md)
- [OSX Build Notes](build-osx.md)
- [Windows Build Notes](build-msw.md)
- [Coding Guidelines](coding.md)
- [Release Process](release-process.md)
- [Release Notes](release-notes.md)
- [Multiwallet Qt Development](multiwallet-qt.md)
- [Unit Tests](unit-tests.md)
- [Translation Process](translation_process.md)

View File

@@ -1,8 +1,7 @@
CasinoCoin 0.6 BETA
CasinoCoin 0.8.x BETA
Copyright (c) 2009-2012 Bitcoin Developers
Copyright (c) 2011-2012 Litecoin Developers
Copyright (c) 2013 CasinoCoin Developers
Copyright (c) 2009-2013 Bitcoin Developers
Copyright (c) 2011-2013 CasinoCoin Developers
Distributed under the MIT/X11 software license, see the accompanying
file COPYING or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in
@@ -22,16 +21,8 @@ Setup
-----
Unpack the files into a directory and run casinocoin-qt.exe.
If you have Microsoft Security Essentials, you need to add casinocoin-qt.exe to its
"Excluded processes" list. Microsoft Security Essentials->Settings tab,
select Excluded processes, press Add, select casinocoin-qt.exe, OK, Save changes.
CasinoCoin-Qt is the original CasinoCoin client and it builds the backbone of the network.
However, it downloads and stores the entire history of CasinoCoin transactions;
depending on the speed of your computer and network connection, the synchronization
process can take anywhere from a few hours to a day or more.
The software automatically finds other nodes to connect to. You can
enable Universal Plug and Play using a menu entry or set your firewall
to forward port 9333 (TCP) to your computer so you can receive
incoming connections. CasinoCoin works without incoming connections,
but allowing incoming connections helps the CasinoCoin network.
See the bitcoin wiki at:
https://en.bitcoin.it/wiki/Main_Page
for more help and information.

View File

@@ -1,19 +1,19 @@
TOR SUPPORT IN BITCOIN
======================
It is possible to run Bitcoin as a Tor hidden service, and connect to such services.
It is possible to run CasinoCoin as a Tor hidden service, and connect to such services.
The following assumes you have a Tor proxy running on port 9050. Many distributions
The following directions assume you have a Tor proxy running on port 9050. Many distributions
default to having a SOCKS proxy listening on port 9050, but others may not.
In particular, the Tor Browser Bundle defaults to listening on a random port. See
https://www.torproject.org/docs/faq.html.en#TBBSocksPort for how to properly
configure Tor.
1. Run bitcoin behind a Tor proxy
1. Run casinocoin behind a Tor proxy
---------------------------------
The first step is running Bitcoin behind a Tor proxy. This will already make all
The first step is running CasinoCoin behind a Tor proxy. This will already make all
outgoing connections be anonimized, but more is possible.
-socks=5 SOCKS5 supports connecting-to-hostname, which can be used instead
@@ -28,10 +28,6 @@ outgoing connections be anonimized, but more is possible.
need to set this if it's the same as -proxy. You can use -notor
to explicitly disable access to hidden service.
-dnsseed DNS seeds are not resolved directly when a SOCKS5 proxy server is
set. Rather, a short-lived proxy connection to the dns seed
hostname is attempted, and peer addresses are requested.
-listen When using -proxy, listening is disabled by default. If you want
to run a hidden service (see next section), you'll need to enable
it explicitly.
@@ -43,26 +39,26 @@ outgoing connections be anonimized, but more is possible.
In a typical situation, this suffices to run behind a Tor proxy:
./bitcoin -proxy=127.0.0.1:9050
./casinocoind -proxy=127.0.0.1:9050
2. Run a bitcoin hidden server
2. Run a casinocoin hidden server
------------------------------
If you configure your Tor system accordingly, it is possible to make your node also
reachable from the Tor network. Add these lines to your /etc/tor/torrc (or equivalent
config file):
HiddenServiceDir /var/lib/tor/bitcoin-service/
HiddenServicePort 9333 127.0.0.1:9333
HiddenServiceDir /var/lib/tor/casinocoin-service/
HiddenServicePort 47950 127.0.0.1:47950
The directory can be different of course, but (both) 9333's should be equal to your
bitcoind's P2P listen port (9333 by default).
The directory can be different of course, but (both) port numbers should be equal to
your casinocoind's P2P listen port (47950 by default).
-externalip=X You can tell bitcoin about its publicly reachable address using
-externalip=X You can tell casinocoin about its publicly reachable address using
this option, and this can be a .onion address. Given the above
configuration, you can find your onion address in
/var/lib/tor/bitcoin-service/hostname. Onion addresses are given
/var/lib/tor/casinocoin-service/hostname. Onion addresses are given
preference for your node to advertize itself with, for connections
coming from unroutable addresses (such as 127.0.0.1, where the
Tor proxy typically runs).
@@ -79,18 +75,18 @@ bitcoind's P2P listen port (9333 by default).
In a typical situation, where you're only reachable via Tor, this should suffice:
./bitcoind -proxy=127.0.0.1:9050 -externalip=57qr3yd1nyntf5k.onion -listen
./casinocoind -proxy=127.0.0.1:9050 -externalip=57qr3yd1nyntf5k.onion -listen
(obviously replace the Onion address with your own). If you don't care too much
(obviously, replace the Onion address with your own). If you don't care too much
about hiding your node, and want to be reachable on IPv4 as well, additionally
specify:
./bitcoind ... -discover
./casinocoind ... -discover
and open port 9333 on your firewall (or use -upnp).
and open port 47950 on your firewall (or use -upnp).
If you only want to use Tor to reach onion addresses, but not use it as a proxy
for normal IPv4/IPv6 communication, use:
./bitcoin -tor=127.0.0.1:9050 -externalip=57qr3yd1nyntf5k.onion -discover
./casinocoind -tor=127.0.0.1:9050 -externalip=57qr3yd1nyntf5k.onion -discover

View File

@@ -1,9 +1,8 @@
Code: src/strlcpy.h
Author: Todd C. Miller <Todd.Miller@courtesan.com>
License: ISC
Icon: src/qt/res/icons/clock*.png, src/qt/res/icons/tx*.png,
src/qt/res/src/*.svg
src/qt/res/src/clock_green.svg, src/qt/res/src/clock1.svg,
src/qt/res/src/clock2.svg, src/qt/res/src/clock3.svg,
src/qt/res/src/clock4.svg, src/qt/res/src/clock5.svg,
src/qt/res/src/inout.svg, src/qt/res/src/questionmark.svg
Designer: Wladimir van der Laan
License: MIT
@@ -29,6 +28,7 @@ Designer: md2k7
Site: https://bitcointalk.org/index.php?topic=15276.0
License: You are free to do with these icons as you wish, including selling,
copying, modifying etc.
License: MIT
Icon: src/qt/res/icons/configure.png, src/qt/res/icons/quit.png,
src/qt/res/icons/editcopy.png, src/qt/res/icons/editpaste.png,
@@ -38,23 +38,21 @@ Designer: http://www.everaldo.com
Icon Pack: Crystal SVG
License: LGPL
Icon: src/qt/res/icons/bitcoin.png, src/qt/res/icons/toolbar.png
Designer: BitcoinPorn (forum)
License: Public Domain
Site: https://bitcointalk.org/index.php?topic=47417.msg591988#msg591988
Icon: scripts/img/reload.xcf (modified),src/qt/res/movies/update_spinner.mng
Icon: scripts/img/reload.xcf (modified), src/qt/res/movies/update_spinner.mng
Icon Pack: Kids
Designer: Everaldo (Everaldo Coelho)
License: GNU/GPL
Site: http://findicons.com/icon/17102/reload?id=17102
Image: src/qt/res/images/splash2.jpg (Wallet image)
Designer: Crobbo (forum), adapted to CasinoCoin by BitcoinPorn (forum)
Site: https://bitcointalk.org/index.php?topic=32273.0, https://bitcointalk.org/index.php?topic=47417.msg591988#msg591988
License: Public domain
Icon: src/qt/res/icons/debugwindow.png
Designer: Vignoni David
Site: http://www.oxygen-icons.org/
License: Oxygen icon theme is dual licensed. You may copy it under the Creative Common Attribution-ShareAlike 3.0 License or the GNU Library General Public License.
Icon: src/qt/res/icons/bitcoin.icns, src/qt/res/src/bitcoin.svg,
src/qt/res/src/bitcoin.ico, src/qt/res/src/bitcoin.png,
src/qt/res/src/bitcoin_testnet.png, docs/bitcoin_logo_doxygen.png,
src/qt/res/icons/toolbar.png, src/qt/res/icons/toolbar_testnet.png,
src/qt/res/images/splash.png, src/qt/res/images/splash_testnet.png
Designer: Jonas Schnelli (based on the original bitcoin logo from Bitboy)
License: MIT

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

89
doc/build-msw.md Normal file
View File

@@ -0,0 +1,89 @@
Copyright (c) 2009-2013 Bitcoin Developers
Distributed under the MIT/X11 software license, see the accompanying
file COPYING or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the [OpenSSL Toolkit](http://www.openssl.org/). This product includes
cryptographic software written by Eric Young ([eay@cryptsoft.com](mailto:eay@cryptsoft.com)), and UPnP software written by Thomas Bernard.
See readme-qt.rst for instructions on building CasinoCoin-Qt, the
graphical user interface.
WINDOWS BUILD NOTES
===================
Compilers Supported
-------------------
TODO: What works?
Note: releases are cross-compiled using mingw running on Linux.
Dependencies
------------
Libraries you need to download separately and build:
default path download
OpenSSL \openssl-1.0.1c-mgw http://www.openssl.org/source/
Berkeley DB \db-4.8.30.NC-mgw http://www.oracle.com/technology/software/products/berkeley-db/index.html
Boost \boost-1.50.0-mgw http://www.boost.org/users/download/
miniupnpc \miniupnpc-1.6-mgw http://miniupnp.tuxfamily.org/files/
Their licenses:
OpenSSL Old BSD license with the problematic advertising requirement
Berkeley DB New BSD license with additional requirement that linked software must be free open source
Boost MIT-like license
miniupnpc New (3-clause) BSD license
Versions used in this release:
OpenSSL 1.0.1c
Berkeley DB 4.8.30.NC
Boost 1.50.0
miniupnpc 1.6
OpenSSL
-------
MSYS shell:
un-tar sources with MSYS 'tar xfz' to avoid issue with symlinks (OpenSSL ticket 2377)
change 'MAKE' env. variable from 'C:\MinGW32\bin\mingw32-make.exe' to '/c/MinGW32/bin/mingw32-make.exe'
cd /c/openssl-1.0.1c-mgw
./config
make
Berkeley DB
-----------
MSYS shell:
cd /c/db-4.8.30.NC-mgw/build_unix
sh ../dist/configure --enable-mingw --enable-cxx
make
Boost
-----
DOS prompt:
downloaded boost jam 3.1.18
cd \boost-1.50.0-mgw
bjam toolset=gcc --build-type=complete stage
MiniUPnPc
---------
UPnP support is optional, make with `USE_UPNP=` to disable it.
MSYS shell:
cd /c/miniupnpc-1.6-mgw
make -f Makefile.mingw
mkdir miniupnpc
cp *.h miniupnpc/
CasinoCoin
-------
DOS prompt:
cd \casinocoin\src
mingw32-make -f makefile.mingw
strip casinocoind.exe

185
doc/build-osx.md Normal file
View File

@@ -0,0 +1,185 @@
Mac OS X casinocoind build instructions
====================================
Authors
-------
* Laszlo Hanyecz <solar@heliacal.net>
* Douglas Huff <dhuff@jrbobdobbs.org>
* Colin Dean <cad@cad.cx>
* Gavin Andresen <gavinandresen@gmail.com>
License
-------
Copyright (c) 2009-2012 Bitcoin Developers
Distributed under the MIT/X11 software license, see the accompanying
file COPYING or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in
the OpenSSL Toolkit (http://www.openssl.org/).
This product includes cryptographic software written by
Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.
Notes
-----
See `doc/readme-qt.rst` for instructions on building CasinoCoin-Qt, the
graphical user interface.
Tested on OS X 10.5 through 10.8 on Intel processors only. PPC is not
supported because it is big-endian.
All of the commands should be executed in a Terminal application. The
built-in one is located in `/Applications/Utilities`.
Preparation
-----------
You need to install XCode with all the options checked so that the compiler
and everything is available in /usr not just /Developer. XCode should be
available on your OS X installation media, but if not, you can get the
current version from https://developer.apple.com/xcode/. If you install
Xcode 4.3 or later, you'll need to install its command line tools. This can
be done in `Xcode > Preferences > Downloads > Components` and generally must
be re-done or updated every time Xcode is updated.
There's an assumption that you already have `git` installed, as well. If
not, it's the path of least resistance to install [Github for Mac](https://mac.github.com/)
(OS X 10.7+) or
[Git for OS X](https://code.google.com/p/git-osx-installer/). It is also
available via Homebrew or MacPorts.
You will also need to install [Homebrew](http://mxcl.github.io/homebrew/)
or [MacPorts](https://www.macports.org/) in order to install library
dependencies. It's largely a religious decision which to choose, but, as of
December 2012, MacPorts is a little easier because you can just install the
dependencies immediately - no other work required. If you're unsure, read
the instructions through first in order to assess what you want to do.
Homebrew is a little more popular among those newer to OS X.
The installation of the actual dependencies is covered in the Instructions
sections below.
Instructions: MacPorts
----------------------
### Install dependencies
Installing the dependencies using MacPorts is very straightforward.
sudo port install boost db48@+no_java openssl miniupnpc
### Building `casinocoind`
1. Clone the github tree to get the source code and go into the directory.
git clone git@github.com:casinocoin-project/casinocoin.git casinocoin
cd casinocoin
2. Build casinocoind:
cd src
make -f makefile.osx
3. It is a good idea to build and run the unit tests, too:
make -f makefile.osx test
Instructions: HomeBrew
----------------------
#### Install dependencies using Homebrew
brew install boost miniupnpc openssl berkeley-db4
Note: After you have installed the dependencies, you should check that the Brew installed version of OpenSSL is the one available for compilation. You can check this by typing
openssl version
into Terminal. You should see OpenSSL 1.0.1e 11 Feb 2013.
If not, you can ensure that the Brew OpenSSL is correctly linked by running
brew link openssl --force
Rerunning "openssl version" should now return the correct version.
### Building `casinocoind`
1. Clone the github tree to get the source code and go into the directory.
git clone git@github.com:transcoder/CasinoCoin.git casinocoin
cd casinocoin
2. Modify source in order to pick up the `openssl` library.
Edit `makefile.osx` to account for library location differences. There's a
diff in `contrib/homebrew/makefile.osx.patch` that shows what you need to
change, or you can just patch by doing
patch -p1 < contrib/homebrew/makefile.osx.patch
3. Build casinocoind:
cd src
make -f makefile.osx
4. It is a good idea to build and run the unit tests, too:
make -f makefile.osx test
Creating a release build
------------------------
A casinocoind binary is not included in the CasinoCoin-Qt.app bundle. You can ignore
this section if you are building `casinocoind` for your own use.
If you are building `litecond` for others, your build machine should be set up
as follows for maximum compatibility:
All dependencies should be compiled with these flags:
-mmacosx-version-min=10.5 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk
For MacPorts, that means editing your macports.conf and setting
`macosx_deployment_target` and `build_arch`:
macosx_deployment_target=10.5
build_arch=i386
... and then uninstalling and re-installing, or simply rebuilding, all ports.
As of December 2012, the `boost` port does not obey `macosx_deployment_target`.
Download `http://gavinandresen-bitcoin.s3.amazonaws.com/boost_macports_fix.zip`
for a fix. Some ports also seem to obey either `build_arch` or
`macosx_deployment_target`, but not both at the same time. For example, building
on an OS X 10.6 64-bit machine fails. Official release builds of CasinoCoin-Qt are
compiled on an OS X 10.6 32-bit machine to workaround that problem.
Once dependencies are compiled, creating `CasinoCoin-Qt.app` is easy:
make -f Makefile.osx RELEASE=1
Running
-------
It's now available at `./casinocoind`, provided that you are still in the `src`
directory. We have to first create the RPC configuration file, though.
Run `./casinocoind` to get the filename where it should be put, or just try these
commands:
echo -e "rpcuser=casinocoinrpc\nrpcpassword=$(xxd -l 16 -p /dev/urandom)" > "/Users/${USER}/Library/Application Support/CasinoCoin/casinocoin.conf"
chmod 600 "/Users/${USER}/Library/Application Support/CasinoCoin/casinocoin.conf"
When next you run it, it will start downloading the blockchain, but it won't
output anything while it's doing this. This process may take several hours.
Other commands:
./casinocoind --help # for a list of command-line options.
./casinocoind -daemon # to start the casinocoin daemon.
./casinocoind help # When the daemon is running, to get a list of RPC commands

154
doc/build-unix.md Normal file
View File

@@ -0,0 +1,154 @@
Copyright (c) 2009-2013 Bitcoin Developers
Distributed under the MIT/X11 software license, see the accompanying
file COPYING or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the [OpenSSL Toolkit](http://www.openssl.org/). This product includes
cryptographic software written by Eric Young ([eay@cryptsoft.com](mailto:eay@cryptsoft.com)), and UPnP software written by Thomas Bernard.
UNIX BUILD NOTES
====================
To Build
---------------------
cd src/
make -f makefile.unix # Headless casinocoin
See readme-qt.rst for instructions on building CasinoCoin-Qt, the graphical user interface.
Dependencies
---------------------
Library Purpose Description
------- ------- -----------
libssl SSL Support Secure communications
libdb4.8 Berkeley DB Blockchain & wallet storage
libboost Boost C++ Library
miniupnpc UPnP Support Optional firewall-jumping support
[miniupnpc](http://miniupnp.free.fr/) may be used for UPnP port mapping. It can be downloaded from [here](
http://miniupnp.tuxfamily.org/files/). UPnP support is compiled in and
turned off by default. Set USE_UPNP to a different value to control this:
USE_UPNP= No UPnP support miniupnp not required
USE_UPNP=0 (the default) UPnP support turned off by default at runtime
USE_UPNP=1 UPnP support turned on by default at runtime
IPv6 support may be disabled by setting:
USE_IPV6=0 Disable IPv6 support
Licenses of statically linked libraries:
Berkeley DB New BSD license with additional requirement that linked
software must be free open source
Boost MIT-like license
miniupnpc New (3-clause) BSD license
- Versions used in this release:
- GCC 4.3.3
- OpenSSL 1.0.1c
- Berkeley DB 4.8.30.NC
- Boost 1.37
- miniupnpc 1.6
Dependency Build Instructions: Ubuntu & Debian
----------------------------------------------
Build requirements:
sudo apt-get install build-essential
sudo apt-get install libssl-dev
for Ubuntu 12.04:
sudo apt-get install libboost-all-dev
db4.8 packages are available [here](https://launchpad.net/~bitcoin/+archive/bitcoin).
Ubuntu precise has packages for libdb5.1-dev and libdb5.1++-dev,
but using these will break binary wallet compatibility, and is not recommended.
for other Ubuntu & Debian:
sudo apt-get install libdb4.8-dev
sudo apt-get install libdb4.8++-dev
sudo apt-get install libboost1.37-dev
(If using Boost 1.37, append -mt to the boost libraries in the makefile)
Optional:
sudo apt-get install libminiupnpc-dev (see USE_UPNP compile flag)
Notes
-----
The release is built with GCC and then "strip bitcoind" to strip the debug
symbols, which reduces the executable size by about 90%.
miniupnpc
---------
tar -xzvf miniupnpc-1.6.tar.gz
cd miniupnpc-1.6
make
sudo su
make install
Berkeley DB
-----------
You need Berkeley DB 4.8. If you have to build Berkeley DB yourself:
../dist/configure --enable-cxx
make
Boost
-----
If you need to build Boost yourself:
sudo su
./bootstrap.sh
./bjam install
Security
--------
To help make your casinocoin installation more secure by making certain attacks impossible to
exploit even if a vulnerability is found, you can take the following measures:
* Position Independent Executable
Build position independent code to take advantage of Address Space Layout Randomization
offered by some kernels. An attacker who is able to cause execution of code at an arbitrary
memory location is thwarted if he doesn't know where anything useful is located.
The stack and heap are randomly located by default but this allows the code section to be
randomly located as well.
On an Amd64 processor where a library was not compiled with -fPIC, this will cause an error
such as: "relocation R_X86_64_32 against `......' can not be used when making a shared object;"
To build with PIE, use:
make -f makefile.unix ... -e PIE=1
To test that you have built PIE executable, install scanelf, part of paxutils, and use:
scanelf -e ./casinocoin
The output should contain:
TYPE
ET_DYN
* Non-executable Stack
If the stack is executable then trivial stack based buffer overflow exploits are possible if
vulnerable buffers are found. By default, bitcoin should be built with a non-executable stack
but if one of the libraries it uses asks for an executable stack or someone makes a mistake
and uses a compiler extension which requires an executable stack, it will silently build an
executable without the non-executable stack protection.
To verify that the stack is non-executable after compiling use:
`scanelf -e ./casinocoin`
the output should contain:
STK/REL/PTL
RW- R-- RW-
The STK RW- means that the stack is readable and writeable but not executable.

94
doc/coding.md Normal file
View File

@@ -0,0 +1,94 @@
Coding
====================
Please be consistent with the existing coding style.
Block style:
bool Function(char* psz, int n)
{
// Comment summarising what this section of code does
for (int i = 0; i < n; i++)
{
// When something fails, return early
if (!Something())
return false;
...
}
// Success return is usually at the end
return true;
}
- ANSI/Allman block style
- 4 space indenting, no tabs
- No extra spaces inside parenthesis; please don't do ( this )
- No space after function names, one space after if, for and while
Variable names begin with the type in lowercase, like nSomeVariable.
Please don't put the first word of the variable name in lowercase like
someVariable.
Common types:
n integer number: short, unsigned short, int, unsigned int, int64, uint64, sometimes char if used as a number
d double, float
f flag
hash uint256
p pointer or array, one p for each level of indirection
psz pointer to null terminated string
str string object
v vector or similar list objects
map map or multimap
set set or multiset
bn CBigNum
-------------------------
Locking/mutex usage notes
The code is multi-threaded, and uses mutexes and the
LOCK/TRY_LOCK macros to protect data structures.
Deadlocks due to inconsistent lock ordering (thread 1 locks cs_main
and then cs_wallet, while thread 2 locks them in the opposite order:
result, deadlock as each waits for the other to release its lock) are
a problem. Compile with -DDEBUG_LOCKORDER to get lock order
inconsistencies reported in the debug.log file.
Re-architecting the core code so there are better-defined interfaces
between the various components is a goal, with any necessary locking
done by the components (e.g. see the self-contained CKeyStore class
and its cs_KeyStore lock for example).
-------
Threads
- StartNode : Starts other threads.
- ThreadGetMyExternalIP : Determines outside-the-firewall IP address, sends addr message to connected peers when it determines it.
- ThreadSocketHandler : Sends/Receives data from peers on port 8333.
- ThreadMessageHandler : Higher-level message handling (sending and receiving).
- ThreadOpenConnections : Initiates new connections to peers.
- ThreadTopUpKeyPool : replenishes the keystore's keypool.
- ThreadCleanWalletPassphrase : re-locks an encrypted wallet after user has unlocked it for a period of time.
- SendingDialogStartTransfer : used by pay-via-ip-address code (obsolete)
- ThreadDelayedRepaint : repaint the gui
- ThreadFlushWalletDB : Close the wallet.dat file if it hasn't been used in 500ms.
- ThreadRPCServer : Remote procedure call handler, listens on port 8332 for connections and services them.
- ThreadBitcoinMiner : Generates bitcoins
- ThreadMapPort : Universal plug-and-play startup/shutdown
- Shutdown : Does an orderly shutdown of everything
- ExitTimeout : Windows-only, sleeps 5 seconds then exits application

19
doc/files.txt Normal file
View File

@@ -0,0 +1,19 @@
Used in 0.8.0:
* wallet.dat: personal wallet (BDB) with keys and transactions
* peers.dat: peer IP address database (custom format); since 0.7.0
* blocks/blk000??.dat: block data (custom, 128 MiB per file); since 0.8.0
* blocks/rev000??.dat; block undo data (custom); since 0.8.0 (format changed since pre-0.8)
* blocks/index/*; block index (LevelDB); since 0.8.0
* chainstate/*; block chain state database (LevelDB); since 0.8.0
* database/*: BDB database environment; only used for wallet since 0.8.0
Only used in pre-0.8.0:
* blktree/*; block chain index (LevelDB); since pre-0.8, replaced by blocks/index/* in 0.8.0
* coins/*; unspent transaction output database (LevelDB); since pre-0.8, replaced by chainstate/* in 0.8.0
Only used before 0.8.0:
* blkindex.dat: block chain index database (BDB); replaced by {chainstate/*,blocks/index/*,blocks/rev000??.dat} in 0.8.0
* blk000?.dat: block data (custom, 2 GiB per file); replaced by blocks/blk000??.dat in 0.8.0
Only used before 0.7.0:
* addr.dat: peer IP address database (BDB); replaced by peers.dat in 0.7.0

52
doc/multiwallet-qt.md Normal file
View File

@@ -0,0 +1,52 @@
Multiwallet Qt Development and Integration Strategy
===================================================
In order to support loading of multiple wallets in bitcoin-qt, a few changes in the UI architecture will be needed.
Fortunately, only four of the files in the existing project are affected by this change.
Three new classes have been implemented in three new .h/.cpp file pairs, with much of the functionality that was previously
implemented in the BitcoinGUI class moved over to these new classes.
The two existing files most affected, by far, are bitcoingui.h and bitcoingui.cpp, as the BitcoinGUI class will require
some major retrofitting.
Only requiring some minor changes is bitcoin.cpp.
Finally, three new headers and source files will have to be added to bitcoin-qt.pro.
Changes to class BitcoinGUI
---------------------------
The principal change to the BitcoinGUI class concerns the QStackedWidget instance called centralWidget.
This widget owns five page views: overviewPage, transactionsPage, addressBookPage, receiveCoinsPage, and sendCoinsPage.
A new class called *WalletView* inheriting from QStackedWidget has been written to handle all renderings and updates of
these page views. In addition to owning these five page views, a WalletView also has a pointer to a WalletModel instance.
This allows the construction of multiple WalletView objects, each rendering a distinct wallet.
A second class called *WalletStack*, also inheriting from QStackedWidget, has been written to handle switching focus between
different loaded wallets. In its current implementation, as a QStackedWidget, only one wallet can be viewed at a time -
but this can be changed later.
A third class called *WalletFrame* inheriting from QFrame has been written as a container for embedding all wallet-related
controls into BitcoinGUI. At present it just contains a WalletStack instance and does little more than passing on messages
from BitcoinGUI to the WalletStack, which in turn passes them to the individual WalletViews. It is a WalletFrame instance
that takes the place of what used to be centralWidget in BitcoinGUI. The purpose of this class is to allow future
refinements of the wallet controls with minimal need for further modifications to BitcoinGUI, thus greatly simplifying
merges while reducing the risk of breaking top-level stuff.
Changes to bitcoin.cpp
----------------------
bitcoin.cpp is the entry point into bitcoin-qt, and as such, will require some minor modifications to provide hooks for
multiple wallet support. Most importantly will be the way it instantiates WalletModels and passes them to the
singleton BitcoinGUI instance called window. Formerly, BitcoinGUI kept a pointer to a single instance of a WalletModel.
The initial change required is very simple: rather than calling `window.setWalletModel(&walletModel);` we perform the
following two steps:
window.addWallet("~Default", &walletModel);
window.setCurrentWallet("~Default");
The string parameter is just an arbitrary name given to the default wallet. It's been prepended with a tilde to avoid name collisions in the future with additional wallets.
The shutdown call `window.setWalletModel(0)` has also been removed. In its place is now:
window.removeAllWallets();

View File

@@ -1,5 +1,5 @@
CasinoCoin-Qt: Qt4 GUI for CasinoCoin
================================
===============================
Build instructions
===================
@@ -8,13 +8,31 @@ Debian
-------
First, make sure that the required packages for Qt4 development of your
distribution are installed, for Debian and Ubuntu these are:
distribution are installed, these are
::
for Debian and Ubuntu <= 11.10 :
::
apt-get install qt4-qmake libqt4-dev build-essential libboost-dev libboost-system-dev \
libboost-filesystem-dev libboost-program-options-dev libboost-thread-dev \
libssl-dev libdb4.8++-dev
libssl-dev libdb4.8++-dev libminiupnpc-dev
for Ubuntu >= 12.04 (please read the 'Berkely DB version warning' below):
::
apt-get install qt4-qmake libqt4-dev build-essential libboost-dev libboost-system-dev \
libboost-filesystem-dev libboost-program-options-dev libboost-thread-dev \
libssl-dev libdb++-dev libminiupnpc-dev
For Qt 5 you need the following, otherwise you get an error with lrelease when running qmake:
::
apt-get install qt5-qmake libqt5gui5 libqt5core5 libqt5dbus5 qttools5-dev-tools
then execute the following:
@@ -27,45 +45,38 @@ Alternatively, install `Qt Creator`_ and open the `casinocoin-qt.pro` file.
An executable named `casinocoin-qt` will be built.
.. _`Qt Creator`: http://qt.nokia.com/downloads/
Windows
--------
Windows build instructions:
- Download the `Qt Windows SDK`_ and install it. You don't need the Symbian stuff, just the desktop Qt.
- Download and extract the `dependencies archive`_ [#]_, or compile openssl, boost and dbcxx yourself.
- Copy the contents of the folder "deps" to "X:\\QtSDK\\mingw", replace X:\\ with the location where you installed the Qt SDK. Make sure that the contents of "deps\\include" end up in the current "include" directory.
- Open the bitcoin-qt.pro file in Qt Creator and build as normal (ctrl-B)
.. _`Qt Windows SDK`: http://qt.nokia.com/downloads/sdk-windows-cpp
.. _`dependencies archive`: https://download.visucore.com/bitcoin/qtgui_deps_1.zip
.. [#] PGP signature: https://download.visucore.com/bitcoin/qtgui_deps_1.zip.sig (signed with RSA key ID `610945D0`_)
.. _`610945D0`: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x610945D0
.. _`Qt Creator`: http://qt-project.org/downloads/
Mac OS X
--------
- Download and install the `Qt Mac OS X SDK`_. It is recommended to also install Apple's Xcode with UNIX tools.
- Download and install `MacPorts`_.
- Download and install either `MacPorts`_ or `HomeBrew`_.
- Execute the following commands in a terminal to get the dependencies:
- Execute the following commands in a terminal to get the dependencies using MacPorts:
::
sudo port selfupdate
sudo port install boost db48 miniupnpc
- Open the bitcoin-qt.pro file in Qt Creator and build as normal (cmd-B)
- Execute the following commands in a terminal to get the dependencies using HomeBrew:
.. _`Qt Mac OS X SDK`: http://qt.nokia.com/downloads/sdk-mac-os-cpp
::
brew update
brew install boost miniupnpc openssl berkeley-db4
- If using HomeBrew, edit `casinocoin-qt.pro` to account for library location differences. There's a diff in `contrib/homebrew/bitcoin-qt-pro.patch` that shows what you need to change, or you can just patch by doing
patch -p1 < contrib/homebrew/bitcoin.qt.pro.patch
- Open the casinocoin-qt.pro file in Qt Creator and build as normal (cmd-B)
.. _`Qt Mac OS X SDK`: http://qt-project.org/downloads/
.. _`MacPorts`: http://www.macports.org/install.php
.. _`HomeBrew`: http://mxcl.github.io/homebrew/
Build configuration options
@@ -108,8 +119,8 @@ FreeDesktop notification interface through DBUS using the following qmake option
Generation of QR codes
-----------------------
libqrencode may be used to generate QRCode images for payment requests.
It can be downloaded from http://fukuchi.org/works/qrencode/index.html.en, or installed via your package manager. Pass the USE_QRCODE
libqrencode may be used to generate QRCode images for payment requests.
It can be downloaded from http://fukuchi.org/works/qrencode/index.html.en, or installed via your package manager. Pass the USE_QRCODE
flag to qmake to control this:
+--------------+--------------------------------------------------------------------------+

100
doc/release-notes.md Normal file
View File

@@ -0,0 +1,100 @@
1.1.0.0 changes
=============
Implemented the Kimoto Gravity Well algorithm (courtesy of @kimoto of Megacoin) for use in the difficulty adjustment in order to combat pool hopping.
Incorporated the following Litecoin changes below.
0.8.6.2 changes
=============
- Windows only: Fixes issue where network connectivity can fail.
- Cleanup of SSE2 scrypt detection.
- Minor fixes:
- s/Bitcoin/Litecoin/ in the Coin Control example
- Fix custom build on MacOS X 10.9
- Fix QT5 custom build
- Update Debian build instructions
- Update Homebrew build
0.8.6.1 changes
=============
- Coin Control - experts only GUI selection of inputs before you send a transaction
- Disable Wallet - reduces memory requirements, helpful for miner or relay nodes
- 20x reduction in default mintxfee.
- Up to 50% faster PoW validation, faster sync and reindexing.
- Peers older than protocol version 70002 are disconnected. 0.8.3.7 is the oldest compatible client.
- Internal miner added back to Litecoin. setgenerate now works, although it is generally a bad idea as it is significantly slower than external CPU miners.
- New RPC commands: getbestblockhash and verifychain
- Improve fairness of the high priority transaction space per block
- OSX block chain database corruption fixes
- Update leveldb to 1.13
- Use fcntl with `F_FULLSYNC` instead of fsync on OSX
- Use native Darwin memory barriers
- Replace use of mmap in leveldb for improved reliability (only on OSX)
- Fix nodes forwarding transactions with empty vins and getting banned
- Network code performance and robustness improvements
- Additional debug.log logging for diagnosis of network problems, log timestamps by default
- Fix rare GUI crash on send
0.8.5.1 changes
===============
Workaround negative version numbers serialization bug.
Fix out-of-bounds check (Litecoin currently does not use this codepath, but we apply this
patch just to match Bitcoin 0.8.5.)
0.8.4.1 changes
===============
CVE-2013-5700 Bloom: filter crash issue - Litecoin 0.8.3.7 disabled bloom by default so was
unaffected by this issue, but we include their patches anyway just in case folks want to
enable bloomfilter=1.
CVE-2013-4165: RPC password timing guess vulnerability
CVE-2013-4627: Better fix for the fill-memory-with-orphaned-tx attack
Fix multi-block reorg transaction resurrection.
Fix non-standard disconnected transactions causing mempool orphans. This bug could cause
nodes running with the -debug flag to crash, although it was lot less likely on Litecoin
as we disabled IsDust() in 0.8.3.x.
Mac OSX: use 'FD_FULLSYNC' with LevelDB, which will (hopefully!) prevent the database
corruption issues have experienced on OSX.
Add height parameter to getnetworkhashps.
Fix Norwegian and Swedish translations.
Minor efficiency improvement in block peer request handling.
0.8.3.7 changes
===============
Fix CVE-2013-4627 denial of service, a memory exhaustion attack that could crash low-memory nodes.
Fix a regression that caused excessive writing of the peers.dat file.
Add option for bloom filtering.
Fix Hebrew translation.

161
doc/release-process.md Normal file
View File

@@ -0,0 +1,161 @@
Release Process
====================
* * *
###update (commit) version in sources
casinocoin-qt.pro
contrib/verifysfbinaries/verify.sh
doc/README*
share/setup.nsi
src/clientversion.h (change CLIENT_VERSION_IS_RELEASE to true)
###tag version in git
git tag -a v0.8.0
###write release notes. git shortlog helps a lot, for example:
git shortlog --no-merges v0.7.2..v0.8.0
* * *
##perform gitian builds
From a directory containing the casinocoin source, gitian-builder and gitian.sigs
export SIGNER=(your gitian key, ie bluematt, sipa, etc)
export VERSION=0.8.0
cd ./gitian-builder
Fetch and build inputs: (first time, or when dependency versions change)
mkdir -p inputs; cd inputs/
wget 'http://miniupnp.free.fr/files/download.php?file=miniupnpc-1.6.tar.gz' -O miniupnpc-1.6.tar.gz
wget 'http://www.openssl.org/source/openssl-1.0.1c.tar.gz'
wget 'http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz'
wget 'http://zlib.net/zlib-1.2.6.tar.gz'
wget 'ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.5.9.tar.gz'
wget 'http://fukuchi.org/works/qrencode/qrencode-3.2.0.tar.bz2'
wget 'http://downloads.sourceforge.net/project/boost/boost/1.50.0/boost_1_50_0.tar.bz2'
wget 'http://releases.qt-project.org/qt4/source/qt-everywhere-opensource-src-4.8.3.tar.gz'
cd ..
./bin/gbuild ../casinocoin/contrib/gitian-descriptors/boost-win32.yml
mv build/out/boost-win32-1.50.0-gitian2.zip inputs/
./bin/gbuild ../casinocoin/contrib/gitian-descriptors/qt-win32.yml
mv build/out/qt-win32-4.8.3-gitian-r1.zip inputs/
./bin/gbuild ../casinocoin/contrib/gitian-descriptors/deps-win32.yml
mv build/out/casinocoin-deps-0.0.5.zip inputs/
Build casinocoind and casinocoin-qt on Linux32, Linux64, and Win32:
./bin/gbuild --commit casinocoin=v${VERSION} ../casinocoin/contrib/gitian-descriptors/gitian.yml
./bin/gsign --signer $SIGNER --release ${VERSION} --destination ../gitian.sigs/ ../casinocoin/contrib/gitian-descriptors/gitian.yml
pushd build/out
zip -r casinocoin-${VERSION}-linux-gitian.zip *
mv casinocoin-${VERSION}-linux-gitian.zip ../../
popd
./bin/gbuild --commit casinocoin=v${VERSION} ../casinocoin/contrib/gitian-descriptors/gitian-win32.yml
./bin/gsign --signer $SIGNER --release ${VERSION}-win32 --destination ../gitian.sigs/ ../casinocoin/contrib/gitian-descriptors/gitian-win32.yml
pushd build/out
zip -r casinocoin-${VERSION}-win32-gitian.zip *
mv casinocoin-${VERSION}-win32-gitian.zip ../../
popd
Build output expected:
1. linux 32-bit and 64-bit binaries + source (casinocoin-${VERSION}-linux-gitian.zip)
2. windows 32-bit binary, installer + source (casinocoin-${VERSION}-win32-gitian.zip)
3. Gitian signatures (in gitian.sigs/${VERSION}[-win32]/(your gitian key)/
repackage gitian builds for release as stand-alone zip/tar/installer exe
**Linux .tar.gz:**
unzip casinocoin-${VERSION}-linux-gitian.zip -d casinocoin-${VERSION}-linux
tar czvf casinocoin-${VERSION}-linux.tar.gz casinocoin-${VERSION}-linux
rm -rf casinocoin-${VERSION}-linux
**Windows .zip and setup.exe:**
unzip casinocoin-${VERSION}-win32-gitian.zip -d casinocoin-${VERSION}-win32
mv casinocoin-${VERSION}-win32/casinocoin-*-setup.exe .
zip -r casinocoin-${VERSION}-win32.zip bitcoin-${VERSION}-win32
rm -rf casinocoin-${VERSION}-win32
**Perform Mac build:**
OSX binaries are created by Gavin Andresen on a 32-bit, OSX 10.6 machine.
qmake RELEASE=1 USE_UPNP=1 USE_QRCODE=1 casinocoin-qt.pro
make
export QTDIR=/opt/local/share/qt4 # needed to find translations/qt_*.qm files
T=$(contrib/qt_translations.py $QTDIR/translations src/qt/locale)
python2.7 share/qt/clean_mac_info_plist.py
python2.7 contrib/macdeploy/macdeployqtplus Bitcoin-Qt.app -add-qt-tr $T -dmg -fancy contrib/macdeploy/fancy.plist
Build output expected: Bitcoin-Qt.dmg
###Next steps:
* Code-sign Windows -setup.exe (in a Windows virtual machine) and
OSX Bitcoin-Qt.app (Note: only Gavin has the code-signing keys currently)
* upload builds to SourceForge
* create SHA256SUMS for builds, and PGP-sign it
* update casinocoin.org version
make sure all OS download links go to the right versions
* update forum version
* update wiki download links
* update wiki changelog: [https://en.casinocoin.it/wiki/Changelog](https://en.bitcoin.it/wiki/Changelog)
Commit your signature to gitian.sigs:
pushd gitian.sigs
git add ${VERSION}/${SIGNER}
git add ${VERSION}-win32/${SIGNER}
git commit -a
git push # Assuming you can push to the gitian.sigs tree
popd
-------------------------------------------------------------------------
### After 3 or more people have gitian-built, repackage gitian-signed zips:
From a directory containing casinocoin source, gitian.sigs and gitian zips
export VERSION=0.5.1
mkdir casinocoin-${VERSION}-linux-gitian
pushd casinocoin-${VERSION}-linux-gitian
unzip ../casinocoin-${VERSION}-linux-gitian.zip
mkdir gitian
cp ../casinocoin/contrib/gitian-downloader/*.pgp ./gitian/
for signer in $(ls ../gitian.sigs/${VERSION}/); do
cp ../gitian.sigs/${VERSION}/${signer}/casinocoin-build.assert ./gitian/${signer}-build.assert
cp ../gitian.sigs/${VERSION}/${signer}/casinocoin-build.assert.sig ./gitian/${signer}-build.assert.sig
done
zip -r casinocoin-${VERSION}-linux-gitian.zip *
cp casinocoin-${VERSION}-linux-gitian.zip ../
popd
mkdir casinocoin-${VERSION}-win32-gitian
pushd casinocoin-${VERSION}-win32-gitian
unzip ../casinocoin-${VERSION}-win32-gitian.zip
mkdir gitian
cp ../casinocoin/contrib/gitian-downloader/*.pgp ./gitian/
for signer in $(ls ../gitian.sigs/${VERSION}-win32/); do
cp ../gitian.sigs/${VERSION}-win32/${signer}/casinocoin-build.assert ./gitian/${signer}-build.assert
cp ../gitian.sigs/${VERSION}-win32/${signer}/casinocoin-build.assert.sig ./gitian/${signer}-build.assert.sig
done
zip -r casinocoin-${VERSION}-win32-gitian.zip *
cp casinocoin-${VERSION}-win32-gitian.zip ../
popd
- Upload gitian zips to SourceForge
- Celebrate

View File

@@ -34,10 +34,12 @@ This directory contains all translations. Filenames must adhere to this format:
source for all other translations. Whenever a string in the code is changed
this file must be updated to reflect those changes. This can be accomplished
by running `lupdate` (included in the Qt SDK). Also, a custom script is used
to extract strings from the non-Qt parts:
to extract strings from the non-Qt parts. This script makes use of `gettext`,
so make sure that utility is installed (ie, `apt-get install gettext` on
Ubuntu/Debian):
python share/qt/extract_strings_qt.py
lupdate bitcoin-qt.pro -no-obsolete -locations none -ts src/qt/locale/bitcoin_en.ts
lupdate bitcoin-qt.pro -no-obsolete -locations relative -ts src/qt/locale/bitcoin_en.ts
##### Handling of plurals in the source file

35
doc/unit-tests.md Normal file
View File

@@ -0,0 +1,35 @@
Compiling/running casinocoind unit tests
------------------------------------
casinocoind unit tests are in the `src/test/` directory; they
use the Boost::Test unit-testing framework.
To compile and run the tests:
cd src
make -f makefile.unix test_casinocoin # Replace makefile.unix if you're not on unix
./test_casinocoin # Runs the unit tests
If all tests succeed the last line of output will be:
`*** No errors detected`
To add more tests, add `BOOST_AUTO_TEST_CASE` functions to the existing
.cpp files in the test/ directory or add new .cpp files that
implement new BOOST_AUTO_TEST_SUITE sections (the makefiles are
set up to add test/*.cpp to test_casinocoin automatically).
Compiling/running CasinoCoin-Qt unit tests
---------------------------------------
Bitcoin-Qt unit tests are in the src/qt/test/ directory; they
use the Qt unit-testing framework.
To compile and run the tests:
qmake bitcoin-qt.pro BITCOIN_QT_TEST=1
make
./casinocoin-qt_test
To add more tests, add them to the `src/qt/test/` directory,
the `src/qt/test/test_main.cpp` file, and bitcoin-qt.pro.