Skip to content

Commit 5ca02d3

Browse files
authored
Merge branch 'main' into 142-fail-to-deploy-consensus-mainnet-beta-node
2 parents 667ad6d + 95ddec4 commit 5ca02d3

17 files changed

+133
-136
lines changed

lib/solana/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ This is the Well-Architected checklist for Solana nodes implementation of the AW
8484

8585
| Usage pattern | Ideal configuration | Primary option on AWS | Data Transfer Estimates | Config reference |
8686
|---|---|---|---|---|
87-
| 1/ Consensus node | 32 vCPU, 256 GB RAM, Accounts volume: 1TB, 5K IOPS, 700 MB/s throughput, Data volume: 3TB, 10K IOPS, 700 MB/s throughput | r6a.8xlarge, Accounts volume: EBS gp3 1TB, 5K IOPS, 700 MB/s throughput, Data volume: EBS gp3 10K IOPS, 700 MB/s throughput | Proportional to the amount at stake. Between 200TB to 400TB/month | [.env-sample-consensus](./sample-configs/.env-sample-consensus) |
88-
| 2/ Base RPC node (no secondary indexes) | 32 vCPU, 256 GB RAM, Accounts volume: 1TB, 5K IOPS, 700 MB/s throughput, Data volume: 3TB, 12K IOPS, 700 MB/s throughput | r6a.8xlarge, Accounts volume: EBS gp3 1TB, 5K IOPS, 700 MB/s throughput Data volume: EBS gp3 12K IOPS, 700 MB/s throughput | 150-200TB/month (no staking) | [.env-sample-baserpc](./sample-configs/.env-sample-baserpc) |
89-
| 3/ Extended RPC node (with all secondary indexes) | 64 vCPU, 1 TB RAM, Accounts volume: 1TB, 7K IOPS, 700 MB/s throughput, Data volume: 3TB, 16K IOPS, 700 MB/s throughput | x2idn.16xlarge, Accounts: instance storage (ephemeral NVMe volumes) 1.9 TB, Data volume: 3TB, 12K IOPS, 700 MB/s throughput | 150-200TB/month (no staking) | [.env-sample-extendedrpc](./sample-configs/.env-sample-extendedrpc) |
87+
| 1/ Consensus node | 48 vCPU, 384 GiB RAM, Accounts volume: 500GiB, 7K IOPS, 700 MB/s throughput, Data volume: 2TB, 9K IOPS, 700 MB/s throughput | r7a.12xlarge, Accounts volume: 500GiB, 7K IOPS, 700 MB/s throughput, Data volume: 2TB, 9K IOPS, 700 MB/s throughput | Proportional to the amount at stake. Between 200TB to 400TB/month | [.env-sample-consensus](./sample-configs/.env-sample-consensus) |
88+
| 2/ Base RPC node (no secondary indexes) | 48 vCPU, 384 GiB RAM, Accounts volume: 500GiB, 7K IOPS, 700 MB/s throughput, Data volume: 2TB, 9K IOPS, 700 MB/s throughput | r7a.12xlarge, Accounts volume: 500GiB, 7K IOPS, 700 MB/s throughput, Data volume: 2TB, 9K IOPS, 700 MB/s throughput | 150-200TB/month (no staking) | [.env-sample-baserpc](./sample-configs/.env-sample-baserpc) |
89+
| 3/ Extended RPC node (with all secondary indexes) | 96 vCPU, 768 GiB RAM, Accounts volume: 500GiB, 7K IOPS, 700 MB/s throughput, Data volume: 2TB, 9K IOPS, 700 MB/s throughput | r7a.24xlarge, Accounts volume: 500GiB, 7K IOPS, 700 MB/s throughput, Data volume: 2TB, 9K IOPS, 700 MB/s throughput | 150-200TB/month (no staking) | [.env-sample-extendedrpc](./sample-configs/.env-sample-extendedrpc) |
9090
</details>
9191

