Here’s a script that can help visualize the upgrade path for your SNS.
Asusmptions:
- The script is run from the root of the IC mono repo, so the candid definitions are in the expected location.
- The tools
dfx
, idl2json
, jq
are installed.
- Tested in Bash 5.2
# Set the ID of your SNS's Governance canister
SNS_GOV_CANISTER_ID="igbbe-6yaaa-aaaaq-aadnq-cai"
# Obtain the current version that your SNS is running
dfx \
--identity default \
canister \
--network ic \
call \
--candid rs/sns/governance/canister/governance.did \
$SNS_GOV_CANISTER_ID get_running_sns_version \
'(record {})' \
| head -n 9 \
| tail -n 6 \
> "$SNS_GOV_CANISTER_ID.version"
# Get the upgrade path from your current version to the latest available version in SNS-W
dfx \
--identity default \
canister \
--network ic \
call \
--candid rs/nns/sns-wasm/canister/sns-wasm.did \
qaa6y-5yaaa-aaaaa-aaafa-cai list_upgrade_steps \
"(
record {
limit = 100 : nat32;
starting_at = opt record {
$(cat "$SNS_GOV_CANISTER_ID.version")
};
sns_governance_canister_id = opt principal \"$SNS_GOV_CANISTER_ID\";
},
)" | idl2json | jq ".steps[].pretty_version"
Example output for CYCLES-TRANSFER-STATION:
[
{
"archive_wasm_hash": "ea2df4e0e3f4e5e91d43baf281728b2443ab3236ba473d78913cfbe2b5763d3c",
"governance_wasm_hash": "904b24dfa4c7eae27adb4835b60266131287873236d281abb8ca46d76179d214",
"index_wasm_hash": "110352d412a97dce090dd902e9dbdc874211d0e7a5179b6814ec1694e45a2807",
"ledger_wasm_hash": "26de3e745b0e98cc83850ebf0f8fd1a574905bf7c73d52fcf61ee3f35e4875e1",
"root_wasm_hash": "2c6018ca27ae077a26acb63821d20328bf1db2dc2710d9a7245cd1c4ae22d388",
"swap_wasm_hash": "67f64e705afd70c0de03529a8b914f122b3fb8920d9e9d81e357b8b5e2a4d10a"
}
]
[
{
"archive_wasm_hash": "ea2df4e0e3f4e5e91d43baf281728b2443ab3236ba473d78913cfbe2b5763d3c",
"governance_wasm_hash": "a1d73b5e31669edacde9f767ecce598c03fa1cd71fe4873be5e0260076ed4e99",
"index_wasm_hash": "110352d412a97dce090dd902e9dbdc874211d0e7a5179b6814ec1694e45a2807",
"ledger_wasm_hash": "26de3e745b0e98cc83850ebf0f8fd1a574905bf7c73d52fcf61ee3f35e4875e1",
"root_wasm_hash": "2c6018ca27ae077a26acb63821d20328bf1db2dc2710d9a7245cd1c4ae22d388",
"swap_wasm_hash": "67f64e705afd70c0de03529a8b914f122b3fb8920d9e9d81e357b8b5e2a4d10a"
}
]
[
{
"archive_wasm_hash": "ea2df4e0e3f4e5e91d43baf281728b2443ab3236ba473d78913cfbe2b5763d3c",
"governance_wasm_hash": "a1d73b5e31669edacde9f767ecce598c03fa1cd71fe4873be5e0260076ed4e99",
"index_wasm_hash": "110352d412a97dce090dd902e9dbdc874211d0e7a5179b6814ec1694e45a2807",
"ledger_wasm_hash": "26de3e745b0e98cc83850ebf0f8fd1a574905bf7c73d52fcf61ee3f35e4875e1",
"root_wasm_hash": "2c6018ca27ae077a26acb63821d20328bf1db2dc2710d9a7245cd1c4ae22d388",
"swap_wasm_hash": "0f553be99baaaf79f23e85392f4f09dba02f89a2f2ce93f2fa4819f3149b9f84"
}
]
[
{
"archive_wasm_hash": "ea2df4e0e3f4e5e91d43baf281728b2443ab3236ba473d78913cfbe2b5763d3c",
"governance_wasm_hash": "3feb8ff7b47f53da83235e4c68676bb6db54df1e62df3681de9425ad5cf43be5",
"index_wasm_hash": "110352d412a97dce090dd902e9dbdc874211d0e7a5179b6814ec1694e45a2807",
"ledger_wasm_hash": "26de3e745b0e98cc83850ebf0f8fd1a574905bf7c73d52fcf61ee3f35e4875e1",
"root_wasm_hash": "2c6018ca27ae077a26acb63821d20328bf1db2dc2710d9a7245cd1c4ae22d388",
"swap_wasm_hash": "0f553be99baaaf79f23e85392f4f09dba02f89a2f2ce93f2fa4819f3149b9f84"
}
]
[
{
"archive_wasm_hash": "ea2df4e0e3f4e5e91d43baf281728b2443ab3236ba473d78913cfbe2b5763d3c",
"governance_wasm_hash": "3feb8ff7b47f53da83235e4c68676bb6db54df1e62df3681de9425ad5cf43be5",
"index_wasm_hash": "110352d412a97dce090dd902e9dbdc874211d0e7a5179b6814ec1694e45a2807",
"ledger_wasm_hash": "26de3e745b0e98cc83850ebf0f8fd1a574905bf7c73d52fcf61ee3f35e4875e1",
"root_wasm_hash": "e52741a712b3d0bccf35a65cf7d9dc06b7b45bd16451c5c19490f1074f56f0db",
"swap_wasm_hash": "0f553be99baaaf79f23e85392f4f09dba02f89a2f2ce93f2fa4819f3149b9f84"
}
]
[
{
"archive_wasm_hash": "ea2df4e0e3f4e5e91d43baf281728b2443ab3236ba473d78913cfbe2b5763d3c",
"governance_wasm_hash": "3feb8ff7b47f53da83235e4c68676bb6db54df1e62df3681de9425ad5cf43be5",
"index_wasm_hash": "110352d412a97dce090dd902e9dbdc874211d0e7a5179b6814ec1694e45a2807",
"ledger_wasm_hash": "26de3e745b0e98cc83850ebf0f8fd1a574905bf7c73d52fcf61ee3f35e4875e1",
"root_wasm_hash": "e52741a712b3d0bccf35a65cf7d9dc06b7b45bd16451c5c19490f1074f56f0db",
"swap_wasm_hash": "20c6fe772a0f5be86fda4ceff1e8e13b5071f9a85d83d6052c61e09084b406d6"
}
]
[
{
"archive_wasm_hash": "ea2df4e0e3f4e5e91d43baf281728b2443ab3236ba473d78913cfbe2b5763d3c",
"governance_wasm_hash": "3feb8ff7b47f53da83235e4c68676bb6db54df1e62df3681de9425ad5cf43be5",
"index_wasm_hash": "08ae5042c8e413716d04a08db886b8c6b01bb610b8197cdbe052c59538b924f0",
"ledger_wasm_hash": "26de3e745b0e98cc83850ebf0f8fd1a574905bf7c73d52fcf61ee3f35e4875e1",
"root_wasm_hash": "e52741a712b3d0bccf35a65cf7d9dc06b7b45bd16451c5c19490f1074f56f0db",
"swap_wasm_hash": "20c6fe772a0f5be86fda4ceff1e8e13b5071f9a85d83d6052c61e09084b406d6"
}
]
[
{
"archive_wasm_hash": "ea2df4e0e3f4e5e91d43baf281728b2443ab3236ba473d78913cfbe2b5763d3c",
"governance_wasm_hash": "3feb8ff7b47f53da83235e4c68676bb6db54df1e62df3681de9425ad5cf43be5",
"index_wasm_hash": "08ae5042c8e413716d04a08db886b8c6b01bb610b8197cdbe052c59538b924f0",
"ledger_wasm_hash": "e8942f56f9439b89b13bd8037f357126e24f1e7932cf03018243347505959fd4",
"root_wasm_hash": "e52741a712b3d0bccf35a65cf7d9dc06b7b45bd16451c5c19490f1074f56f0db",
"swap_wasm_hash": "20c6fe772a0f5be86fda4ceff1e8e13b5071f9a85d83d6052c61e09084b406d6"
}
]
[
{
"archive_wasm_hash": "5c595c2adc7f6d9971298fee2fa666929711e73341192ab70804c783a0eee03f",
"governance_wasm_hash": "3feb8ff7b47f53da83235e4c68676bb6db54df1e62df3681de9425ad5cf43be5",
"index_wasm_hash": "08ae5042c8e413716d04a08db886b8c6b01bb610b8197cdbe052c59538b924f0",
"ledger_wasm_hash": "e8942f56f9439b89b13bd8037f357126e24f1e7932cf03018243347505959fd4",
"root_wasm_hash": "e52741a712b3d0bccf35a65cf7d9dc06b7b45bd16451c5c19490f1074f56f0db",
"swap_wasm_hash": "20c6fe772a0f5be86fda4ceff1e8e13b5071f9a85d83d6052c61e09084b406d6"
}
]
[
{
"archive_wasm_hash": "5c595c2adc7f6d9971298fee2fa666929711e73341192ab70804c783a0eee03f",
"governance_wasm_hash": "3feb8ff7b47f53da83235e4c68676bb6db54df1e62df3681de9425ad5cf43be5",
"index_wasm_hash": "08ae5042c8e413716d04a08db886b8c6b01bb610b8197cdbe052c59538b924f0",
"ledger_wasm_hash": "e8942f56f9439b89b13bd8037f357126e24f1e7932cf03018243347505959fd4",
"root_wasm_hash": "e872d754f37dcd31558d2bb2829e2fe7fc33f61039bf6df66e9fdc1fa9fccea8",
"swap_wasm_hash": "20c6fe772a0f5be86fda4ceff1e8e13b5071f9a85d83d6052c61e09084b406d6"
}
]
The first element in the array corresponds to the current version of this SNS; the last element is the latest available configuration. At the moment, it seems like every single canister of this SNS is not at the latest version, so please consider upgrading soon!
Hope this helps.