Post
Topic
Board Altcoin Discussion
Re: How to Fork Bitcoin?
by
shensu
on 13/12/2017, 02:40:33 UTC

You will need Ubuntu 14.04 x64 to compile the latest stable version of Bitcoin Core: 0.15.1

Code:
//Cross Compile Windows Binaries For SoniCoin
//Ubuntu 14.04 x64
//CPU: 8 vCore
//RAM: 32768 MB

// Update and upgrade
sudo apt-get -y update; sudo apt-get -y upgrade
//reboot the server

// Install dependencies
sudo apt-get install -y autoconf automake autotools-dev build-essential curl g++-mingw-w64-i686 g++-mingw-w64-x86-64 git libboost-all-dev libevent-dev libprotobuf-dev libprotobuf-java libssl-dev libtool libqt5core5a libqt5dbus5 libqrencode-dev libqt5gui5 mingw-w64-i686-dev mingw-w64-x86-64-dev pkg-config protobuf-compiler qttools5-dev qttools5-dev-tools
//reboot the server

// Create working directory
mkdir github; cd github

//Download and install Berkeley DB 4.8
wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz
tar xzvf db-4.8.30.NC.tar.gz
cd db-4.8.30.NC/build_unix/
../dist/configure --enable-cxx
make
sudo make install
sudo ln -s /usr/local/BerkeleyDB.4.8 /usr/include/db4.8
sudo ln -s /usr/include/db4.8/include/* /usr/include
sudo ln -s /usr/include/db4.8/lib/* /usr/lib

cd ~/github
git clone https://github.com/bitcoin/bitcoin
cd bitcoin
git checkout master

// Read the code and make your changes to the name, supply, mining reward etc.
// Change the name of the coin - SoniCoin and rename all bitcoin and Bitcoin entries to sonicoin and SoniCoin
// as well as, for example BTC - BTS, Btc - Bts, btc - bts, bitcoin-cli - sonicoin-cli, bitcoin-tx => sonicoin-tx
// bitcoin-qt => sonicoin-qt, and all references to Bitcoin, except for the copyright notices.

cd depends

make HOST=x86_64-w64-mingw32 -j4

cd ../src/secp256k1
libtoolize --force
aclocal
autoheader
automake --force-missing --add-missing
autoconf
./configure --prefix=$PWD/depends/x86_64-w64-mingw32
make HOST=x86_64-w64-mingw32 -j4

cd ../univalue
libtoolize --force
aclocal
autoheader
automake --force-missing --add-missing
autoconf
./configure --prefix=$PWD/depends/x86_64-w64-mingw32
make HOST=x86_64-w64-mingw32 -j4

cd ~/github/bitcoin/
nano build-aux/m4/bitcoin_find_bdb48.m4
Find the following line -> bdbdirlist="$bdbdirlist ${_pfx}db${_vn}"
Replace the line with -> bdbdirlist= "/github/db-4.8.30.NC/build_unix"

libtoolize --force
aclocal
autoheader
automake --force-missing --add-missing
autoconf
./configure --prefix=$PWD/depends/x86_64-w64-mingw32 --with-gui=qt5 --enable-tests=no --disable-gui-tests --disable-bench
make -k HOST=x86_64-w64-mingw32 -j4

make clean
make HOST=x86_64-w64-mingw32 -j4

//The compiled binaries:
/github/bitcoin/src/bitcoind.exe
/github/bitcoin/src/bitcoin-cli.exe
/github/bitcoin/src/bitcoin-tx.exe
/github/bitcoin/src/qt/bitcoin-qt.exe



That's it SoniCoin Core: 0.15.1 is born.

You should rather not proceed with the creation of this coin if you do not understand the information above and I would suggest that you read about the difference between cloning a coin and making it your own and creating a fork.

May the odds be in your favor!

H.

You can compile it using linux in virtualbox on any OS, however.