In this project, we'll use Parity. Note: Parity is no longer being developed, so people are migrating to geth. We'll use geth in the next project.
On your Linux machine, in a Terminal window, execute these commands, one at a time. Enter your password when you are prompted to, and approve the installation when you are prompted to.
sudo apt update
sudo apt install snapd
sudo snap install core
sudo snap install parity
/snap/bin/parity --version
Now execute this command to start
your node on the Kovan testnet:
/snap/bin/parity --chain=kovan
As shown below, it shows you where the
blockchain data will be stored locally
and shows a long series of "Syncing"
messages.
Open another Terminal window.
In the new window, execute this command:
curl -H "Content-Type: application/json" -X POST \
--data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":67}' \
http://localhost:8545
This shows you the version of Parity you
are using,
as shown below.
curl -H "Content-Type: application/json" -X POST \
--data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":67}' \
http://localhost:8545
This shows you currentBlock and the highestBlock.
Repeat the command a second time.
In the image below, I found these values:
"currentBlock":"0x127e087","highestBlock":"0x17a40cd"
"currentBlock":"0x127f1b2","highestBlock":"0x17a40d2"
So in the time between my two commands, the
currentBlock increased by more than 0x1000,
and the highestBlock increased by 5. My
node is rapidly processing the blocks, and
the blockchain is also growing slowly.
curl -H "Content-Type: application/json" -X POST \
--data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x127f1b2", true],"id":1}' \
http://localhost:8545
The reply shows many details about that
block. Note these items, highlighted in
the image below:
C 341.1: Viewing Block 0x1270222 (15 pts)
Execute this command:The flag is covered by a green rectangle in the image below.
curl -H "Content-Type: application/json" -X POST \ --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x1270222", true],"id":1}' \ http://localhost:8545If you see this message: "Requested block number is in a range that is not available yet, because the ancient block sync is still in progress." please notify your instructor, who will need to update this flag.
C 341.2: Syncing (15 pts)
To see the syncing status, execute this command:As shown below, you see "currentBlock" and "highestBlock" values.
curl -H "Content-Type: application/json" -X POST \ --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":67}' \ http://localhost:8545Let your node finish syncing, which will take some time.
When I did it on May 11-12, 2021, it took 19 hours. The storage space consumed was about 50 GB.
When your node is done syncing, the reply to the eth_syncing method will be different. The new result is the flag, covered by a green rectangle in the image below.