Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Bitcoin Core RPC client version v22.0.0
wallet="xxx-DOT-IBTC"
address="xxx"
redeemid="xxx"
rawtx=$(bitcoin-cli -rpcwallet=$wallet createrawtransaction "[]" "[{\"$address\":0.01},{\"data\":\"$redeemid\"}]")
echo $rawtx
This file has been truncated, but you can view the full file.
{
"name": "interBTC",
"id": "rococo_testnet",
"chainType": "Live",
"bootNodes": [
"/ip4/127.0.0.1/tcp/30333/p2p/12D3KooWLEpwpuMvLswBGmWDaZYLgizwD7VKquGckiQYoaFRNbyb"
],
"telemetryEndpoints": null,
"protocolId": null,
"properties": {
@gregdhill
gregdhill / oracle-offline.txt
Created July 19, 2021 09:33
Oracle Offline
This file has been truncated, but you can view the full file.
[2021-07-16T07:36:00Z DEBUG jsonrpsee_ws_client::client] [backend]: recv subscription JsonRpcNotifResponse { jsonrpc: TwoPointZero, params: JsonRpcNotificationParamsAlloc { subscription: Str("x19UkqikqeTjDyhM"), result: Object({"inBlock": String("0x5d33b1a9ba5dc21c4bfcbe5fdfe57db7cfc2ccb2907d46e4d65154bec80f350b")}) } }
[2021-07-16T07:36:01Z DEBUG jsonrpsee_ws_client::client] [backend]: recv subscription JsonRpcNotifResponse { jsonrpc: TwoPointZero, params: JsonRpcNotificationParamsAlloc { subscription: Str("xfCWvw0yxD9vqjd0"), result: Object({"digest": Object({"logs": Array([String("0x066175726120ce33281000000000"), String("0x05617572610101f21d0c98c36e3bb07bd92bca0053634d2e1c63c648f6ccad7ac929b37e750e278e9d5916012522da4aec30a462b6c41098d717011fcbbe57a51c690b70c9038b")])}), "extrinsicsRoot": String("0x21040eb049e3aeb53f10be5f7bcb18d1c8acb11acc39bdbaa770636e99a355d5"), "number": String("0xae6d7"), "parentHash": String("0xf25e6263c7ea2201354f1963ffc892006d7d94ed3dd064c9853c5caf499f39c7"), "stateRoot": String("0
@gregdhill
gregdhill / staking.py
Last active June 25, 2021 13:46
Staking Distribution
class StakingDistribution:
def __init__(self):
self.total_stake = 0
self.reward_per_token = 0
self.stake = {}
self.reward_tally = {}
self.total_current_stake = 0
self.slash_per_token = 0
self.slash_tally = {}
@gregdhill
gregdhill / config.json
Created April 8, 2021 13:32
Polkadot Launch Config - BTC-Parachain
{
"relaychain": {
"bin": "./bin/polkadot",
"chain": "rococo-local",
"nodes": [
{
"name": "alice",
"wsPort": 9944,
"port": 30444
},
@gregdhill
gregdhill / log.txt
Created March 9, 2021 07:31
jsonrpsee-v1 background https conn over ws
Finished dev [unoptimized + debuginfo] target(s) in 0.38s
Running `target/debug/vault --bitcoin-rpc-url 'http://localhost:18332' --bitcoin-rpc-user rpcuser --bitcoin-rpc-pass rpcpassword --keyfile keyfile.json --keyname polkabtcvault --auto-register-with-faucet-url 'https://beta.polkabtc.io/api/faucet' --polka-btc-url 'wss://beta.polkabtc.io/' --network=testnet`
[2021-03-09T07:31:10Z INFO vault] Command line arguments: Opts { polka_btc_url: "wss://beta.polkabtc.io/", http_addr: "[::0]:3031", rpc_cors_domain: "*", auto_register_with_collateral: None, auto_register_with_faucet_url: Some("https://beta.polkabtc.io/api/faucet"), no_auto_auction: false, no_auto_replace: false, no_startup_collateral_increase: false, no_issue_execution: false, no_api: false, max_collateral: 1000000, collateral_timeout_ms: 5000, btc_confirmations: None, account_info: ProviderUserOpts { keyring: None, keyfile: Some("keyfile.json"), keyname: Some("polkabtcvault") }, bitcoin: BitcoinOpts { bitcoin_rpc_url: "http://localhost:183
import AppBtc from "@ledgerhq/hw-app-btc";
import Transport from '@ledgerhq/hw-transport-u2f';
import * as bitcoin from 'bitcoinjs-lib';
import {toBufferLE} from 'bigint-buffer';
const OPEN_TIMEOUT = 10000;
const LISTENER_TIMEOUT = 300;
const NETWORK = bitcoin.networks.testnet;
async function main() {
@gregdhill
gregdhill / burrow.toml
Created March 6, 2020 15:01
Hyperledger Global Forum (2020) - Workshop
BurrowDir = ".burrow"
[GenesisDoc]
GenesisTime = 2020-03-04T17:18:48Z
ChainName = "BurrowChain_365586"
[GenesisDoc.Params]
ProposalThreshold = 3
[GenesisDoc.GlobalPermissions]
[GenesisDoc.GlobalPermissions.Base]
Perms = "send | call | createContract | createAccount | bond | name | proposal | input | batch | hasBase | hasRole"
@gregdhill
gregdhill / docker-compose.yaml
Created February 18, 2020 10:39
Multi-Node Burrow Chain
# burrow spec -v4 | burrow configure -s- --pool --json
# jq 'del(.Logging)' burrow000.json > burrow.tmp && mv burrow.tmp burrow000.json
# jq 'del(.Logging)' burrow001.json > burrow.tmp && mv burrow.tmp burrow001.json
# jq 'del(.Logging)' burrow002.json > burrow.tmp && mv burrow.tmp burrow002.json
# jq 'del(.Logging)' burrow003.json > burrow.tmp && mv burrow.tmp burrow003.json
version: '3'
services:
node1:
image: &burrow hyperledger/burrow:0.29.8
@gregdhill
gregdhill / secret-santa.sh
Created December 3, 2018 10:11
Bash script to automate a secret santa name draw.
#! /bin/bash
# Instructions:
# Create two files names 'emails' and 'names'.
# Add your friends!
# Run this script in a terminal: `./secret-santa.sh`
is_mixed () {
while read -r a && read -r b <&3;
do