Skip to content

Instantly share code, notes, and snippets.

@LNow
Last active December 25, 2020 20:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save LNow/741bc280d2062de78372bcbd82f32627 to your computer and use it in GitHub Desktop.
Save LNow/741bc280d2062de78372bcbd82f32627 to your computer and use it in GitHub Desktop.

Precautions

If you get an error Permissions denied while executing any command, please precede it with sudo. Example: Instead of apt-get install -y gpg curl please run sudo apt-get install -y gpg curl

Create folder for bitcoin

mkdir -p $HOME/bitcoin/download
cd $HOME/bitcoin/download

Install gpg and curl if not istalled

apt-get update
apt-get install -y gpg curl

Download gpg keys from gpg keyservers

for key in 01EA5486DE18A882D4C2684590C8019E36C2E964; do \
  gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
  gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \
  gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
  gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
  gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
done 

Download archive and its sha256sum

curl -SLO https://bitcoin.org/bin/bitcoin-core-0.20.1/bitcoin-0.20.1-x86_64-linux-gnu.tar.gz
curl -SLO https://bitcoin.org/bin/bitcoin-core-0.20.1/SHA256SUMS.asc 

Verify that sum is signed with valid key

gpg --verify SHA256SUMS.asc

Verify archive checksum - IT MUST SHOW THAT IT IS OK

grep bitcoin-0.20.1-x86_64-linux-gnu.tar.gz SHA256SUMS.asc | sha256sum -c -

Unpack archive

tar -xzf *.tar.gz -C $HOME/bitcoin

Create directory for bitcoin data

mkdir -p $HOME/bitcoin/data

Create config file

If you run miner on separate machine uncomment following line and replace ip address with the one used by miner rpcallowip=127.0.0.1.

If you want you can change rpcuser and rpcpassword.

cat > $HOME/bitcoin/bitcoin.conf << EOF
server=1
regtest=1
rpcallowip=0.0.0.0/0
rpcallowip=::/0
rpcuser=blockstack
rpcpassword=blockstacksystem
txindex=1
listen=1
debug=1
rpcserialversion=0
datadir=$HOME/bitcoin/data
maxconnections=200
#rpcallowip=127.0.0.1

[regtest]
bind=0.0.0.0:19444
rpcbind=0.0.0.0:19443
connect=bitcoind.krypton.blockstack.org:18444
EOF

Starting bitcoind node

$HOME/bitcoin/bitcoin-0.20.1/bin/bitcoind -conf=$HOME/bitcoin/bitcoin.conf

You have to keep bitcoind process up and running while mining, however if you would like to stop just hit ctrl+c

Edit your miner-Krypton.toml file [burnchain] section to look +/- like this

File miner-Krypton.toml is usually located in conf directory inside directory wher mining bot is installed. If you installed your bot in /home/username/stacks-bot then you should found it in /home/username/stacks-bot/conf/.

If your bitcoind node is on a separate machine, repalce 127.0.0.1 with its IP address.

If you modified rpcuser and rpcpassword in previous step, update here username and password accordingly.

[burnchain]
chain = "bitcoin"
mode = "krypton"
# peer_host = "bitcoind.krypton.blockstack.org"
peer_host = "127.0.0.1"
username = "blockstack"
password = "blockstacksystem"
rpc_port = 19443
peer_port = 19444
burn_fee_cap = 11000

And now restart your miner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment