C 313: Multichain Explorer (10 pts.)
What you need:
- A 64-bit Linux machine with Multichain installed, and joined to the Samchain, which you prepared in a previous project.
Purpose
Blockchain explorers allow people to examine the blockchain
with a Web browser. Here are some public blockchain explorers:
In this project, you'll add an explorer to your Samchain node.]\
Installing Prerequisites
In a Terminal, execute these commands,
one at a time:
sudo apt update
sudo apt install sqlite3 libsqlite3-dev python-dev python-pip -y
pip install pycrypto
pip install py-ubjson
Installing Multichain Explorer
On your Ubuntu server,
in a Terminal, execute these commands:
cd
git clone https://github.com/MultiChain/multichain-explorer.git
cd multichain-explorer
python setup.py install --user
A long series of "copying" messages scrolls by,
as shown below.
Finding the RPC Port
In a Terminal, execute this command:
grep rpc ~/.multichain/samchain/params.dat
The default-rpc-port should be 4415, as shown below.
Execute this command to add the port number to the configuration
file:
echo "rpcport=4415" >> ~/.multichain/samchain/multichain.conf
Configuring the Web Server
In a Terminal, execute these commands:
cd
cd multichain-explorer
cp chain1.example.conf samchain.conf
nano samchain.conf
Make these changes, as shown below:
- Change host to 0.0.0.0
- Change the "dirname" and "chain" items from "chain1" to samchain
Save the file with Ctrl+X, Y,
Enter.
Load Data
To load existing data into the explorer,
execute this command:
python -m Mce.abe --config samchain.conf --commit-bytes 100000 --no-serve
A series of blocks load, as shown below.
Start the Web Server
To serve the Multichain Explorer page,
execute this command:
python -m Mce.abe --config samchain.conf
The server starts listening, as shown below.
Allowing port 2750 Traffic
In the Google Cloud Platform page, in the line for
one of your Debian servers, on the right side, click the three-dot icon, and click "View network details",
as shown below.
On the "Firewall rules" page,
click "CREATE FIREWALL RULE",
as shown below.
On the 'Create a firewall fule" page,
make these entries,
as shown below:
- Name: allow-2750
- Targets: "All instances on the network"
- Source IP tanges 0.0.0.0/0
- "Specified protocols and ports" tcp 2750
At the bottom of the page, click the
Create button.
Viewing Multichain Explorer
In your browser, go to this URL, replacing the
IP address with the correct address of your
server:
http://172.16.1.132:2750
Multichain Explorer appears, as shown below.
Viewing the Genesis Block
Near the top of the Multichain Explorer window,
the number of Blocks appears. When I did it,
there were 152 blocks; it will be larger when
you do it.
To see the first block, also known as the
"Genesis" block,
in the Search field, enter 0,
as shown in the image above.
Click the Search button.
In the "Search Results" page, click
"MultiChain samchain 0".
C 313.1: Nonce (10 pts)
The flag is the Nonce value for block 0,
covered by a green box in the image below.
Sources
Welcome to MultiChain Explorer
Errors after pip upgrade
Posted 6-18-18 by Sam Bowne
Revised for Google cloud and the new scoring engine 7-7-19