Proj Bitcoin 3: Joining the Samcoin Blockchain

What you need:

Previous Projects

Before doing this project, I recommend doing these:

Proj Bitcoin 1: Setting up a Private Regtest Blockchain
Proj Bitcoin 2: Adding a Second Node to your Private Regtest Blockchain

Purpose

To join my test blockchain and get some Samcoin from my faucet.

Samcoins aren't worth any real money. The purpose of this project is merely to learn how blockchain technology works, not to get rich quick.

Stopping the Bitcoin Daemon

Execute this command:
netstat -pant
Find the process ID of the bitcoind process. In the figure below, it's 5508.

Execute this command, replacing the process ID with the correct ID on your system.

kill 5508

Moving Old Data

This moves the old wallet and blockchain data to a different directory, to make room for the Samcoin blockchain.

Execute these commands:

cd
mv .bitcoin .old-bitcoin

Creating a Configuration File

Execute these commands:
cd
mkdir .bitcoin
nano .bitcoin/bitcoin.conf
Paste in these lines, replacing the password with something unique:
rpcuser=bitcoinrpc
rpcpassword=7bLjxV1CKhNJmdxTUMxTpF4vEemWCp49kMX9CwvZabYi
addnode=attack.samsclass.info
as shown below.

Press Ctrl+X, Y, Enter to save the file.

Starting the Bitcoin Daemon

Execute this command to start the Bitcoin daemon:
bitcoind -regtest -daemon
Execute this command to see listening processes:
netstat -pant
You should see a connection to my remote server on port 18333, as shown below.

Examining the Blockchain Info

Execute this command to see information about the blockchain:
bitcoin-cli -regtest getinfo
The blockchain should have more than 100 blocks, as shown below.

Viewing your Balance

Execute this command to view your balance:
bitcoin-cli -regtest getbalance
Your balance is 0, as shown below.

Getting a New Address

Execute this command to get a new address from your wallet.
bitcoin-cli -regtest getnewaddress
The address appears, as shown below.

Using the Faucet

In a Web browser, go to

http://attack.samsclass.info/faucet.htm

Enter your Samcoin address into the form. Solve the CAPTCHA, as shown below, and click Submit.

Viewing your Balance

Execute this command to view your balance:
bitcoin-cli -regtest getbalance
Your balance is now 1 Samcoin, as shown below.

References

How to escape single-quotes within single-quoted strings?


Posted 6-2-16 by Sam Bowne