Skip to content

Instantly share code, notes, and snippets.

@crystalin
crystalin / kusama-moonsama-relay-raw-specs.json
Last active March 3, 2024 08:08
Stagenet Network Specs
This file has been truncated, but you can view the full file.
{
"name": "Moonsama Relay",
"id": "kusama_moonsama",
"chainType": "Live",
"bootNodes": [
"/dns4/viro-moon-moondev-1-moonsama-relay-validator-1.rv.moondev.network/tcp/30334/p2p/12D3KooWEiHi49QReqLKVwXjNCKfKJcsrBf63gK5TLnhP3jWtL8o",
"/dns4/uko-moon-moondev-1-moonsama-relay-validator-1.rv.moondev.network/tcp/30334/p2p/12D3KooWFDuE42myBNZd3LvcxNvgaX4ahgpaARzB1uNE37GLssAA",
"/dns4/deo-moon-moondev-1-moonsama-relay-validator-1.rv.moondev.network/tcp/30334/p2p/12D3KooWJWiZDYTs8SgKZqCyqkT4bE7YbCkkEWP8uHUtCuNUkaSL",
"/dns4/fro-moon-moondev-1-moonsama-relay-validator-1.rv.moondev.network/tcp/30334/p2p/12D3KooWLNUzTGPHzGuPYqs84EiwsH9tgWYb1e8ydPUKPW31ChWH"
],
@crystalin
crystalin / gist:d36a1041dbf2fe1184e8f62a5c8fdb55
Last active August 31, 2023 10:00
Moonbeam Mandatory Weight - Payout - Post RT2500
#4332001: Real => 7,778,731 [ 143 compounds] | RT2500 => 2,056,713 [ 143 compounds]
#4332002: Real => 8,634,576 [ 163 compounds] | RT2500 => 2,109,194 [ 163 compounds]
#4332003: Real => 4,093,520 [ 41 compounds] | RT2500 => 1,821,436 [ 41 compounds]
#4332004: Real => 3,594,826 [ 73 compounds] | RT2500 => 843,149 [ 73 compounds]
#4332005: Real => 10,408,696 [ 197 compounds] | RT2500 => 2,177,517 [ 197 compounds]
#4332006: Real => 4,289,821 [ 86 compounds] | RT2500 => 996,587 [ 86 compounds]
#4332007: Real => 4,350,057 [ 49 compounds] | RT2500 => 1,849,532 [ 49 compounds]
#4332008: Real => 8,464,713 [ 159 compounds] | RT2500 => 2,089,894 [ 159 compounds]
#4332009: Real => 10,040,629 [ 184 compounds] | RT2500 => 2,145,940 [ 184 compounds]
#4332010: Real => 510,640 [ 7 compounds] | RT2500 => 247,434 [ 7 compounds]
@crystalin
crystalin / weights-paritydb-alphanet.rs
Created June 22, 2023 07:27
Alphanet/Moonriver/Moonbeam Storage Benchmark (c6i.4xlarge, 3000 IOPS)
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-06-18 (Y/M/D)
//! HOSTNAME: `ip-10-0-0-198`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz`
//!
//! DATABASE: `ParityDb`, RUNTIME: `Moonbase Alpha`
//! BLOCK-NUM: `BlockId::Number(4564299)`
//! SKIP-WRITE: `false`, SKIP-READ: `false`, WARMUPS: `1`
//! STATE-VERSION: `V0`, STATE-CACHE-SIZE: ``
//! WEIGHT-PATH: `/home/ubuntu/projects/moonbeam/weights-paritydb-alphanet.rs`
@crystalin
crystalin / licenses.txt
Created June 21, 2023 18:29
Moonbeam Cargo License
(MIT OR Apache-2.0) AND Unicode-DFS-2016 (1): unicode-ident
0BSD OR Apache-2.0 OR MIT (1): adler
Apache-2.0 (197): approx, binary-merkle-tree, clang-sys, codespan-reporting, environmental, ethereum, evm, evm-core, evm-gasometer, evm-runtime, fdlimit, finality-grandpa, fork-tree, fp-account, fp-consensus, fp-ethereum, fp-evm, fp-rpc, fp-self-contained, fp-storage, fragile, frame-benchmarking, frame-benchmarking-cli, frame-election-provider-solution-type, frame-election-provider-support, frame-executive, frame-metadata, frame-remote-externalities, frame-support, frame-support-procedural, frame-support-procedural-tools, frame-support-procedural-tools-derive, frame-system, frame-system-rpc-runtime-api, frame-try-runtime, gethostname, hash-db, hash-db, hash256-std-hasher, hmac-drbg, libsecp256k1, libsecp256k1-core, libsecp256k1-gen-ecmult, libsecp256k1-gen-genmult, linked_hash_set, memory-db, mick-jaeger, mmr-rpc, nalgebra-macros, normalize-line-endings, orml-traits, orml-utilities, orml-xcm-support, orml-xtokens,
system.fillBlock: 0,0
system.remark: 0,1
system.setHeapPages: 0,2
system.setCode: 0,3
system.setCodeWithoutChecks: 0,4
system.setStorage: 0,5
system.killStorage: 0,6
system.killPrefix: 0,7
system.remarkWithEvent: 0,8
utility
@crystalin
crystalin / README.md
Last active February 12, 2022 12:58
Script to listen for balance transfer (Ethereum & Substrate)

Intro

There are multiple scenarios to trigger MOVRs transfer. You will find quick description of those below. The web3 SDK (or Ethereum API) is not sufficient to monitor all the transfers, you should use the PolkadotJs SDK (also known as the Substrate API)

Vocabulary

First, we have to consider there are 2 elements associated with a block:

  • Extrinsics (those can be considered "transactions", they are ordered by execution)
  • Events (those are generated from the extrinsic, and can be multiple per extrinsic. They are also ordered)
@crystalin
crystalin / playing-lights.html
Last active August 12, 2021 13:08
Playing with adafruit lights on Raspberry with python server
<head>
<script>
let actions = [];
function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
function setLight(position, red, blue, green) {
curl https://rpc.testnet.moonbeam.network -H "Content-Type:application/json;charset=utf-8" -d '{
"jsonrpc":"2.0",
"id":1,
"method":"author_removeExtrinsic",
"params": [[{"extrinsic": "0x22ab0100040a00160000000000000000000000000000000000000000000000000000000000000000f6701e1600000000000000000000000000000000000000000000000000000000127a0000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000e2a7010060c06040523480156200001157600080fd5b50604051620068b8380380620068b883398181016040526101008110156200003857600080fd5b815160208301516040808501516060860151608087015160a088015160c089015160e08a0180519651989a9799959894979396929591949391820192846401000000008211156200008857600080fd5b9083019060208201858111156200009e57600080fd5b8251640100000000811182820188101715620000b957600080fd5b82525081516020918201929091019080838360005b83811015620000e8578181015183820152602001620000ce565b50505050905090810190601f1680156200011657808203805160018360200361010
{
"jsonrpc": "2.0",
"result": [
"0x696c040a000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001bb7000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000031696080604052600380546001600160401b03191690553480156200002157600080fd5b50604051620019cc380380620019cc833981810160405260808110156200004757600080fd5b5080516020820151604083015160609093015191929091838383838163ffffffff8116620000a75760405162461bcd60e51b8152600401808060200182810382526027815260200180620019436027913960400191505060405180910390fd5b60208163ffffffff1610620000ee5760405162461bcd60e51b81526004018080602001828103825260228152602001806200198a6022913960400191505060405180910390fd5b6000805463ffffffff191663ffffffff83161781556002805460018181019092557f2fe54c60d3acabf3343a35b6eba15db4821b340f76e741e2249685ed4899af6c600080516020620019028339815191529091018190558154808301835592829052600080516020620019ac8339815191529
This file has been truncated, but you can view the full file.
{
"name": "Moonbase Parachain Local Testnet",
"id": "local_testnet",
"chainType": "Local",
"bootNodes": [],
"telemetryEndpoints": null,
"protocolId": null,
"properties": null,
"relay_chain": "local_testnet",
"para_id": 1000,