I started this gist as an index for all of the staking reports. Almost a year in, we migrated everything to https://polkadot.network/tag/staking-updates/. This page will no longer be updated:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export async function RcTICheck(): Promise<void> { | |
| const rcApi = await getApi("wss://paseo-rpc.n.dwellir.com"); | |
| const ahApi = await getApi("wss://asset-hub-paseo-rpc.n.dwellir.com"); | |
| let rcSent = new BN(0); | |
| let ahReceived = new BN(0); | |
| { | |
| const start = await rcApi.query.rcMigrator.migrationStartBlock() as Option<BlockNumber>; | |
| const startHash = await rcApi.rpc.chain.getBlockHash(start.unwrap()); | |
| const end = await rcApi.query.rcMigrator.migrationEndBlock() as Option<BlockNumber>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This file is part of Substrate. | |
| // Copyright (C) Parity Technologies (UK) Ltd. | |
| // SPDX-License-Identifier: Apache-2.0 | |
| // Licensed under the Apache License, Version 2.0 (the "License"); | |
| // you may not use this file except in compliance with the License. | |
| // You may obtain a copy of the License at | |
| // | |
| // http://www.apache.org/licenses/LICENSE-2.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # WiFi Network Cleanup Tool | |
| # This script helps you review and remove unwanted WiFi networks | |
| # Colors for better readability | |
| RED='\033[0;31m' | |
| GREEN='\033[0;32m' | |
| YELLOW='\033[1;33m' | |
| BLUE='\033[0;34m' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # create these functions in some bash file to be imported in the crontab | |
| # crontab in macos is weird and cannot load normal zsh functions. | |
| # cat ~/.shell_functions | |
| function base_run_chain() { | |
| chain=$1 | |
| port=$2 | |
| sync=$3 | |
| polkadot --chain $chain \ | |
| --sync $sync \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // rought file paths writte above each item. | |
| // pallet-balances::weights.rs | |
| trait WieghtInfo { | |
| fn transfer() -> u32; | |
| } | |
| // pallet-balances | |
| trait Config { | |
| type WeightInfo: weights::WeightInfo; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { ApiPromise, WsProvider } from "@polkadot/api"; | |
| import axios from "axios"; | |
| import { writeFileSync } from "fs"; | |
| import { strict as assert } from 'assert' | |
| async function findLastNicksBlock(block: number, key: string) { | |
| while (true) { | |
| let next = block + 1; | |
| const data = await axios.post(`https://kusama.api.subscan.io/api/scan/block`, { | |
| "block_num": next |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { ApiPromise, WsProvider } from "@polkadot/api"; | |
| import { BN } from "@polkadot/util"; | |
| import axios from "axios"; | |
| async function scrapeSubscan(api: ApiPromise) { | |
| const [from, to] = [3899547, 4876134]; | |
| const DOTS = new BN(10000000000); | |
| const HUNDRED = new BN(100); | |
| const REFUND = new BN(new BN(495).mul(DOTS).div(HUNDRED)) | |
| const key = process.env['API'] || "DEFAULT_KEY"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This must be a STASH account. | |
| const yourAccount = "xxx"; | |
| // This is your node in the bags list. Use `node.prev` and `.next` to see where you are located. | |
| const node = await api.query.bagsList.listNodes(yourAccount); | |
| // This is the bag to which you belong. | |
| const bagUpper = api.createType("Balance", node.toJSON().bagUpper); | |
| // This is the list of all the bags. | |
| const bagThresholds = api.consts.bagsList.bagThresholds.map((x) => api.createType('Balance', x)); | |
| // | |
| // This function will always indicate that for an account with stake (aka, weight) `w`, to which bag they belong to. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1 kianenigma@build-host[13:46] ~/substrate-sync (git)-[2ef0f1cb2] % cargo run -- --tmp --dev :( | |
| Finished dev [unoptimized + debuginfo] target(s) in 0.62s | |
| Running `target/debug/substrate --tmp --dev` | |
| 2021-01-13 13:47:34 Running in --dev mode, RPC CORS has been disabled. | |
| 2021-01-13 13:47:34 Substrate Node | |
| 2021-01-13 13:47:34 ✌️ version 2.0.0-2ef0f1cb2-x86_64-linux-gnu | |
| 2021-01-13 13:47:34 ❤️ by Parity Technologies <[email protected]>, 2017-2021 | |
| 2021-01-13 13:47:34 📋 Chain specification: Development | |
| 2021-01-13 13:47:34 🏷 Node name: raspy-wealth-5222 | |
| 2021-01-13 13:47:34 👤 Role: AUTHORITY |
NewerOlder