Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added bouncer command to download a runtime update from a proposal #4592

Merged
merged 2 commits into from
Mar 1, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions bouncer/commands/get_proposed_runtime.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env -S pnpm tsx
// INSTRUCTIONS
//
// This command takes one argument.
// It will download the runtime from the governance proposal with the ID given by the first
// argument and save it into a file named "proposed_runtime.wasm"
//
// For example: ./commands/get_proposed_runtime.ts 123

import { getChainflipApi } from '../shared/utils';
import fs from 'fs';
const proposal_id = process.argv[2];
const api = await getChainflipApi();
let proposal = await api.query.governance.proposals(proposal_id);
let call = proposal.unwrap().call;
let extrinsic = api.registry.createType('Call', proposal.unwrap().call);
await fs.writeFile("proposed_runtime.wasm", extrinsic.args[1].toU8a(), (err) => {if(err)console.log("error!"); else process.exit(0);});
Loading