Generate a Genesis Block (Linux/Debian 11+ Bash Commands) Note: This may take a few attempts and several hours.
- sudo apt-get -y update
- sudo apt-get -y upgrade
- sudo apt-get -y install git-core python3
- git clone https://github.com/satoshiware/genesis
- cd ~/genesis
- python3 genesis.py -z "Local newspaper of the day TODAY'S DATE Something interesting that happened"
- #When finished, store the output somewhere for safe keeping
- In the bitcoin repository (microcurrency edition) @ https://github.com/satoshiware/bitcoin
- Create the file "./src/micros/micro_$NAME.h". This is not mandatory; it makes for convenient referencing.
- Use another file in that same directory as an example.
- Paste the output of the genesis.py program as a block comment.
- Update all parameters according the microcurrency's white paper and the genesis block.
- Generate some random bytes and update the "Magic bytes" section of the file.
- Make a copy of the "micro_$NAME.h" file and place it in the "./src" directory with the name "micro.h".
- This is in preparation for (manually) compiling the program for the new micro.
- It may not be necessary when compiling using script automation (depends on the script).
- Create the file "./src/micros/micro_$NAME.h". This is not mandatory; it makes for convenient referencing.
- bitcoind -micro -daemon #Run bitcoind if it isn't already. This will create the ".bitcoin" directory and sub directories.
- bitcoin-cli -micro stop #Stop bitcoind From Running
- echo "server=1" > ./.bitcoin/bitcoin.conf
- echo "rpcuser=USER" >> ./.bitcoin/bitcoin.conf #Consider a sensible user name with a strong password.
- echo "rpcpassword=PASSWD" >> ./.bitcoin/bitcoin.conf
In order to run bitcoind on a blockchain with the latest block (including the genesis) older than 24 hours,
you'll need to use the maxtipage option with the appropriate amount of time set. Adjust it accordingly.
Otherwise, the connecting application (e.g. minerd) will get an "RPC 500 Internal Server Error".
- bitcoind -micro -daemon -maxtipage=1000000 #Maximum time (in seconds) that can pass from previous block (default = 24 hours)
- bitcoin-cli -micro createwallet "firstwallet"
- bitcoin-cli -micro unloadwallet "firstwallet"
- bitcoin-cli -micro listwallets
- bitcoin-cli -micro loadwallet "firstwallet" true
- bitcoin-cli -micro getnewaddress
- #Record the outputted address... it will be used for initial mining. "Keep it secret; Keep it safe."
- sudo apt-get -y install make libcurl4-openssl-dev git autotools-dev automake build-essential
- git clone https://github.com/satoshiware/cpuminer
- cd cpuminer
- ./autogen.sh
- ./configure CFLAGS="-O3"
- make clean
- make
- cd ..
- ~/cpuminer/minerd -B -o 127.0.0.1:$PORT -a sha256d -u USER -p PASSWD --coinbase-addr=$ADDRESS
- Default RPC port: 19332
- Use previously generated $ADDRESS
- pidof minerd #Command to see if there is minerd process running.
- pkill minerd #Command to stop minerd.