Sui | Devnet 0.31.0
⠀Sui is a decentralized permissionless smart contract platform biased towards low-latency management of assets.
Content
Information about the project
Description
⠀Sui is a decentralized permissionless smart contract platform biased towards low-latency management of assets. It uses the Move programming language to define assets as objects that may be owned by an address. Move programs define operations on these typed objects including custom rules for their creation, the transfer of these assets to new owners, and operations that mutate assets.
⠀The network is maintained by a permissionless set of authorities that play a role similar to validators or miners in other blockchain systems. A native asset $SUI
is used to pay for gas for all operations and for staking.
⠀The project is being built by a team of Mysten Labs professionals, some of whom are former members of Facebook and Apple teams. Their main mission is to create the basic infrastructure for Web3. Mysten Labs works with key ecosystem developers to gradually improve their networks.
⠀In the December 2021 Series A round, the Mysten Labs project raised $36M from funds such as: a16z, Coinbase Ventures, Electric Capital, Samsung NEXT and others.
Phases
⠀Based on the first and second announcements, the incentivized testnet will begin in September and will be divided into several stages:
⠀ To participate, you must launch a node in the Devnet and fill out the form by the end of August.
Rewards
- 2 000
$SUI
per stage if minimum requirements are met; - Up to 1 000 000 000
$SUI
(up to 10% of the total supply) as delegations to the highest performing validators.
Server requirements
⠀Recommended (VPS/VDS/DS):
10 CPU, 32 GB RAM, 1000 GB SSD, Ubuntu 20.04
Registration
- Be over 18 years old (there is a KYC on Coinlist);
- Have a running node in the Devnet;
- Fill out the form, and the email address must be the same as the one from the Coinlist account.
⠀ The form must be filled out by August 15 (exact time isn't specified).
⠀ Judging by the questions in the form, the selection will be serious, so it will be hard for newcomers to get through. How many people will be selected isn't specified, there is no information about the limitation of participation by country.
Launching
⠀Each subsection is a separate type of installation, you have to select one of them.
Linux
sudo apt update && sudo apt upgrade -y
⠀Install the required packages
sudo apt install wget jq git libclang-dev libpq-dev cmake -y
. <(wget -qO- https://raw.githubusercontent.com/SecorD0/utils/main/installers/rust.sh)
⠀The version of Rust must be at least 1.62.0
rustc --version
⠀If not, then delete it with the command below and reinstall it
. <(wget -qO- https://raw.githubusercontent.com/SecorD0/utils/main/installers/rust.sh) \ -un
⠀Create a directory for a node
mkdir -p $HOME/.sui
⠀Clone the project repository with the node
git clone https://github.com/MystenLabs/sui
⠀Make a fork of the repository (the repository itself).
⠀Clone your repository with the node (insert your username into the link)
git clone https://github.com/YOUR_USERNAME/sui
cd sui
⠀Create a branch with the source repository
git remote add upstream https://github.com/MystenLabs/sui
git fetch upstream
git checkout -B devnet --track upstream/devnet
⠀Build binary files (speed depends on the number of processor cores, may take several tens of minutes)
cargo build --release
error: failed to get `config` as a dependency of package `sui-config v0.0.0 (/root/suirates/sui-config)`
⠀You need to download the binary files compiled by our team
version=`wget -qO- https://api.github.com/repos/SecorD0/Sui/releases/latest | jq -r ".tag_name"`; \ wget -qO- "https://github.com/SecorD0/Sui/releases/download/${version}/sui-linux-amd64-${version}.tar.gz" | tar -C /usr/bin/ -xzf -
⠀Move binary files to the folder with binary files
mv $HOME/sui/target/release/{sui,sui-node,sui-faucet} /usr/bin/
cd
# Devnet wget -qO $HOME/.sui/genesis.blob https://github.com/MystenLabs/sui-genesis/raw/main/devnet/genesis.blob
cp $HOME/sui/crates/sui-config/data/fullnode-template.yaml \ $HOME/.sui/fullnode.yaml
sed -i -e "s%db-path:.*%db-path: \"$HOME/.sui/db\"%; "\ "s%metrics-address:.*%metrics-address: \"0.0.0.0:9184\"%; "\ "s%json-rpc-address:.*%json-rpc-address: \"0.0.0.0:9000\"%; "\ "s%genesis-file-location:.*%genesis-file-location: \"$HOME/.sui/genesis.blob\"%; " $HOME/.sui/fullnode.yaml
. <(wget -qO- https://raw.githubusercontent.com/SecorD0/utils/main/miscellaneous/ports_opening.sh) \ 9000 9184
printf "[Unit] Description=Sui node After=network-online.target [Service] User=$USER ExecStart=`which sui-node` --config-path $HOME/.sui/fullnode.yaml Restart=on-failure RestartSec=3 LimitNOFILE=65535 [Install] WantedBy=multi-user.target" > /etc/systemd/system/suid.service
sudo systemctl daemon-reload sudo systemctl enable suid sudo systemctl restart suid
⠀Add an alias of a command to view the log of the node to the system
. <(wget -qO- https://raw.githubusercontent.com/SecorD0/utils/main/miscellaneous/insert_variable.sh) -n sui_log -v "sudo journalctl -fn 100 -u suid" -a
⠀Check if the command outputs information
wget -qO- -t 1 -T 5 --header 'Content-Type: application/json' --post-data '{ "jsonrpc":"2.0", "id":1, "method":"sui_getCommitteeInfo", "params":[] }' "http://127.0.0.1:9000/" | jq
⠀You can also check the node synchronization in this checker and find your node in another one by entering the server IP.
Docker
⠀Optionally, make a fork of the repository (the repository itself).
sudo apt update && sudo apt upgrade -y
⠀Install the required packages
sudo apt install wget jq bc build-essential -y
. <(wget -qO- https://raw.githubusercontent.com/SecorD0/utils/main/installers/docker.sh)
⠀Create a directory for a node
mkdir -p $HOME/.sui
wget -qO $HOME/.sui/genesis.blob https://github.com/MystenLabs/sui-genesis/raw/main/devnet/genesis.blob
wget -qO $HOME/.sui/fullnode.yaml https://github.com/MystenLabs/sui/raw/main/crates/sui-config/data/fullnode-template.yaml
sed -i -e "s%db-path:.*%db-path: \"$HOME/.sui/db\"%; "\ "s%metrics-address:.*%metrics-address: \"0.0.0.0:9184\"%; "\ "s%json-rpc-address:.*%json-rpc-address: \"0.0.0.0:9000\"%; "\ "s%genesis-file-location:.*%genesis-file-location: \"$HOME/.sui/genesis.blob\"%; " $HOME/.sui/fullnode.yaml
. <(wget -qO- https://raw.githubusercontent.com/SecorD0/utils/main/miscellaneous/ports_opening.sh) \ 9000 9184
⠀Run a container with the node
docker run -dit --name sui_node --restart always -u 0:0 \ --log-opt max-size=50m --log-opt max-file=3 \ --network host -v $HOME/.sui:/root/.sui secord/sui \ --config-path $HOME/.sui/fullnode.yaml
⠀Add aliases of commands to the system:
. <(wget -qO- https://raw.githubusercontent.com/SecorD0/utils/main/miscellaneous/insert_variable.sh) -n sui_log -v "docker logs sui_node -fn100" -a . <(wget -qO- https://raw.githubusercontent.com/SecorD0/utils/main/miscellaneous/insert_variable.sh) -n sui -v "docker exec -it sui_node ./sui" -a
⠀Check if the command outputs information
wget -qO- -t 1 -T 5 --header 'Content-Type: application/json' --post-data '{ "jsonrpc":"2.0", "id":1, "method":"sui_getCommitteeInfo", "params":[] }' "http://127.0.0.1:9000/" | jq
⠀You can also check the node synchronization in this checker and find your node in another one by entering the server IP.
Creating a wallet
The wallet is created once, when the network is updated, you have to recover the previously created one.
⠀To interact with the blockchain it is necessary to create a wallet, to do this you need to run the command below, answer the first questions:
sui client
echo $HOME/.sui/sui_config/
⠀Make sure that the address has been created
sui keytool list
Make a statement
⠀The actions below can be performed as a confirmation of participation in the devnet (unconfirmed information).
Publishing the node RPC
⠀On the server, run the command below to get the node RPC
echo "http://`wget -qO- eth0.me`:9000/"
⠀Open the link in the browser on your PC, the message should appear (if it doesn't appear, then the node doesn't work)
Used HTTP Method is not allowed. POST or OPTIONS is required
⠀ To send your RPC, you have to join the Discord server and send it to a special channel. In this case, it is desirable to keep the node working until the start of the incentivized testnet.
Request tokens from the faucet
⠀Display and copy the wallet address (in the left column)
sui keytool list
- #✅・1st-step-verify and click the drop;
- #📕・2nd-step-rules and click the check mark;
- #🚰・devnet-faucet and send a command with the wallet address:
!faucet 0x___
Create a NFT
⠀NFT-example is created by the command
sui client create-example-nft
Summary
⠀The folder with the keys must be saved in a safe place so that you can recover the wallet (the command displays the path)
echo $HOME/.sui/sui_config/
⠀Your node can be monitored in the checker by entering the server IP.
⠀You can follow the updates of the project in the #📢・announcements channel.
⠀Devnet updates are published in the #📢・devnet-updates channel.
Recovering
⠀Create a directory for a node
mkdir -p $HOME/.sui
⠀Move the directory with the keys from the backup to the server to the created folder (the command displays the path to the moved folder)
echo $HOME/.sui/sui_config/
⠀Launch a node.
Updating
Linux
systemctl stop suid
rm -rf $HOME/.sui/db
wget -qO $HOME/.sui/genesis.blob https://github.com/MystenLabs/sui-genesis/raw/main/devnet/genesis.blob
⠀Go to the folder with the project
cd $HOME/sui
⠀Create a branch with the source repository, if it wasn't created earlier
git remote add upstream https://github.com/MystenLabs/sui
git fetch upstream
git stash
git checkout -B devnet --track upstream/devnet
⠀Build binary files (speed depends on the number of processor cores, may take several tens of minutes)
cargo build --release
⠀Move binary files to the folder with binary files
mv $HOME/sui/target/release/{sui,sui-node,sui-faucet} /usr/bin/
⠀Check the version, it should be 0.31.0
sui -V
systemctl restart suid
Docker
⠀ The container has an automatic binary update built into it on restart, but the binary files are manually collected and posted by our team.
docker stop sui_node
rm -rf $HOME/.sui/db
wget -qO $HOME/.sui/genesis.blob https://github.com/MystenLabs/sui-genesis/raw/main/devnet/genesis.blob
docker restart sui_node
⠀Wait for a new binary to be downloaded
sui_log
⠀Check the version, it should be 0.31.0
sui -V
Uninstalling
Linux
. <(wget -qO- https://raw.githubusercontent.com/SecorD0/utils/main/miscellaneous/insert_variable.sh) -n sui_log -da
systemctl stop suid
⠀Remove service file from the autorun
systemctl disable suid
rm -rf $HOME/{sui,.sui} /usr/bin/{sui,sui-node,sui-faucet} \ /etc/systemd/system/suid.service
⠀Reload the list of service files
systemctl daemon-reload
Docker
. <(wget -qO- https://raw.githubusercontent.com/SecorD0/utils/main/miscellaneous/insert_variable.sh) -n sui_log -da . <(wget -qO- https://raw.githubusercontent.com/SecorD0/utils/main/miscellaneous/insert_variable.sh) -n sui -da
docker rm sui_node -f
rm -rf $HOME/.sui /usr/bin/{sui,sui-node,sui-faucet}
docker rmi secord/sui
FAQ
I have a lot of warnings and errors in the log, is this normal?
⠀Yes, it can happen. The main thing is that the node is in the checker.
Node consumes all free RAM, what to do?
⠀ The node has a memory leakage problem.
⠀The root of the problem should be fixed by the developers, for our part we can:
- Launch the node using a different method (Systemd/Docker);
- Periodically restart the node;
- Set the RAM consumption limit for the Dcoker container when it is created.
Why does the checker display 0 objects?
⠀The number of objects in the checker appears to be reset after the node is reloaded.
⠀Reinstall or update the node, but it doesn't always work, it's easier to do nothing. If someone finds a different solution, please share the information in the Discord.
error while loading shared libraries: libssl.so.1.1
wget http://nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1l-1ubuntu1.6_amd64.deb; \ sudo dpkg -i libssl1.1_1.1.1l-1ubuntu1.6_amd64.deb
Error: invalid length 0, expected an byte array of size 32
wget -qO $HOME/.sui/genesis.blob https://github.com/MystenLabs/sui-genesis/raw/main/devnet/genesis.blob; \ systemctl restart suid
- Update the binary files. If the problem persists, download the binary files collected by our team:
version=`wget -qO- https://api.github.com/repos/SecorD0/Sui/releases/latest | jq -r ".tag_name"`; \ wget -qO- "https://github.com/SecorD0/Sui/releases/download/${version}/sui-linux-amd64-${version}.tar.gz" | tar -C /usr/bin/ -xzf -; \ systemctl restart suid
Useful commands
sui_log sudo journalctl -fn 100 -u suid docker logs sui_node -fn100
sui keytool list
sui client objects
sui client gas
systemctl restart suid docker restart sui_node
Useful links
Official website | Discord | Twitter | GitHub
Official documentation | Checker | Synchronization checker | Explorer
1package
Telegram (RU) | Chat (RU) | Discord (RU) | Twitter | Learning | Admitix
Acknowledgments
1package team — studying the project, writing the article