A utility project to interact with Polkadot-SDK governance features on Darwinia/Crab networks. This tool supports different types of governance proposals including runtime upgrades and custom calls.
-
Set the qualified members in the
AUTHORIZED_AUTHORS=section of the workflow file. This will prevent other users' issues from being processed. -
Set
GOV_PROXY_KEYin this repository's secrets. This key is used to sign the transaction on behalf of the governance proxy account. -
Creating a new issue on this repository, prefix the title with
[GOV], and ensure that the body contains the required parameters:<WSS-URI> # e.g., wss://rpc.darwinia.network <PROPOSAL-TYPE> # Either 'runtime-upgrade' or 'any' <PROPOSAL-ARG> # For runtime-upgrade: code URI, for any: raw call data
You can also run the tool directly from the command line:
# For runtime upgrades
yarn start <wssUri> runtime-upgrade <codeUri>
# Example:
yarn start wss://rpc.darwinia.network runtime-upgrade https://github.com/darwinia-network/darwinia/releases/download/v7.0.0/darwinia_runtime.compact.compressed.wasm# For any arbitrary call
yarn start <wssUri> any <callData>
# Example:
yarn start wss://rpc.darwinia.network any 0x1a0212000100060000c80000000000000000GOV_PROXY_KEY: The private key of the account that will sign the transactions.
This helper automates the following governance flow:
- For runtime upgrades: Downloads the runtime code and creates an
authorizeUpgradecall - For custom calls: Uses the provided call data directly
- Creates a technical committee proposal to whitelist the call
- Creates a referendum proposal to dispatch the whitelisted call
- Signs and submits both proposals using the governance proxy account
-
Install dependencies:
yarn install
-
Run:
yarn build && yarn start wss://rpc.darwinia.network runtime-upgrade https://path/to/runtime.wasm # OR yarn build && yarn start wss://rpc.darwinia.network any 0xYOUR_CALL_DATA_HERE
To update to the latest version of all packages:
yarn upgrade --latest