From c2fa7a8ab7e420d28896a5b31cf55d46a2544782 Mon Sep 17 00:00:00 2001 From: Hamish Peebles Date: Fri, 19 Jul 2024 14:11:38 +0100 Subject: [PATCH] Add scripts for submitting proposals to the StorageIndex canister (#6075) --- scripts/proposals/add_open_storage_bucket.sh | 0 scripts/proposals/add_storage_bucket.sh | 20 +++++++++++++++++++ .../mark_open_storage_bucket_full.sh | 0 scripts/proposals/mark_storage_bucket_full.sh | 20 +++++++++++++++++++ 4 files changed, 40 insertions(+) delete mode 100755 scripts/proposals/add_open_storage_bucket.sh create mode 100755 scripts/proposals/add_storage_bucket.sh delete mode 100755 scripts/proposals/mark_open_storage_bucket_full.sh create mode 100755 scripts/proposals/mark_storage_bucket_full.sh diff --git a/scripts/proposals/add_open_storage_bucket.sh b/scripts/proposals/add_open_storage_bucket.sh deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/scripts/proposals/add_storage_bucket.sh b/scripts/proposals/add_storage_bucket.sh new file mode 100755 index 0000000000..45910205f0 --- /dev/null +++ b/scripts/proposals/add_storage_bucket.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# Extract the args or use defaults +CANISTER_ID=$1 +SUMMARY=${2:-"Each image, video and file uploaded to OpenChat is stored in a storage bucket canister, so by adding more bucket canisters we increase the total available storage volume and spread the load across more canisters."} + +# Build the title +TITLE="Add canister $CANISTER_ID as a new storage bucket" + +# Set current directory to the scripts root +SCRIPT=$(readlink -f "$0") +SCRIPT_DIR=$(dirname "$SCRIPT") +cd $SCRIPT_DIR/.. + +# add_platform_moderator args +ARGS="(record { canister_id=principal \"$CANISTER_ID\" })" +FUNCTION_ID=5001 + +# Submit the proposal +./make_custom_function_proposal.sh $FUNCTION_ID "$TITLE" "$SUMMARY" "" "$ARGS" diff --git a/scripts/proposals/mark_open_storage_bucket_full.sh b/scripts/proposals/mark_open_storage_bucket_full.sh deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/scripts/proposals/mark_storage_bucket_full.sh b/scripts/proposals/mark_storage_bucket_full.sh new file mode 100755 index 0000000000..a03558aa01 --- /dev/null +++ b/scripts/proposals/mark_storage_bucket_full.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# Extract the args or use defaults +CANISTER_ID=$1 +SUMMARY=${2:-"Once a storage bucket canister is marked as full it will no longer be used to store new files, but will continue serving existing files."} + +# Build the title +TITLE="Mark storage bucket $CANISTER_ID as full" + +# Set current directory to the scripts root +SCRIPT=$(readlink -f "$0") +SCRIPT_DIR=$(dirname "$SCRIPT") +cd $SCRIPT_DIR/.. + +# add_platform_moderator args +ARGS="(record { bucket=principal \"$CANISTER_ID\"; full=true })" +FUNCTION_ID=5002 + +# Submit the proposal +./make_custom_function_proposal.sh $FUNCTION_ID "$TITLE" "$SUMMARY" "" "$ARGS"