Skip to content

Instantly share code, notes, and snippets.

View JoshOrndorff's full-sized avatar
🌳

Joshy Orndorff JoshOrndorff

🌳
View GitHub Profile
@JoshOrndorff
JoshOrndorff / code.js
Created September 9, 2019 16:51
Template Module frontend
import React, { useState, useEffect } from "react";
import { Form, Input, Grid, Card, Statistic } from "semantic-ui-react";
import TxButton from "./TxButton";
export default function TemplateModule(props) {
const { api, accountPair } = props;
const [status, setStatus] = useState("");
const [currentValue, setCurrentValue] = useState(0);
@JoshOrndorff
JoshOrndorff / notes.md
Last active September 24, 2019 16:09
Start local network v2.0 draft

These are my notes trying to figure out how to update my local testnet document for Substrate master. I haven't been successful yet.

Reproducability

In case any of these issues are version related, I'm using Substrate, node-template, and subkey from 13fc71c6 and I'm using polkadot-js apps from 75bc4f3d

Here are the keys I've tried to use in case you want to use the exact same keys. Also feel free t oconfirm that I've recorded them correctly by verifying them with subkey inspect //Alice and subkey -e inspect //Alice etc.

Alice SR25519

Secret Key URI `//Alice` is account:
@JoshOrndorff
JoshOrndorff / QuickNDirtyAutomation.js
Created October 7, 2019 16:40
Substrate Query Script
const { ApiPromise } = require('@polkadot/api');
const testKeyring = require('@polkadot/keyring/testing');
const aliceAddr = '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY';
const alicePair = testKeyring.default().getPair(aliceAddr);
/**
* Sends a transaction ot the chain returning a promise.
* When the transaction is finalized, resolve to the list of events received.
* When the transaction fails, reject relaying the error message.
@JoshOrndorff
JoshOrndorff / customSpecRaw.json
Last active October 18, 2019 19:12
Rust Belt Rust Workshop Chainspec
{
"name": "Local Testnet",
"id": "local_testnet",
"bootNodes": [
"/ip4/45.55.48.79/tcp/30333/p2p/QmbkCJtvy5eAh7HzKLejDzWWgXKs4QF1ry5akAC5UU2AmC"
],
"telemetryEndpoints": null,
"protocolId": null,
"properties": null,
"consensusEngine": null,
@JoshOrndorff
JoshOrndorff / backtrace
Created April 1, 2020 13:34
Tokio Panic Backtrace
Version: 2.0.0-alpha.5-da88e4a-x86_64-linux-gnu
0: sp_panic_handler::set::{{closure}}
1: std::panicking::rust_panic_with_hook
at src/libstd/panicking.rs:476
2: rust_begin_unwind
at src/libstd/panicking.rs:380
3: core::panicking::panic_fmt
at src/libcore/panicking.rs:85
4: core::option::expect_failed
error[E0599]: no method named `clone` found for struct `sc_consensus_pow::PowBlockImport<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u32, sp_runtime::traits::BlakeTwo256>, sp_runtime::OpaqueExtrinsic>, alloc::sync::Arc<sc_client::client::Client<sc_client_db::Backend<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u32, sp_runtime::traits::BlakeTwo256>, sp_runtime::OpaqueExtrinsic>>, sc_client::call_executor::LocalCallExecutor<sc_client_db::Backend<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u32, sp_runtime::traits::BlakeTwo256>, sp_runtime::OpaqueExtrinsic>>, sc_executor::native_executor::NativeExecutor<service::Executor>>, sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u32, sp_runtime::traits::BlakeTwo256>, sp_runtime::OpaqueExtrinsic>, utxo_runtime::RuntimeApi>>, sc_client::client::Client<sc_client_db::Backend<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u32, sp_runtime::traits::BlakeTwo2
@JoshOrndorff
JoshOrndorff / error.txt
Created May 4, 2020 19:01
UTXO fail when removing session keys
$ cargo check
Compiling utxo-workshop v2.0.0-alpha.5 (/home/joshy/ProgrammingProjects/utxo-workshop/node)
Checking utxo-runtime v2.0.0-alpha.6 (/home/joshy/ProgrammingProjects/utxo-workshop/runtime)
Checking sha3pow v2.0.0-alpha.6 (/home/joshy/ProgrammingProjects/utxo-workshop/node/sha3pow)
error[E0599]: no method named `build` found for struct `sc_service::builder::ServiceBuilder<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u32, sp_runtime::traits::BlakeTwo256>, sp_runtime::OpaqueExtrinsic>, utxo_runtime::RuntimeApi, sc_client::client::Client<sc_client_db::Backend<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u32, sp_runtime::traits::BlakeTwo256>, sp_runtime::OpaqueExtrinsic>>, sc_client::call_executor::LocalCallExecutor<sc_client_db::Backend<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u32, sp_runtime::traits::BlakeTwo256>, sp_runtime::OpaqueExtrinsic>>, sc_executor::native_executor::NativeExecutor<service::Executor>>, sp_
@JoshOrndorff
JoshOrndorff / build.log
Created August 4, 2020 19:05
Rococo Collator Build Error
$ cargo build --release -p rococo-collator
Downloaded crypto-mac v0.8.0
Downloaded block-buffer v0.9.0
Downloaded opaque-debug v0.3.0
Downloaded aes v0.4.0
Downloaded generic-array v0.14.3
Downloaded ghash v0.3.0
Downloaded digest v0.9.0
Downloaded cpuid-bool v0.1.2
Downloaded stream-cipher v0.4.1
@JoshOrndorff
JoshOrndorff / Alice.log
Created September 9, 2020 15:37
Debugging transaction revalidation
joshy@pop-os:~/ProgrammingProjects/substrate-node-template$ ./target/release/node-template --chain local --alice --base-path /tmp/alice --force-authoring -ltxpool=trace
2020-09-09 11:27:10.617 main INFO sc_cli::runner Substrate Node
2020-09-09 11:27:10.617 main INFO sc_cli::runner ✌️ version 2.0.0-rc6-fcd577e-x86_64-linux-gnu
2020-09-09 11:27:10.617 main INFO sc_cli::runner ❤️ by Substrate DevHub <https://github.com/substrate-developer-hub>, 2017-2020
2020-09-09 11:27:10.617 main INFO sc_cli::runner 📋 Chain specification: Local Testnet
2020-09-09 11:27:10.617 main INFO sc_cli::runner 🏷 Node name: Alice
2020-09-09 11:27:10.617 main INFO sc_cli::runner 👤 Role: AUTHORITY
2020-09-09 11:27:10.617 main INFO sc_cli::runner 💾 Database: RocksDb at /tmp/alice/chains/local_testnet/db
2020-09-09 11:27:10.617 main INFO sc_cli::runner ⛓ Native runtime: node-template-1 (node-template-1.tx1.au1)
2020-09-09 11:27:10.718 main INFO sc_service::client::client 🔨 Initializing Genesis block/state (state: 0x6325…a0b3, h
@JoshOrndorff
JoshOrndorff / Alice.log
Created November 18, 2020 17:46
Parachains V1 - Only one collator authors
$ ./target/release/polkadot --chain rococo-local-cfde-real-overseer.json --alice --tmp --discover-local
2020-11-18 10:09:03 Parity Polkadot
2020-11-18 10:09:03 ✌️ version 0.8.26-cfde0767-x86_64-linux-gnu
2020-11-18 10:09:03 ❤️ by Parity Technologies <[email protected]>, 2017-2020
2020-11-18 10:09:03 📋 Chain specification: Rococo Local Testnet
2020-11-18 10:09:03 🏷 Node name: Alice
2020-11-18 10:09:03 👤 Role: AUTHORITY
2020-11-18 10:09:03 💾 Database: RocksDb at /tmp/substrateytfeEs/chains/rococo_local_testnet/db
2020-11-18 10:09:03 ⛓ Native runtime: rococo-10 (parity-rococo-v1-0.tx0.au0)
2020-11-18 10:09:05 🔨 Initializing Genesis block/state (state: 0x10aa…7cc8, header-hash: 0x7488…9bca)