C 312: Joining Samchain (20 pts.)

What you need:

Joining Samchain

in a Terminal, execute this command:
multichaind samchain@chain.samsclass.info:2647 -daemon
The node retrieves blockchain parameters, but cannot join, as shown below.

Note your address, highlighted in the image below. Copy it into to the clipboard.

Getting Permissions

Click the link below to open the page in a new tab:

http://chain.samsclass.info/samcoin

Enter your address in the "Grant" section, as shown below, and click SUBMIT.

The next page shows the "curl" command used to grant those permissions, and its result. The command succeeded, returning an "error" field of "null", as shown below.

Click your browser's Back button to return to the Samcoin Blockchain page.

Joining Samchain

In a Terminal, execute this command again:
multichaind samchain@chain.samsclass.info:2647 -daemon
The node joins the blockchain, as shown below.

C 312.1: Genesis Block (10 pts)

The blockchain is now stored on your server. The start of the blockchain is the Genesis block, and it contains text to describe the blockchain.

In a Terminal, execute this command:

strings ~/.multichain/samchain/blocks/blk00000.dat | head
The flag is covered by a green box in the image below.

Configuring RPC

On your Linux server, in a Terminal, execute these commands:
cat ~/.multichain/samchain/multichain.conf
grep rpc-port ~/.multichain/samchain/params.dat
You see the username, password, and port number, as shown below.

Copy this information into a text file so you can access it later.

Now you need to enter those credentials into the GUI configuration file.

Execute this command:

sudo nano /var/www/html/multichain-web-demo/config.txt
Enter the port and password into this file, adding five new lines, as shown below.

Adjust the port number and password to the correct values.

another.name=Samchain
another.rpchost=127.0.0.1
another.rpcport=the port you copied above
another.rpcuser=multichainrpc
another.rpcpassword=the password you copied above

To save the file, press Ctrl+X, Y, Enter.

Using the GUI

In a Web browser, open the GUI controlling your multichain node.

At the top left, click "Multichain Demo".

A list of available chains appears, as shown below. Click Samchain.

You see basic information about the Samchain, as shown below.

Find your address, on the right side, and copy it into the clipboard, as shown below.

Viewing Your Permissions

In the GUI, at the top, click Permissions.

On the left side, in the "Current Permissions" section, the first entry shows your permissions: "connect, send, receive", as shown below.

Getting a Sampenny

In the Samcoin Blockchain page, enter your address in the "Get a Sampenny!" section, as shown below, and click SUBMIT.

The next page shows the "curl" command used to grant those permissions, and its result.

Viewing Your Balance

In the GUI, at the top, click Send.

Now you have one Sampenny, as shown below.

Getting More Sampennies

Use the "Get Five Sampennies!" form twice, as shown below.

Now your balance should be 11 Sampennies, as shown below.

Performing an Atomic Exchange Transaction

Enter your address into the "Atomic Exchange" form as shown below. Click SUBMIT.

On the next page, highlight and copy the blob of hexadecimal text, as shown below.

In the GUI, at the top, click Accept.

Paste the blob of text into the "Offer hexadecimal" field. Click"Decode Offer".

The offer will exchange ten sampennies for one samdime, as shown below.

Click "Complete Offer". Now you have a samdime, as shown below.

Reading a Stream

In the GUI, at the top, click "View Streams".

In the "Flag" stream, click the Subscribe button, as shown below.

Click Flag, as shown below.

C 312.2: Reading a Stream (15 pts)

Find the flag, which is covered by a green box in the image below.


Sources

Installing MultiChain

Posted 6-18-18 by Sam Bowne
FREE SOFTWARE stream added 6-19-18
Samdime added 6-20-18
Code for config file added 6-20-18
Updated 11-18-20
Updated 9-20-2021
First flag number changed to 312.1 9-15-22