Skip to content
nightrid3r edited this page Nov 1, 2014 · 19 revisions

Cloning Guide

Build environment

sudo add-apt-repository ppa:bitcoin/bitcoin

sudo apt-get update

sudo apt-get install -y build-essential libtool libcurl4-openssl-dev libjansson-dev libudev-dev libncurses5-dev autoconf automake git screen uthash-dev libmicrohttpd-dev libevent-dev libusb-1.0-0-dev libusb-dev shellinabox

sudo apt-get install -y libdb4.8-dev libdb4.8++-dev libminiupnpc-dev libqt4-dev libprotobuf-dev protobuf-compiler libqrencode-dev libboost1.55-all-dev libssl-dev

Don't use libboost1.54 if libboost1.55 is not available for your platform use libboost1.53

Setup github

ssh-keygen -t rsa -C "your_email@example.com"

eval "$(ssh-agent -s)"

ssh-add ~/.ssh/id_rsa

Open the ~/.ssh/id_rsa.pub file with a text editor. This is your SSH key. Select all and copy to your clipboard.

1. Fork this repository

2. String replacement

  • Replace 'pfennig' with 'yourcoin'
  • Replace 'Pfennig' with 'Yourcoin'
  • Replace 'PFG' with 'YCC' (your currency code)
  • Replace P2PPORT with your desired p2p port number
  • Replace RPCPORT with your desired rpc port number

note: testnet ports will be the same as the above with a 1 prefixed

3. Coin Configuration

open src/chainparams.cpp and modify (for mainnet):

  • line 24, replace with hex ip address of you seed server
  • line 41, nSubsidyHalvingInterval, subsidy will halve this many blocks
  • line 44, pszTimestamp, enter your genesis block message
  • line 55, genesis.nTime, enter the time for your genesis block, this may be in the future if you have a set time to go 'live'
  • line 64, set your seeds dns
  • lines 67-71, base58Prefixes[...], enter your desired variables

(for testnet)

  • line 123, genesis.nTime, enter a time for your testnet genesis block
  • line 130, set your seeds dns
  • lines 133-137, base58Prefixes[...], enter your desired variables for testnet

open src/main.cpp and modify:

  • lines 1202-1203, nTargetTimespan and nTargetSpacing, configure retarget and block times
  • line 1187, nHalfReward, to configure block reward

note: pfennig comes with the quartering reward system of bitmark, initial block reward will be twice the amount entered under nHalfReward

4. Test and Genesis

You are now ready to build a test version and create a testnet/mainnet genesis block

./autogen.sh
./configure (see the documentation under /doc for command line options)
./make

After the code has built, you may run /src/yourcoind -testnet to start mining the genesis block. The code includes a multicore miner which will immediately start searching for a genesis, once genesis is found it will print the details of the block.

Once you have the details, open src/chainparams.cpp and enter the genesis.nTime, and genesis.nNonce for the correct network. Then enter the hashGenesisBlock under the assert line (and un-comment it).

  • main.cpp Line 3027, turn to false to disable the Genesis Miner

remove the data directory ./yourcoin or ./yourcoin/testnet3

make again, and you can start testing / mining blocks.

note: you will need to have a 'network' of two machines running your daemon, in order to mine.

alerting is supported, if you need help, ask.

5. Branding

  • create a single 1024x1024 PNG icon called bitmark1024.png and place it in share/pixmaps/
  • execute share/qt/make_icons.sh and this will generate all icons and icon packs for all platforms
  • modify share/pixmaps/nsis-header.bmp and nsis-wizard.bmp as applicable, these will be shown in the installer
  • modify the 3 files under src/qt/res/images as required for your client.

note: libicns-0.8.1 is required by make_icons.sh to create OS-X icons.

6. Gitian Building

See the /docs, ethically we will only help those who show some technical fortitude if they have problems getting gitian building to work, if you cannot do this you may wish to think twice before publicly releasing a cryptographic currency.

7. Remember

Remember to uncomment the assert's in chainparams.cpp before shipping code.