9292
## Setup Instructions
@@ -248,7 +248,7 @@ export INSTANCE_ID=$(cat single-node-deploy.json | jq -r '..|.node-instance-id?
248248
echo "INSTANCE_ID=" $INSTANCE_ID
249249
aws ssm start-session --target $INSTANCE_ID --region $AWS_REGION
250250
sudo su bcuser
251-
sudo journalctl -o cat -fu sol
251+
sudo journalctl -o cat -fu node
252252
```
253253

254254
2. How to check the logs from the EC2 user-data script?
@@ -268,7 +268,7 @@ sudo cat /var/log/cloud-init-output.log
268268
export INSTANCE_ID=$(cat single-node-deploy.json | jq -r '..|.node-instance-id? | select(. != null)')
269269
echo "INSTANCE_ID=" $INSTANCE_ID
270270
aws ssm start-session --target $INSTANCE_ID --region $AWS_REGION
271-
sudo systemctl status sol
271+
sudo systemctl status node
272272
```
273273

274274
4. How to upload a secret to AWS Secrets Manager?
@@ -298,11 +298,11 @@ free -g
298298
- Option 2: Existing volume (using Data directory as example):
299299

300300
```bash
301-
sudo mkdir /var/solana/data/swapfile
302-
sudo dd if=/dev/zero of=/var/solana/data/swapfile bs=1MiB count=250KiB
303-
sudo chmod 0600 /var/solana/data/swapfile
304-
sudo mkswap /var/solana/data/swapfile
305-
sudo swapon /var/solana/data/swapfile
301+
sudo mkdir /data/solana/data/swapfile
302+
sudo dd if=/dev/zero of=/data/solana/data/swapfile bs=1MiB count=250KiB
303+
sudo chmod 0600 /data/solana/data/swapfile
304+
sudo mkswap /data/solana/data/swapfile
305+
sudo swapon /data/solana/data/swapfile
306306
free -g
307307
sudo sysctl vm.swappiness=10
308308
```

lib/solana/lib/assets/setup-instance-store-volumes.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@ fi
1818

1919
if [ -n "$DATA_VOLUME_ID" ]; then
2020
echo "If Data volume is mounted, dont do anything"
21-
if [ $(df --output=target | grep -c "/var/solana/data") -lt 1 ]; then
21+
if [ $(df --output=target | grep -c "/data/solana/data") -lt 1 ]; then
2222
echo "Checking fstab for Data volume"
2323

2424
sudo mkfs.xfs -f $DATA_VOLUME_ID
2525
sleep 10
2626
DATA_VOLUME_UUID=$(lsblk -fn -o UUID $DATA_VOLUME_ID)
27-
DATA_VOLUME_FSTAB_CONF="UUID=$DATA_VOLUME_UUID /var/solana/data xfs defaults 0 2"
27+
DATA_VOLUME_FSTAB_CONF="UUID=$DATA_VOLUME_UUID /data/solana/data xfs defaults 0 2"
2828
echo "DATA_VOLUME_ID="$DATA_VOLUME_ID
2929
echo "DATA_VOLUME_UUID="$DATA_VOLUME_UUID
3030
echo "DATA_VOLUME_FSTAB_CONF="$DATA_VOLUME_FSTAB_CONF
3131

3232
# Check if data disc is already in fstab and replace the line if it is with the new disc UUID
3333
if [ $(grep -c "data" /etc/fstab) -gt 0 ]; then
34-
SED_REPLACEMENT_STRING="$(grep -n "/var/solana/data" /etc/fstab | cut -d: -f1)s#.*#$DATA_VOLUME_FSTAB_CONF#"
34+
SED_REPLACEMENT_STRING="$(grep -n "/data/solana/data" /etc/fstab | cut -d: -f1)s#.*#$DATA_VOLUME_FSTAB_CONF#"
3535
sudo cp /etc/fstab /etc/fstab.bak
3636
sudo sed -i "$SED_REPLACEMENT_STRING" /etc/fstab
3737
else
@@ -40,29 +40,29 @@ if [ -n "$DATA_VOLUME_ID" ]; then
4040

4141
sudo mount -a
4242

43-
sudo mkdir /var/solana/data/ledger
44-
sudo chown -R solana:solana /var/solana
43+
sudo mkdir /data/solana/data/ledger
44+
sudo chown -R solana:solana /data/solana
4545
else
4646
echo "Data volume is mounted, nothing changed"
4747
fi
4848
fi
4949

5050
if [ -n "$ACCOUNTS_VOLUME_ID" ]; then
5151
echo "If Accounts volume is mounted, dont do anything"
52-
if [ $(df --output=target | grep -c "/var/solana/accounts") -lt 1 ]; then
52+
if [ $(df --output=target | grep -c "/data/solana/accounts") -lt 1 ]; then
5353
echo "Checking fstab for Accounts volume"
5454

5555
sudo mkfs.xfs -f $ACCOUNTS_VOLUME_ID
5656
sleep 10
5757
ACCOUNTS_VOLUME_UUID=$(lsblk -fn -o UUID $ACCOUNTS_VOLUME_ID)
58-
ACCOUNTS_VOLUME_FSTAB_CONF="UUID=$ACCOUNTS_VOLUME_UUID /var/solana/accounts xfs defaults 0 2"
58+
ACCOUNTS_VOLUME_FSTAB_CONF="UUID=$ACCOUNTS_VOLUME_UUID /data/solana/accounts xfs defaults 0 2"
5959
echo "ACCOUNTS_VOLUME_ID="$ACCOUNTS_VOLUME_ID
6060
echo "ACCOUNTS_VOLUME_UUID="$ACCOUNTS_VOLUME_UUID
6161
echo "ACCOUNTS_VOLUME_FSTAB_CONF="$ACCOUNTS_VOLUME_FSTAB_CONF
6262

6363
# Check if accounts disc is already in fstab and replace the line if it is with the new disc UUID
64-
if [ $(grep -c "/var/solana/accounts" /etc/fstab) -gt 0 ]; then
65-
SED_REPLACEMENT_STRING="$(grep -n "/var/solana/accounts" /etc/fstab | cut -d: -f1)s#.*#$ACCOUNTS_VOLUME_FSTAB_CONF#"
64+
if [ $(grep -c "/data/solana/accounts" /etc/fstab) -gt 0 ]; then
65+
SED_REPLACEMENT_STRING="$(grep -n "/data/solana/accounts" /etc/fstab | cut -d: -f1)s#.*#$ACCOUNTS_VOLUME_FSTAB_CONF#"
6666
sudo cp /etc/fstab /etc/fstab.bak
6767
sudo sed -i "$SED_REPLACEMENT_STRING" /etc/fstab
6868
else
@@ -71,7 +71,7 @@ if [ -n "$ACCOUNTS_VOLUME_ID" ]; then
7171

7272
sudo mount -a
7373

74-
sudo chown -R solana:solana /var/solana
74+
sudo chown -R solana:solana /data/solana
7575
else
7676
echo "Accounts volume is mounted, nothing changed"
7777
fi

lib/solana/lib/assets/solana/node-consensus-template.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -o errexit
33
set -o nounset
44
set -o pipefail
55
# Remove empty snapshots
6-
find "/var/solana/data/ledger" -name "snapshot-*" -size 0 -print -exec rm {} \; || true
6+
find "/data/solana/data/ledger" -name "snapshot-*" -size 0 -print -exec rm {} \; || true
77
export RUST_LOG=error
88
export RUST_BACKTRACE=full
99
export SOLANA_METRICS_CONFIG=__SOLANA_METRICS_CONFIG__
@@ -15,7 +15,7 @@ TOKEN=$(curl -s -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-m
1515
export EC2_INTERNAL_IP=$(curl -H "X-aws-ec2-metadata-token: $TOKEN" -s http://169.254.169.254/latest/meta-data/local-ipv4)
1616

1717
/home/solana/bin/solana-validator \
18-
--ledger /var/solana/data/ledger \
18+
--ledger /data/solana/data/ledger \
1919
--identity /home/solana/config/validator-keypair.json \
2020
--vote-account /home/solana/config/vote-account-keypair.json \
2121
__KNOWN_VALIDATORS__ \
@@ -25,7 +25,8 @@ __ENTRY_POINTS__ \
2525
--private-rpc \
2626
--rpc-bind-address $EC2_INTERNAL_IP \
2727
--wal-recovery-mode skip_any_corrupted_record \
28-
--init-complete-file /var/solana/data/init-completed \
28+
--init-complete-file /data/solana/data/init-completed \
2929
--limit-ledger-size \
30-
--accounts /var/solana/accounts \
30+
--accounts /data/solana/accounts \
31+
--incremental-snapshot-interval-slots 0 \
3132
--log -

lib/solana/lib/assets/solana/node-heavy-rpc-template.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -o errexit
33
set -o nounset
44
set -o pipefail
55
# Remove empty snapshots
6-
find "/var/solana/data/ledger" -name "snapshot-*" -size 0 -print -exec rm {} \; || true
6+
find "/data/solana/data/ledger" -name "snapshot-*" -size 0 -print -exec rm {} \; || true
77
export RUST_LOG=error
88
export RUST_BACKTRACE=full
99
export SOLANA_METRICS_CONFIG=__SOLANA_METRICS_CONFIG__
@@ -15,7 +15,7 @@ TOKEN=$(curl -s -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-m
1515
export EC2_INTERNAL_IP=$(curl -H "X-aws-ec2-metadata-token: $TOKEN" -s http://169.254.169.254/latest/meta-data/local-ipv4)
1616

1717
/home/solana/bin/solana-validator \
18-
--ledger /var/solana/data/ledger \
18+
--ledger /data/solana/data/ledger \
1919
--identity /home/solana/config/validator-keypair.json \
2020
__KNOWN_VALIDATORS__ \
2121
--expected-genesis-hash __EXPECTED_GENESIS_HASH__ \
@@ -30,14 +30,15 @@ __ENTRY_POINTS__ \
3030
--wal-recovery-mode skip_any_corrupted_record \
3131
--enable-rpc-transaction-history \
3232
--enable-cpi-and-log-storage \
33-
--init-complete-file /var/solana/data/init-completed \
33+
--init-complete-file /data/solana/data/init-completed \
3434
--require-tower \
3535
--no-wait-for-vote-to-start-leader \
3636
--limit-ledger-size \
37-
--accounts /var/solana/accounts \
37+
--accounts /data/solana/accounts \
3838
--account-index spl-token-owner \
3939
--account-index program-id \
4040
--account-index spl-token-mint \
4141
--account-index-exclude-key kinXdEcpDQeHPEuQnqmUgtYykqKGVFq6CeVX5iAHJq6 \
4242
--account-index-exclude-key TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA \
43+
--incremental-snapshot-interval-slots 0 \
4344
--log -

lib/solana/lib/assets/solana/node-light-rpc-template.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -o errexit
33
set -o nounset
44
set -o pipefail
55
# Remove empty snapshots
6-
find "/var/solana/data/ledger" -name "snapshot-*" -size 0 -print -exec rm {} \; || true
6+
find "/data/solana/data/ledger" -name "snapshot-*" -size 0 -print -exec rm {} \; || true
77
export RUST_LOG=error
88
export RUST_BACKTRACE=full
99
export SOLANA_METRICS_CONFIG=__SOLANA_METRICS_CONFIG__
@@ -15,7 +15,7 @@ TOKEN=$(curl -s -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-m
1515
export EC2_INTERNAL_IP=$(curl -H "X-aws-ec2-metadata-token: $TOKEN" -s http://169.254.169.254/latest/meta-data/local-ipv4)
1616

1717
/home/solana/bin/solana-validator \
18-
--ledger /var/solana/data/ledger \
18+
--ledger /data/solana/data/ledger \
1919
--identity /home/solana/config/validator-keypair.json \
2020
__KNOWN_VALIDATORS__ \
2121
--expected-genesis-hash __EXPECTED_GENESIS_HASH__ \
@@ -30,9 +30,10 @@ __ENTRY_POINTS__ \
3030
--wal-recovery-mode skip_any_corrupted_record \
3131
--enable-rpc-transaction-history \
3232
--enable-cpi-and-log-storage \
33-
--init-complete-file /var/solana/data/init-completed \
33+
--init-complete-file /data/solana/data/init-completed \
3434
--require-tower \
3535
--no-wait-for-vote-to-start-leader \
3636
--limit-ledger-size \
37-
--accounts /var/solana/accounts \
37+
--accounts /data/solana/accounts \
38+
--incremental-snapshot-interval-slots 0 \
3839
--log -

lib/solana/lib/assets/sync-checker/syncchecker-solana.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
INIT_COMPLETED_FILE=/var/solana/data/init-completed
3+
INIT_COMPLETED_FILE=/data/solana/data/init-completed
44

55
TOKEN=$(curl -s -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600")
66
INSTANCE_ID=$(curl -H "X-aws-ec2-metadata-token: $TOKEN" -s http://169.254.169.254/latest/meta-data/instance-id)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[Unit]
2+
Description=Solana Validator
3+
After=network.target
4+
StartLimitIntervalSec=0
5+
[Service]
6+
Type=simple
7+
Restart=always
8+
RestartSec=1
9+
User=solana
10+
LimitNOFILE=1000000
11+
LogRateLimitIntervalSec=0
12+
Environment="PATH=/bin:/usr/bin:/home/solana/bin"
13+
ExecStart=/home/solana/bin/validator.sh
14+
[Install]
15+
WantedBy=multi-user.target
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[Unit]
2+
Description="Sync checker for the tezos node"
3+
4+
[Service]
5+
ExecStart=/opt/syncchecker.sh
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Unit]
2+
Description="Run Sync checker service every 5 min"
3+
4+
[Timer]
5+
OnCalendar=*:*:0/5
6+
Unit=sync-checker.service
7+
8+
[Install]
9+
WantedBy=multi-user.target

0 commit comments

Comments
 (0)