Skip to content

Commit 63996b8

Browse files
author
EC2 Default User
committed
Fantom. Pre-merge review
1 parent 89fb940 commit 63996b8

File tree

7 files changed

+1017
-849
lines changed

7 files changed

+1017
-849
lines changed

lib/fantom/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ pwd
299299
export INSTANCE_ID="i-**************"
300300
echo "INSTANCE_ID=" $INSTANCE_ID
301301
aws ssm start-session --target $INSTANCE_ID --region $AWS_REGION
302-
sudo cat /var/log/cloud-init-output.log
302+
sudo cat /var/log/user-data.log
303303
```
304304
305305
3. How can I restart the Fantom service?

lib/fantom/lib/assets/fantom-checker/syncchecker-fantom.sh

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
#!/bin/bash
22

3-
#FANTOM_SYNC_STATS=$(curl -s -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"ftm_syncing","params":[],"id":1}' http://localhost:18545 | jq -r ".result")
4-
53
FANTOM_SYNC_STATS=$(su bcuser -c '/home/bcuser/go-opera/build/opera attach --datadir=/data --exec "ftm.syncing"')
64
# Syncing status results:
75
#
8-
# { currentBlock: 37676547,
9-
# currentBlockHash: "0x0001ab120000187fd8069d3a4f6501d48ad4800778f40a76d79cf02469272a43",
10-
# currentBlockTime: "0x16ec7a4b9a82ebfe",
11-
# currentEpoch: "0x1ab13",
12-
# highestBlock: 80196141,
13-
# highestEpoch: "0x44343",
14-
# knownStates: 0,
15-
# pulledStates: 0,
16-
# startingBlock: 0 }
6+
#{
7+
# currentBlock: 37676547,
8+
# currentBlockHash: "0x0001ab120000187fd8069d3a4f6501d48ad4800778f40a76d79cf02469272a43",
9+
# currentBlockTime: "0x16ec7a4b9a82ebfe",
10+
# currentEpoch: "0x1ab13",
11+
# highestBlock: 82410549,
12+
# highestEpoch: "0x45f22",
13+
# knownStates: 0,
14+
# pulledStates: 0,
15+
# startingBlock: 0
16+
#}
1717
#
1818
# Synced status results:
1919
#
@@ -22,16 +22,15 @@ FANTOM_SYNC_STATS=$(su bcuser -c '/home/bcuser/go-opera/build/opera attach --dat
2222
# TODO: if a node falls behind, does it revert to syncing?
2323

2424
# If false, then get current block number:
25-
if $FANTOM_SYNC_STATS != false; then
26-
27-
FANTOM_SYNC_BLOCK=$(echo $FANTOM_SYNC_STATS | jq -r ".currentBlock")
28-
FANTOM_HIGHEST_BLOCK=$(echo $FANTOM_SYNC_STATS | jq -r ".highestBlock")
29-
30-
FANTOM_BLOCKS_BEHIND="$((FANTOM_HIGHEST_BLOCK-FANTOM_SYNC_BLOCK))"
25+
if [ -n "$FANTOM_SYNC_STATS" ] && [ "$FANTOM_SYNC_STATS" != "false" ]; then
26+
FANTOM_SYNC_BLOCK=$(su bcuser -c '/home/bcuser/go-opera/build/opera attach --datadir=/data --exec "ftm.syncing.currentBlock"')
27+
FANTOM_HIGHEST_BLOCK=$(su bcuser -c '/home/bcuser/go-opera/build/opera attach --datadir=/data --exec "ftm.syncing.highestBlock"')
28+
29+
FANTOM_BLOCKS_BEHIND="$((FANTOM_HIGHEST_BLOCK-FANTOM_SYNC_BLOCK))"
3130

3231
else
33-
FANTOM_SYNC_BLOCK=$(su bcuser -c '/home/bcuser/go-opera/build/opera attach --datadir=/data --exec "ftm.blockNumber"')
34-
FANTOM_BLOCKS_BEHIND=0
32+
FANTOM_SYNC_BLOCK=$(su bcuser -c '/home/bcuser/go-opera/build/opera attach --datadir=/data --exec "ftm.blockNumber"')
33+
FANTOM_BLOCKS_BEHIND=0
3534
fi
3635

3736
# Sending data to CloudWatch

lib/fantom/lib/assets/node-cw-dashboard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ export const SyncNodeCWDashboardJSON = {
221221
"type": "metric",
222222
"properties": {
223223
"metrics": [
224-
[ "CWAgent", "disk_used_percent", "path", "/data", "InstanceId", "${INSTANCE_ID}", "device", "nvme1n1", "fstype", "ext4", { "region": "${REGION}", "label": "/data" } ]
224+
[ "CWAgent", "disk_used_percent", "path", "/data", "InstanceId", "${INSTANCE_ID}", "device", "nvme1n1", "fstype", "xfs", { "region": "${REGION}", "label": "/data" } ]
225225
],
226226
"sparkline": true,
227227
"view": "singleValue",

lib/fantom/lib/assets/user-data/node.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ else
196196
echo "Data volume type is EBS"
197197

198198
DATA_VOLUME_ID=/dev/$(lsblk -lnb | awk -v VOLUME_SIZE_BYTES="$DATA_VOLUME_SIZE" '{if ($4== VOLUME_SIZE_BYTES) {print $1}}')
199-
mkfs -t ext4 $DATA_VOLUME_ID
199+
sudo mkfs.xfs -f $DATA_VOLUME_ID
200200
sleep 10
201201
DATA_VOLUME_UUID=$(lsblk -fn -o UUID $DATA_VOLUME_ID)
202202
DATA_VOLUME_FSTAB_CONF="UUID=$DATA_VOLUME_UUID /data ext4 defaults 0 2"

lib/fantom/sample-configs/.env-sample-read

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ AWS_ACCOUNT_ID="xxxxxxxxxxx"
77
AWS_REGION="us-east-1"
88

99
## Optional FANTOM snapshots download link # IMPORTANT !!! Make sure the url is valid before you use it!
10-
FANTOM_SNAPSHOTS_URI=https://snapshot.fantom.network/files/snapsync/latest/listtgzfiles.txt # Optional param. Do a full sync if not provided.
10+
FANTOM_SNAPSHOTS_URL=https://snapshot.fantom.network/files/snapsync/latest/listtgzfiles.txt # Optional param. Do a full sync if not provided.
1111

1212
## Common configuration parameters ##
1313
FANTOM_NETWORK="mainnet" # All options: "mainnet", "testnet"
14-
FANTOM_NODE_CONFIGURATION="read" # All options: "read", "api", "validator"
14+
FANTOM_NODE_CONFIGURATION="read" # All options: "read". Options "api" and "validator" are not yet supported
1515

1616
## Instance Nodes
1717
FANTOM_INSTANCE_TYPE="i3en.xlarge"

0 commit comments

Comments
 (0)