Rather than Proof of Work or Proof of Stake, Solana uses "Proof of History". This is intended to achieve higher performance. However, Solana experienced nine network outages in the first half of 2022, and fell from a peak of $258 to $40, so this system has not been an unqualified success so far.
node -v
If you have a version below 14 installed,
remove it with this command:
sudo apt remove nodejs npm
Execute these commands to install
node.js 16:
sudo apt update
curl -sL https://deb.nodesource.com/setup_16.x | sudo bash -
sudo apt install nodejs -y
node -v
You should now have node version 16.
sudo apt install rustc -y
rustc -V
If you see a version number,
as shown below,
Rust is ready.
sudo apt install git -y
sh -c "$(curl -sSfL https://release.solana.com/v1.10.23/install)"
The output specifies an "export" command,
highlighted in the image below.
Execute that command.
Execute this command to test your installation:
solana --version
You should see a version number,
as shown below.
git clone https://github.com/solana-labs/example-helloworld
cd example-helloworld
ls
You see several files and a src
directory,
as shown below.
Execute these commands:
git clone https://github.com/solana-labs/example-helloworld
cd example-helloworld
ls
You see several files and a src
directory,
as shown below.
less src/program-rust/src/lib.rs
You see the start of the contract,
as shown below.
Note these features:
Use the down-arrow key to scroll down and see these items, as shown below:
Use the down-arrow key to scroll down and see this item, as shown below:
Press Q to exit from "less".
solana config set --url https://api.devnet.solana.com
The command works,
as shown below
solana-keygen new --force
It prompts you for a passphrase. Press ENTER
for none (an insecure choice, but this is
only a testnet).
You see a "seed phrase" consisting of several words, as shown below
solana airdrop 2
You get 2 tokens,
as shown below
npm run build:program-rust
The process takes several minutes.
When it's done, you see a command to
execute to deploy the contract,
highlighted in the image below.
You get a Program Id, as shown below.
https://explorer.solana.com/?cluster=devnet
Search for your Program Id. You should find it on the blockchain, as shown below.
Flag C 701.1 Field Name (10 pts)
The flag is covered by a green rectangle in the image below.
Execute this command to see the client's code:
less src/client/main.ts
As shown below, the flow is simple,
with these steps:
Press Q to exit from "less".
npm install
Then execute this command to run the client:
npm run start
The client succeeds,
as shown below.
Flag C 701.2 Message (5 pts)
The flag is covered by a green rectangle in the image below.
Posted 5-20-22 by Sam Bowne