Skip to content

Commit

Permalink
correct filenames and use dwellir relay rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
joepetrowski committed Jan 10, 2024
1 parent 6275ad4 commit e13181e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 22 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ collectives_types.rs
kusama_types.rs
kusama_ah_types.rs
polkadot_types.rs
.DS_Store
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ opengov-cli submit-referendum \

### Submit a Referendum on Kusama

As a proposal, send an [XCM to Kusama Asset Hub](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fkusama-rpc.polkadot.io#/extrinsics/decode/0x630001000100a10f0204060202286bee880102957f0c9b47bc84d11116aef273e61565cf893801e7db0223aeea112e53922a4a) to authorize an upgrade.
As a proposal, send an [XCM to Kusama Asset Hub](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fkusama-rpc.dwellir.com#/extrinsics/decode/0x630001000100a10f0204060202286bee880102957f0c9b47bc84d11116aef273e61565cf893801e7db0223aeea112e53922a4a) to authorize an upgrade.

Call data:
```
Expand All @@ -132,19 +132,19 @@ $ ./target/debug/opengov-cli submit-referendum \
--after "10"
Submit the preimage for the Fellowship referendum:
https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fkusama-rpc.polkadot.io#/extrinsics/decode/0x2000882c004149bf15976cd3c0c244ca0cd43d59fed76f4bb936b186cc18bd88dee6edd986
https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fkusama-rpc.dwellir.com#/extrinsics/decode/0x2000882c004149bf15976cd3c0c244ca0cd43d59fed76f4bb936b186cc18bd88dee6edd986
Open a Fellowship referendum to whitelist the call:
https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fkusama-rpc.polkadot.io#/extrinsics/decode/0x17002b0f024c02d09f7b5e4b71e357780baf8cb2d625dca6efaba2ee777516eaf72e5a14a022000000010a000000
https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fkusama-rpc.dwellir.com#/extrinsics/decode/0x17002b0f024c02d09f7b5e4b71e357780baf8cb2d625dca6efaba2ee777516eaf72e5a14a022000000010a000000
Submit the preimage for the public referendum:
https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fkusama-rpc.polkadot.io#/extrinsics/decode/0x2000d42c03630001000100a10f0204060202286bee880102957f0c9b47bc84d11116aef273e61565cf893801e7db0223aeea112e53922a4a
https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fkusama-rpc.dwellir.com#/extrinsics/decode/0x2000d42c03630001000100a10f0204060202286bee880102957f0c9b47bc84d11116aef273e61565cf893801e7db0223aeea112e53922a4a
Open a public referendum to dispatch the call:
https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fkusama-rpc.polkadot.io#/extrinsics/decode/0x15002b0d02022022c662d88f6b0f84c1771134e69b4412aff9e08a99e2a2da2794b5725fbe35000000010a000000
https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fkusama-rpc.dwellir.com#/extrinsics/decode/0x15002b0d02022022c662d88f6b0f84c1771134e69b4412aff9e08a99e2a2da2794b5725fbe35000000010a000000
Batch to submit on Kusama Relay Chain:
https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fkusama-rpc.polkadot.io#/extrinsics/decode/0x1804102000882c004149bf15976cd3c0c244ca0cd43d59fed76f4bb936b186cc18bd88dee6edd98617002b0f024c02d09f7b5e4b71e357780baf8cb2d625dca6efaba2ee777516eaf72e5a14a022000000010a0000002000d42c03630001000100a10f0204060202286bee880102957f0c9b47bc84d11116aef273e61565cf893801e7db0223aeea112e53922a4a15002b0d02022022c662d88f6b0f84c1771134e69b4412aff9e08a99e2a2da2794b5725fbe35000000010a000000
https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fkusama-rpc.dwellir.com#/extrinsics/decode/0x1804102000882c004149bf15976cd3c0c244ca0cd43d59fed76f4bb936b186cc18bd88dee6edd98617002b0f024c02d09f7b5e4b71e357780baf8cb2d625dca6efaba2ee777516eaf72e5a14a022000000010a0000002000d42c03630001000100a10f0204060202286bee880102957f0c9b47bc84d11116aef273e61565cf893801e7db0223aeea112e53922a4a15002b0d02022022c662d88f6b0f84c1771134e69b4412aff9e08a99e2a2da2794b5725fbe35000000010a000000
```

This will return either two or four calls, the latter if the origin is `WhitelistedCaller`, which will require a preimage and referendum for the Fellowship. It also returns a batch call if you want to submit them all at once (you can hide this with `--no-batch "true"`).
Expand Down
20 changes: 10 additions & 10 deletions src/build_upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ async fn download_runtimes(upgrade_details: &UpgradeDetails) {
let chain_name = match chain.network {
Network::Kusama => "kusama",
Network::Polkadot => "polkadot",
Network::KusamaAssetHub => "asset_hub_kusama",
Network::KusamaBridgeHub => "bridge_hub_kusama",
Network::PolkadotAssetHub => "asset_hub_polkadot",
Network::PolkadotCollectives => "collectives_polkadot",
Network::PolkadotBridgeHub => "bridge_hub_polkadot",
Network::KusamaAssetHub => "asset-hub-kusama",
Network::KusamaBridgeHub => "bridge-hub-kusama",
Network::PolkadotAssetHub => "asset-hub-polkadot",
Network::PolkadotCollectives => "collectives-polkadot",
Network::PolkadotBridgeHub => "bridge-hub-polkadot",
};
let runtime_version = semver_to_intver(&chain.version);
let fname = format!("{}_runtime-v{}.compact.compressed.wasm", chain_name, runtime_version);
Expand Down Expand Up @@ -181,7 +181,7 @@ fn generate_authorize_upgrade_calls(upgrade_details: &UpgradeDetails) -> Vec<Cal
Network::KusamaAssetHub => {
use kusama_asset_hub::runtime_types::cumulus_pallet_parachain_system::pallet::Call;
let path = format!(
"{}asset_hub_kusama_runtime-v{}.compact.compressed.wasm",
"{}asset-hub-kusama_runtime-v{}.compact.compressed.wasm",
upgrade_details.directory, runtime_version
);
let runtime = fs::read(path).expect("Should give a valid file path");
Expand All @@ -199,7 +199,7 @@ fn generate_authorize_upgrade_calls(upgrade_details: &UpgradeDetails) -> Vec<Cal
Network::KusamaBridgeHub => {
use kusama_bridge_hub::runtime_types::cumulus_pallet_parachain_system::pallet::Call;
let path = format!(
"{}bridge_hub_kusama_runtime-v{}.compact.compressed.wasm",
"{}bridge-hub-kusama_runtime-v{}.compact.compressed.wasm",
upgrade_details.directory, runtime_version
);
let runtime = fs::read(path).expect("Should give a valid file path");
Expand All @@ -217,7 +217,7 @@ fn generate_authorize_upgrade_calls(upgrade_details: &UpgradeDetails) -> Vec<Cal
Network::PolkadotAssetHub => {
use polkadot_asset_hub::runtime_types::cumulus_pallet_parachain_system::pallet::Call;
let path = format!(
"{}asset_hub_polkadot_runtime-v{}.compact.compressed.wasm",
"{}asset-hub-polkadot_runtime-v{}.compact.compressed.wasm",
upgrade_details.directory, runtime_version
);
let runtime = fs::read(path).expect("Should give a valid file path");
Expand All @@ -235,7 +235,7 @@ fn generate_authorize_upgrade_calls(upgrade_details: &UpgradeDetails) -> Vec<Cal
Network::PolkadotCollectives => {
use polkadot_collectives::runtime_types::cumulus_pallet_parachain_system::pallet::Call;
let path = format!(
"{}collectives_polkadot_runtime-v{}.compact.compressed.wasm",
"{}collectives-polkadot_runtime-v{}.compact.compressed.wasm",
upgrade_details.directory, runtime_version
);
let runtime = fs::read(path).expect("Should give a valid file path");
Expand All @@ -253,7 +253,7 @@ fn generate_authorize_upgrade_calls(upgrade_details: &UpgradeDetails) -> Vec<Cal
Network::PolkadotBridgeHub => {
use polkadot_bridge_hub::runtime_types::cumulus_pallet_parachain_system::pallet::Call;
let path = format!(
"{}bridge_hub_polkadot_runtime-v{}.compact.compressed.wasm",
"{}bridge-hub-polkadot_runtime-v{}.compact.compressed.wasm",
upgrade_details.directory, runtime_version
);
let runtime = fs::read(path).expect("Should give a valid file path");
Expand Down
4 changes: 2 additions & 2 deletions src/submit_referendum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ pub(crate) fn get_proposal_bytes(proposal: String) -> Vec<u8> {
fn print_output(output: &Output, network_call: &NetworkRuntimeCall) {
match network_call {
NetworkRuntimeCall::Kusama(call) => {
let rpc: &'static str = "wss%3A%2F%2Fkusama-rpc.polkadot.io";
let rpc: &'static str = "wss%3A%2F%2Fkusama-rpc.dwellir.com";
match output {
Output::CallData => println!("0x{}", hex::encode(call.encode())),
Output::AppsUiLink => println!(
Expand All @@ -678,7 +678,7 @@ fn print_output(output: &Output, network_call: &NetworkRuntimeCall) {
}
},
NetworkRuntimeCall::Polkadot(call) => {
let rpc: &'static str = "wss%3A%2F%2Frpc.polkadot.io";
let rpc: &'static str = "wss%3A%2F%2Fpolkadot-rpc.dwellir.com";
match output {
Output::CallData => println!("0x{}", hex::encode(call.encode())),
Output::AppsUiLink => println!(
Expand Down
8 changes: 4 additions & 4 deletions src/types.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pub(super) use parity_scale_codec::Encode as _;
pub(super) use sp_core::{blake2_256, H256};
#[subxt::subxt(
runtime_metadata_url = "wss://kusama-rpc.polkadot.io:443",
runtime_metadata_url = "wss://kusama-rpc.dwellir.com:443",
derive_for_all_types = "PartialEq, Clone"
)]
pub mod kusama_relay {}
Expand All @@ -19,7 +19,7 @@ pub mod kusama_bridge_hub {}
pub(super) use kusama_bridge_hub::runtime_types::bridge_hub_kusama_runtime::RuntimeCall as KusamaBridgeHubRuntimeCall;

#[subxt::subxt(
runtime_metadata_url = "wss://rpc.polkadot.io:443",
runtime_metadata_url = "wss://polkadot-rpc.dwellir.com:443",
derive_for_all_types = "PartialEq, Clone"
)]
pub mod polkadot_relay {}
Expand Down Expand Up @@ -301,10 +301,10 @@ impl CallInfo {
use subxt::{OnlineClient, PolkadotConfig};

let url = match network {
Network::Kusama => "wss://kusama-rpc.polkadot.io:443",
Network::Kusama => "wss://kusama-rpc.dwellir.com:443",
Network::KusamaAssetHub => "wss://kusama-asset-hub-rpc.polkadot.io:443",
Network::KusamaBridgeHub => "wss://kusama-bridge-hub-rpc.polkadot.io:443",
Network::Polkadot => "wss://rpc.polkadot.io:443",
Network::Polkadot => "wss://polkadot-rpc.dwellir.com:443",
Network::PolkadotAssetHub => "wss://polkadot-asset-hub-rpc.polkadot.io:443",
Network::PolkadotCollectives => "wss://polkadot-collectives-rpc.polkadot.io:443",
Network::PolkadotBridgeHub => "wss://polkadot-bridge-hub-rpc.polkadot.io:443",
Expand Down

0 comments on commit e13181e

Please sign in to comment.