Skip to content

Instantly share code, notes, and snippets.

View christroutner's full-sized avatar
💭
https://FullStack.cash is where I play.

Chris Troutner christroutner

💭
https://FullStack.cash is where I play.
View GitHub Profile
@christroutner
christroutner / Escrow.cash
Created October 14, 2022 02:26 — forked from cgcardona/Escrow.cash
Escrow CashScript Contract for blind escrow based on local.bitcoin.com
contract Escrow(
bytes20 sellerPHK, // Hash160 of seller's public key
bytes20 buyerPKH, // Hash160 of buyer's public key
bytes20 arbitratorPKH, // Hash160 of arbitrator's public key
bytes escrowKey // Nonce (just some unimportant random bytes unique per exchange)
) {
function spend(
sig spenderSig,
pubkey spenderPK,
datasig oracleSig,
@christroutner
christroutner / ipfs-circuit-relays-monitor.html
Last active November 30, 2021 18:01 — forked from danielhumgon/index.html
Monitor WSS IPFS Circuit Relays
<!DOCTYPE html>
<!--
This HTML creates a web page that loads an IPFS node. You can interact with it by opening a browser console and interacting
with the 'node' variable.
-->
<html lang="en">
<head>
@christroutner
christroutner / hydrated-utxos.js
Created October 18, 2021 12:37 — forked from danielhumgon/hydrated-utxos.js
Get UTXOs hydrated with SLP token information for an address.
const axios = require('axios').default
const bchAddress = 'bitcoincash:qpnty9t0w93fez04h7yzevujpv8pun204qv6yfuahk'
const SERVER = process.env.SERVER
// Get hydrated UTXOs from an address
const hydrateSLP = async (address) => {
try {
if (!address || typeof address !== 'string') {
@christroutner
christroutner / bcash-calls.js
Created October 17, 2021 13:19 — forked from danielhumgon/bcash-calls.js
JS code example for querying the SLP balance of an address.
const axios = require('axios').default
const bchAddress = 'bitcoincash:qpnty9t0w93fez04h7yzevujpv8pun204qv6yfuahk'
const SERVER = process.env.SERVER
// Get SLP balance of an address
const slpBalances = async (address) => {
try {
if (!address || typeof address !== 'string') {
const createHash = require('create-hash')
const { Avalanche, BinTools, BN } = require('avalanche')
const { KeyChain } = require('avalanche/dist/apis/evm')
const avm = require('avalanche/dist/apis/avm')
const { Signature } = require('avalanche/dist/common/credentials')
const ava = new Avalanche('api.avax.network', 443, 'https')
const bintools = BinTools.getInstance()
const xchain = ava.XChain()
@christroutner
christroutner / create-new-blockchain.ts
Created May 22, 2020 04:31 — forked from cgcardona/create-new-blockchain.ts
Script to create new subnet, add validators to subnet and create new blockchain on AVA.
// 1. Create Subnet
// 1. Create Users
// 2. Generate Conrol Keys
// 3. Export/Import User
// 2. Adding a Validator to a Subnet
// 1. Add a Validator to the Default Subnet
// 2. Add a Validator to a Non-default Subnet
// 3. Create a New Blockchain
// 1. Create the Genesis Data
// 2. Interact With the New Blockchain
@christroutner
christroutner / ipfs.service
Created January 25, 2020 03:47 — forked from MaxLaumeister/ipfs.service
systemd script for ipfs-daemon run-on-boot
[Unit]
Description=IPFS daemon
After=network.target
[Service]
### Uncomment the following line for custom ipfs datastore location
# Environment=IPFS_PATH=/path/to/your/ipfs/datastore
ExecStart=/usr/local/bin/ipfs daemon
Restart=on-failure
@christroutner
christroutner / ipfs.service
Created October 10, 2019 20:32 — forked from lordcirth/ipfs.service
IPFS systemd service with resource limits
[Unit]
Description=IPFS daemon
After=network-online.target
[Service]
ExecStart=/home/ipfs/.nix-profile/bin/ipfs daemon
User=ipfs
LimitNice=10
MemoryHigh=4G
# OOM-killer
@christroutner
christroutner / updating-a-fork.md
Last active April 18, 2022 18:13 — forked from CristinaSolana/gist:1885435
Keeping a forked repository up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@christroutner
christroutner / output.js
Created April 13, 2018 22:46 — forked from derhuerst/output.js
how fetch a GitHub user's stars
[
{
owner: 'bcoe',
repo: 'top-npm-users',
description: ':star: Generate a list of top npm users by based on monthly downloads.',
language: 'JavaScript',
isFork: false,
stargazers: 27,
watchers: 27
}