mirror of
https://github.com/logos-storage/logos-storage-spr.git
synced 2026-01-02 13:33:12 +00:00
chore: reorder testnet records (#4)
* testnet: re-order spr/enode records * docs: update the guide
This commit is contained in:
parent
a7f94bb86d
commit
9e2d24907f
50
README.md
50
README.md
@ -37,35 +37,57 @@ curl https://spr.codex.storage/testnet/geth
|
||||
|
||||
3. Update files to S3
|
||||
```shell
|
||||
# Variables
|
||||
networks_file="codex"
|
||||
buckets="bucket-1 bucket-2"
|
||||
folder="upload"
|
||||
|
||||
for bucket in ${buckets}; do
|
||||
|
||||
# Records
|
||||
# Networks records
|
||||
mkdir -p "${folder}"
|
||||
for file in *.txt; do
|
||||
|
||||
# Variables
|
||||
network=$(awk -F '-' '{print $1}' <<< ${file})
|
||||
nodes=$(awk -F '-' '{print $2}' <<< ${file%%.*})
|
||||
echo "${network}" >> "${networks_file}"
|
||||
|
||||
# Upload
|
||||
if [[ "${nodes}" == "codex" ]]; then
|
||||
# Networks folders/files
|
||||
mkdir -p "${folder}/${network}"
|
||||
cp "${file}" "${folder}/${network}/${nodes}"
|
||||
done
|
||||
|
||||
# Networks list
|
||||
sort -u "${networks_file}" -o "${folder}/${networks_file}"
|
||||
|
||||
# Upload to S3
|
||||
for bucket in ${buckets}; do
|
||||
|
||||
# Sync networks
|
||||
aws s3 sync --acl public-read --content-type "text/plain" "${folder}" "s3://${bucket}" --delete
|
||||
|
||||
# Copy main node
|
||||
for file in ${folder}/*/${networks_file}; do
|
||||
network=$(awk -F '/' '{print $2}' <<< "${file}")
|
||||
aws s3 cp --acl public-read --content-type "text/plain" "${file}" "s3://${bucket}/${network}"
|
||||
fi
|
||||
aws s3 cp --acl public-read --content-type "text/plain" "${file}" "s3://${bucket}/${network}/${nodes}"
|
||||
done
|
||||
done
|
||||
|
||||
# Networks
|
||||
sort -u "${networks_file}" -o "${networks_file}"
|
||||
aws s3 cp --acl public-read --content-type "text/plain" "${networks_file}" "s3://${bucket}/${networks_file}"
|
||||
|
||||
done
|
||||
|
||||
rm -f "${networks_file}"
|
||||
# Cleanup
|
||||
rm -rf "${folder}"
|
||||
```
|
||||
|
||||
4. Check the result
|
||||
4. Flush cache
|
||||
```shell
|
||||
# Variables
|
||||
distribution_id="XXXXXXXXXXXXXX"
|
||||
|
||||
# Flush cache
|
||||
invalidation_id=$(aws cloudfront create-invalidation --distribution-id "${distribution_id}" --paths "/*" | jq -r '.Invalidation.Id')
|
||||
aws cloudfront wait invalidation-completed --distribution-id "${distribution_id}" --id "${invalidation_id}"
|
||||
```
|
||||
|
||||
5. Check the result
|
||||
```shell
|
||||
# Networks
|
||||
curl https://spr.codex.storage
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
spr:CiUIAhIhAiJvIcA_ZwPZ9ugVKDbmqwhJZaig5zKyLiuaicRcCGqLEgIDARo8CicAJQgCEiECIm8hwD9nA9n26BUoNuarCEllqKDnMrIuK5qJxFwIaosQ3d6esAYaCwoJBJ_f8zKRAnU6KkYwRAIgM0MvWNJL296kJ9gWvfatfmVvT-A7O2s8Mxp8l9c8EW0CIC-h-H-jBVSgFjg3Eny2u33qF7BDnWFzo7fGfZ7_qc9P
|
||||
spr:CiUIAhIhAyUvcPkKoGE7-gh84RmKIPHJPdsX5Ugm_IHVJgF-Mmu_EgIDARo8CicAJQgCEiEDJS9w-QqgYTv6CHzhGYog8ck92xflSCb8gdUmAX4ya78QoemesAYaCwoJBES39Q2RAnVOKkYwRAIgLi3rouyaZFS_Uilx8k99ySdQCP1tsmLR21tDb9p8LcgCIG30o5YnEooQ1n6tgm9fCT7s53k6XlxyeSkD_uIO9mb3
|
||||
spr:CiUIAhIhAlNJ7ary8eOK5GcwQ6q4U8brR7iWjwhMwzHb8BzzmCEDEgIDARpJCicAJQgCEiECU0ntqvLx44rkZzBDqrhTxutHuJaPCEzDMdvwHPOYIQMQsZ67vgYaCwoJBK6Kf1-RAnVEGgsKCQSuin9fkQJ1RCpGMEQCIDxd6lXDvj1PcHgQYnNpHGfgCO5a7fejg3WhSjh2wTimAiB7YHsL1WZYU_zkHcNDWhRgMbkb3C5yRuvUhjBjGOYJYQ
|
||||
spr:CiUIAhIhAyUvcPkKoGE7-gh84RmKIPHJPdsX5Ugm_IHVJgF-Mmu_EgIDARo8CicAJQgCEiEDJS9w-QqgYTv6CHzhGYog8ck92xflSCb8gdUmAX4ya78QoemesAYaCwoJBES39Q2RAnVOKkYwRAIgLi3rouyaZFS_Uilx8k99ySdQCP1tsmLR21tDb9p8LcgCIG30o5YnEooQ1n6tgm9fCT7s53k6XlxyeSkD_uIO9mb3
|
||||
@ -1,3 +1,3 @@
|
||||
enode://cff0c44c62ecd6e00d72131f336bb4e4968f2c1c1abeca7d4be2d35f818608b6d8688b6b65a18f1d57796eaca32fd9d08f15908a88afe18c1748997235ea6fe7@159.223.243.50:40010
|
||||
enode://ea331eaa8c5150a45b793b3d7c17db138b09f7c9dd7d881a1e2e17a053e0d2600e0a8419899188a87e6b91928d14267949a7e6ec18bfe972f3a14c5c2fe9aecb@68.183.245.13:40030
|
||||
enode://4a7303b8a72db91c7c80c8fb69df0ffb06370d7f5fe951bcdc19107a686ba61432dc5397d073571433e8fc1f8295127cabbcbfd9d8464b242b7ad0dcd35e67fc@174.138.127.95:40020
|
||||
enode://ea331eaa8c5150a45b793b3d7c17db138b09f7c9dd7d881a1e2e17a053e0d2600e0a8419899188a87e6b91928d14267949a7e6ec18bfe972f3a14c5c2fe9aecb@68.183.245.13:40030
|
||||
Loading…
x
Reference in New Issue
Block a user