Launch NEM Symbol testnet node on AWS EC2 (Amazon Linux2)

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).

Startup specs

~~ t3.small (2 CPU memory 2GB) 30GB SSD~~ t3.large (2 CPU memory 8GB) 50GB SSD (including 16GB swap allocation)

Using Symbol Bootstrap

Immediately after launching the instance

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.

NodeJS installation

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.

docker installation

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.

Swap settings

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.

Reboot settings
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.

symbol start setting

npm install -g symbol-bootstrap
symbol-bootstrap config -p testnet -a dual
symbol-bootstrap compose

Install the latest symbol-bootstrap and configure for testnet.

friendlyName correction
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/

Start-up

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

Launch NEM Symbol testnet node on AWS EC2 (Amazon Linux2)
[AWS EC2] How to install Maven on Amazon Linux 2
Install pyenv on EC2 (Amazon Linux)
I'll install Ruby on EC2 (Amazon Linux2) 2020
Install Python 3.8, Pip 3.8 on EC2 (Amazon Linux 2)
Creating an AWS EC2 EC2 Instance (Amazon Linux AMI) 2
AWS EC2 2nd SSH connection to EC2 Instance (Amazon Linux2)
[AWS] How to expand disk space on Amazon linux
[AWS EC2] How to install only MySQL client on Amazon Linux 2 and connect to RDS
Put jenv on Amazon Linux
Install tomcat 5.5 on Amazon Linux.
Use sshpass on Amazon linux2
Install Homebrew on Amazon Linux 2
Install strongSwan 5.9.1 on Amazon Linux 2
Create an AWS Cloud9 development environment on your Amazon EC2 instance
Summary of installing PHP7.2 on EC2 (Amazon Linux 2) and setting php.ini
Install Python Pillow on Amazon Linux
Try installing OpenAM on Amazon Linux
[Note] Install Imagick on Amazon Linux2
[Note] Run Django on Amazon Linux 2
Run docker-compose on Amazon Linux2 on ARM64
Introduce Python 3.5.2 environment on Amazon Linux
Run cron on Amazon Linux (set on Linux)
Procedure for building a kube environment on amazon linux2 (aws) ~ (with bonus)
Run a batch of Python 2.7 with nohup on Amazon Linux AMI on EC2
Install Python3 and Django on Amazon Linux (EC2) and run your web server
Use Numpy, Scipy, scikit-learn on Amazon Linux
AWS EC2 instance launch and ssh connection
How to update php on Amazon linux 2
Build an LNPP environment on Amazon Linux 2
Learn sshd_config and authorized_keys (on Amazon Linux 2)
Upgraded mysql on Cloud9 (Amazon Linux) (5.5 to 5,7)
How to install Anisble on Amazon Linux 2
Run Keycloak on Amazon Linux 2 without Docker
Including docker-nginx port forwarding on AWS Linux 2