Proj 8: Bitcoin: Joining the Samcoin Blockchain (15 pts.)

What you need:

Purpose

To join my test blockchain, get some Samcoin from my faucet, send a transaction, and mine it.

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 30570.

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

kill 30570

Deleting Old Data

This deletes the old wallet and blockchain data, to make room for the Samcoin blockchain.

If these were real bitcoins, you'd want to archive them instead of deleting them, of course. But we are using "regtest" fake coins that aren't worth any money.

Execute these commands:

cd
rm -rf .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=ad.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 18444, as shown below. If it doesn't, try waiting a minute and trying again.

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://ad.samsclass.info/faucet.htm

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

You see a message saying "You won a Samcoin!", as shown below.

Viewing your Balance

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

Sending Me Samcoins

Choose an amount between 0.01 and 0.99.

Execute this command to send that many Samcoins back to me, replacing "YOUR NAME" with your own name, and replacing "0.1337" with your chosen amount.

bitcoin-cli -regtest sendtoaddress n3gHZ98jeDWrR5JEZkS1Rnxfy3Krn6LNQy 0.1337
The reply shows the Transaction ID, as shown below.

Saving a Screen Image

Make sure the amount and Transaction ID are visible, as shown above.

Capture a full-screen image.

YOU MUST SUBMIT A FULL-SCREEN IMAGE FOR FULL CREDIT!

Save the image with the filename "YOUR NAME Proj 8a", replacing "YOUR NAME" with your real name.

Mining 100 Blocks

Execute this command to mine 100 blocks:
bitcoin-cli -regtest generate 100
You see 100 block hashes, as shown below.

Viewing Your Transaction

In your Web browser, refresh this page:

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

Look at the bottom. Find your transaction, as shown below.

Saving a Screen Image

Make sure the amount shown matches the amount in your previous screen capture.

Capture a full-screen image.

YOU MUST SUBMIT A FULL-SCREEN IMAGE FOR FULL CREDIT!

Save the image with the filename "YOUR NAME Proj 8b", replacing "YOUR NAME" with your real name.

Posted 6-2-16 by Sam Bowne
Updated 6-11-17