Skip to content

Instantly share code, notes, and snippets.

View JoshOrndorff's full-sized avatar
🌳

Joshy Orndorff JoshOrndorff

🌳
View GitHub Profile
@JoshOrndorff
JoshOrndorff / Errata.md
Last active January 12, 2024 13:08
Errata for UTXO Wallet Assignment

This document contains corrections to mistakes in the UTXO wallet assignmetn for PBA's Hong Kong cohort.

Incorrect comment about input and output value

The doc comments on the transaction type incorrectly state that the output value should exceed the input value. This is exactly backwards. Luckily this is only a comment mistake, the tests are correct and this should not affect your programmin experience at all.

/// A Bonecoin Transaction
@JoshOrndorff
JoshOrndorff / reflections.md
Last active August 28, 2023 18:13
Week 2 Reflections

Joshy's reflections on the Blockchain and Smart Contracts hybrid module as delivered during week 2 of PBA3 in Berkeley 2023.

Content Sequencing and Hybrid Module Approach

For the UCB cohort we largely re-wrote the smart contracts module, moving away from a narrow focus on ink! to a much broader perspective across the blockchain space and historically. We also integrated this content tightly with the existing blockchain module to create a week-long hybrid module. The motivation is that the idea of a smart contract predates blockchain and was a goal well before it was realized on blockchains.

I think this ordering makes a lot of sense and should be kept. However, I think the idea of one massive module can be improved upon. Thank you Nuke and Pauline for the opportunity to teach it as a monolith until the proper delineations became clear.

UCB Content Order - Reminder

@JoshOrndorff
JoshOrndorff / GrandpaBoardGame.md
Created January 5, 2023 02:06
Grandpa - The Board Game

Grandpa - The Board Game

  • Players: 5+ (4 actual players, 1 author)
  • Play time: 15 - 60 min
  • Materials: A large whiteboard and many colored markers

Overview

Grandpa is a Byzantine fault tolerant blockchain finality gadget (formal spec). This collaborative board game allows players to learn and practice the Grandpa protocol while also having fun together.

@JoshOrndorff
JoshOrndorff / Incrementor.sol
Created October 12, 2021 19:22
Solidity Snippets for Frontier Workshop 2021
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity >=0.8.0;
contract Incrementor {
uint private value;
address private last_caller;
function inc() public {
value += 1;
last_caller = msg.sender;
@JoshOrndorff
JoshOrndorff / gist:90e5ca330eb09c7ed0783c521bff745b
Created January 5, 2021 18:57
Command to remove a specific extrinsic
$ curl <endpoint> -H "Content-Type:application/json;charset=utf-8" -d '{
"jsonrpc":"2.0",
"id":1,
"method":"author_removeExtrinsic",
"params": ["0x22ab0100040a00160000000000000000000000000000000000000000000000000000000000000000f6701e1600000000000000000000000000000000000000000000000000000000127a0000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000e2a7010060c06040523480156200001157600080fd5b50604051620068b8380380620068b883398181016040526101008110156200003857600080fd5b815160208301516040808501516060860151608087015160a088015160c089015160e08a0180519651989a9799959894979396929591949391820192846401000000008211156200008857600080fd5b9083019060208201858111156200009e57600080fd5b8251640100000000811182820188101715620000b957600080fd5b82525081516020918201929091019080838360005b83811015620000e8578181015183820152602001620000ce565b50505050905090810190601f168015620001165780820380516001836020036101000a031916815260200191505b50604052505060
@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 <admin@parity.io>, 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)
@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 / 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 / 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_
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