forked from MultiChain/multichain
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request MultiChain#85 from MultiChain/2.0-dev
2.0 beta 2
- Loading branch information
Showing
280 changed files
with
5,222 additions
and
876 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ MultiChain | |
|
||
[MultiChain](http://www.multichain.com/) is an open source platform for private blockchains, which offers a rich set of features including extensive configurability, rapid deployment, permissions management, native assets and data streams. Although it is designed to enable private blockchains, MultiChain provides maximal compatibility with the bitcoin ecosystem, including the peer-to-peer protocol, transaction/block formats and [Bitcoin Core](https://bitcoin.org/en/bitcoin-core/) APIs/runtime parameters. | ||
|
||
Copyright (c) 2014-2017 Coin Sciences Ltd | ||
Copyright (c) 2014-2019 Coin Sciences Ltd | ||
License: GNU General Public License version 3, see COPYING | ||
|
||
Portions copyright (c) 2009-2016 The Bitcoin Core developers | ||
|
@@ -24,22 +24,35 @@ Install dependencies | |
-------------------- | ||
|
||
sudo apt-get update | ||
sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils | ||
sudo apt-get install libboost-all-dev | ||
sudo apt-get install git | ||
sudo apt-get install software-properties-common | ||
sudo apt-get install -y software-properties-common | ||
sudo apt-get install -y build-essential libtool autotools-dev automake pkg-config libssl-dev git python python-pip | ||
sudo add-apt-repository ppa:bitcoin/bitcoin | ||
sudo apt-get update | ||
sudo apt-get install libdb4.8-dev libdb4.8++-dev | ||
sudo apt-get install -y libdb4.8-dev libdb4.8++-dev | ||
sudo pip install pathlib2 | ||
|
||
MultiChain requires Boost version no later than 1.65. | ||
|
||
sudo apt-get install -y libboost1.65-all-dev | ||
|
||
Clone MultiChain | ||
---------------- | ||
|
||
Build Google's V8 JavaScript engine locally | ||
------------------------- | ||
git clone https://github.com/MultiChain/multichain.git | ||
|
||
Please use the instructions in [V8.md](/V8.md/) to build and install V8 for use by MultiChain. | ||
Prepare to download or build V8 | ||
------------------- | ||
|
||
cd multichain | ||
set MULTICHAIN_HOME=$(pwd) | ||
mkdir v8build | ||
cd v8build | ||
|
||
You can use pre-built headers and binaries of Google's V8 JavaScript engine by downloading and expanding [linux-v8.tar.gz](https://github.com/MultiChain/multichain-binaries/raw/master/linux-v8.tar.gz) in the current directory. If, on the other hand, you prefer to build the V8 component yourself, please follow the instructions in [V8.md](/V8.md/). | ||
|
||
Compile MultiChain for Ubuntu (64-bit) | ||
----------------------------- | ||
|
||
cd $MULTICHAIN_HOME | ||
./autogen.sh | ||
./configure | ||
make | ||
|
@@ -61,64 +74,4 @@ Please see the instructions in [win.md](/win.md/) to build MultiChain for use wi | |
Mac Build Notes (on MacOS Sierra) | ||
================ | ||
|
||
Install dependencies | ||
-------------------- | ||
|
||
Install XCode and XCode command line tools | ||
Install git from git-scm | ||
Install brew (follow instructions on brew.sh) | ||
brew install autoconf automake berkeley-db4 libtool boost openssl pkg-config rename | ||
|
||
on MacOS High Sierra | ||
|
||
brew uninstall boost | ||
brew install [email protected] | ||
brew link [email protected] --force | ||
|
||
Prepare for static linking | ||
-------------------------- | ||
Apple does not support statically linked binaries as [documented here](https://developer.apple.com/library/content/qa/qa1118/_index.html), however, it is convenient for end-users to launch a binary without having to first install brew, a third-party system designed for developers. | ||
|
||
To create a statically linked MultiChain which only depends on default MacOS dylibs, the following steps are taken: | ||
|
||
1. Hide the brew boost dylibs from the build system: | ||
rename -e 's/.dylib/.dylib.hidden/' /usr/local/opt/boost/lib/*.dylib | ||
|
||
2. Hide the brew berekley-db dylibs from the build system: | ||
rename -e 's/.dylib/.dylib.hidden/' /usr/local/opt/berkeley-db\@4/lib/*.dylib | ||
|
||
3. Hide the brew openssl dylibs from the build system: | ||
rename -e 's/.dylib/.dylib.hidden/' /usr/local/opt/openssl/lib/*.dylib | ||
|
||
The default brew cookbook for berkeley-db and boost builds static libraries, but the default cookbook for openssl only builds dylibs. | ||
|
||
3. Tell brew to build openssl static libraries: | ||
brew edit openssl | ||
In 'def configure_args' change 'shared' to 'no-shared' | ||
brew install openssl --force | ||
|
||
|
||
|
||
Compile MultiChain for Mac (64-bit) | ||
-------------------------- | ||
|
||
export LDFLAGS=-L/usr/local/opt/openssl/lib | ||
export CPPFLAGS=-I/usr/local/opt/openssl/include | ||
./autogen.sh | ||
./configure --with-gui=no --with-libs=no --with-miniupnpc=no | ||
make | ||
|
||
Clean up | ||
-------- | ||
|
||
rename -e 's/.dylib.hidden/.dylib/' /usr/local/opt/berkeley-db\@4/lib/*.dylib.hidden | ||
rename -e 's/.dylib.hidden/.dylib/' /usr/local/opt/boost/lib/*.dylib.hidden | ||
rename -e 's/.dylib.hidden/.dylib/' /usr/local/opt/openssl/lib/*.dylib.hidden | ||
brew edit openssl | ||
In 'def configure_args' change 'no-shared' to 'shared' | ||
|
||
Notes | ||
----- | ||
|
||
* This will build `multichaind`, `multichain-cli` and `multichain-util` in the `src` directory. | ||
|
||
Please see the instructions in [mac.md](/mac.md/) to build MultiChain for use with MacOS. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Fetching, Building and Installing V8 (on MacOS Sierra) | ||
|
||
The following instructions fetch the Google V8 JavaScript engine to your local machine and configure it to create static libraries in the location where the MultiChain build system expects to find them. | ||
|
||
MultiChain uses V8 version 6.8, and requires at least 4 GB of RAM to build in a reasonable time. It will not build at all with less than 2 GB RAM. | ||
|
||
## Clone Google's depot_tools | ||
|
||
Google's [depot_tools](http://dev.chromium.org/developers/how-tos/install-depot-tools) are used by the Google build system to manage Git checkouts. | ||
|
||
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git | ||
cd depot_tools | ||
git checkout af2ffd933d0e6d8b5bd8c48be7a2b2d568a5eea2 | ||
cd .. | ||
export PATH=${PATH}:$(pwd)/depot_tools | ||
|
||
## Fetch V8 | ||
|
||
The following commands check out V8 and select the branch used by MultiChain. Please note that this step downloads about 2 GB of data, and can take a long time (30 minutes or more). | ||
|
||
gclient | ||
fetch v8 | ||
cd v8 | ||
git checkout 6.8.290 | ||
|
||
## Configure and build V8 | ||
|
||
The V8 build system currently uses a proprietary version of the Ninja build system, called GN. It is part of the `depot_tools` installed earlier. | ||
|
||
find . -name BUILD.gn -exec sed -i bak '/exe_and_shlib_deps/d' {} \; | ||
pushd base/trace_event/common | ||
git checkout 211b3ed9d0481b4caddbee1322321b86a483ca1f | ||
popd | ||
RELEASE=out.gn/x64.release | ||
gn gen $RELEASE --args='is_debug=false target_cpu="x64" v8_static_library=true is_component_build=false use_custom_libcxx=false use_custom_libcxx_for_host=false' | ||
|
||
The selected release of the V8 sources requires relaxing two compiler checks to prevent compilation errors. | ||
|
||
- Open the file `build/config/compiler/BUILD.gn` in your favorite editor. | ||
|
||
- Locate the folllowing lines (currently at **1464**): | ||
|
||
if (is_clang) { | ||
cflags += [ | ||
- Add the following two lines to **the end** of the block and save the file: | ||
|
||
"-Wno-defaulted-function-deleted", | ||
"-Wno-null-pointer-arithmetic", | ||
|
||
Build the V8 libraries: | ||
|
||
gn gen $RELEASE | ||
ninja -C $RELEASE v8 d8 | ||
|
||
Create an additional library embedding the V8 initial snapshot blobs: | ||
|
||
brew install python | ||
pip install pathlib2 | ||
cd $RELEASE | ||
python $MULTICHAIN_HOME/depends/v8_data_lib.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[ | ||
{ | ||
"file": "build/config/compiler/BUILD.gn", | ||
"config": "default_warnings", | ||
"flags": [ | ||
"-Wno-defaulted-function-deleted", | ||
"-Wno-null-pointer-arithmetic" | ||
] | ||
} | ||
] |
Oops, something went wrong.