It seems that it is popular to introduce the node startup method of Symbol in various environments (not popular), so I will introduce the startup method on AWS EC2 (Amazon Linux2).
~~ t3.small (2 CPU memory 2GB) 30GB SSD~~ t3.large (2 CPU memory 8GB) 50GB SSD (including 16GB swap allocation)
sudo yum upgrade -y
sudo yum install git ntp -y
It's the usual thing to do for the time being. If you don't have the correct time, it may be difficult to synchronize, so install NTP as well.
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.35.3/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
source .bashrc
nvm install v14.12.0
This time I installed NodeJS v14.12.0 properly.
sudo amazon-linux-extras install docker -y
sudo systemctl enable docker
sudo systemctl start docker
sudo usermod -a -G docker ec2-user
sudo curl -L https://github.com/docker/compose/releases/download/1.25.1/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
exit
Install docker, docker-compose, log out at the end and re-enter. This is because docker cannot be started with ec2-user unless it is re-entered. If anyone knows the official procedure, please let me know.
sudo dd if=/dev/zero of=/swapfile bs=512M count=32
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon -s
EC2 is provided without swap settings. At the first startup, it will take a sudden load to catch up with the latest block, so set the swap and endure it. This time, I have secured about 16GB with 512MBx32cnt.
sudo vi /etc/fstab
Add the following to the last line and save
/swapfile swap swap defaults 0 0
Describe it in fstab so that it will be valid the next time the server is started.
npm install -g symbol-bootstrap
symbol-bootstrap config -p testnet -a dual
symbol-bootstrap compose
Install the latest symbol-bootstrap and configure for testnet.
vi target/nodes/api-node/userconfig/resources/config-node.properties
Change the friendlyName field to your favorite name. If you change this, you can enjoy it on this page after the synchronization is completed. https://symbolnodes.org/nodes_testnet/
symbol-bootstrap start -d --timeout 600000
#Check the node setting status
curl http://localhost:3000/node/info
#Check the synchronization status of the chain
curl http://localhost:3000/chain/info
Now, finally start. After starting, check the node setting status and chain synchronization status, and you're done.
Thank you for your hard work.
Recommended Posts