Skip to content

Instantly share code, notes, and snippets.

View YazzyYaz's full-sized avatar
💭
Coding 💻

Yaz Khoury YazzyYaz

💭
Coding 💻
View GitHub Profile
{"prompt":"What is the purpose of starting with the first principles of modular blockchains?","completion":" Starting with the first principles of modular blockchains enables a better understanding of their purpose and goals.\n"}
{"prompt":"What is the core difference between web2 and web3 systems?","completion":" The core difference between web2 and web3 systems is verifiability. Blockchains are open and verifiable by any individual, allowing users to operate a node and personally verify that the blockchain is operating correctly.\n"}
{"prompt":"What is the role of nodes in the security of a blockchain?","completion":" Nodes, such as full nodes, are critical to the security of a blockchain because they are responsible for ensuring that the rules of the chain are upheld.\n"}
{"prompt":"How does increasing the number of transactions a blockchain processes affect decentralization?","completion":" If it becomes more difficult to verify the chain as a result of increasing the number of transactions a blockchain p
# Note: you need to be using OpenAI Python v0.27.0 for the code below to work
import openai
import os
import requests
import base64
from pprint import pprint
import json
# Load your API key from an environment variable or secret management service
openai.api_key = ''
@YazzyYaz
YazzyYaz / init-wordle.sh
Created October 6, 2022 00:17
Initializes wordle with different rollmint and golang versions for testing commands
#!/bin/sh
#gover="1.19.1"
#gover="1.18.2"
#rollmintver="v0.45.4-optimint-v0.3.5"
#rollmintver="v0.45.4-optimint-v0.3.4"
#rollmintver="v0.45.4-optimint-v0.3.3"
rollmintver="v0.44.5-optimint-v0.3.3"
with
double_entry_book as (
select
array_to_string(outputs.addresses,',') as address,
value, block_timestamp
from `crypto-etl-bitcoin-prod.bitcoin_blockchain.transactions` join unnest(outputs) as outputs
union all
select
array_to_string(inputs.addresses,',') as address,
-value as value, block_timestamp
@YazzyYaz
YazzyYaz / nakamoto_institute_pdfs.js
Created June 8, 2020 01:21
Nakamoto Institute Literature PDF Downloader
/*
Copyright: Yaz Khoury 2020
License: MIT
Script to bulk download all PDFs on Nakamoto Institute Literature
Instructions:
Go to: https://nakamotoinstitute.org/literature/
Open DevTools in Chrome
@YazzyYaz
YazzyYaz / etc-deployment.md
Created May 28, 2020 00:06 — forked from ArjunBhuptani/etc-deployment.md
ETC Deployment Guide

ETC Deployment Guide

This guide is pieced together from docs available at https://github.com/connextproject/indra

Deploy an Indra node to production

Lets say you want to deploy an Indra payment node to https://indra.example.com (we'll call this url $DOMAINNAME)

First step: get a server via AWS or DigitalOcean or whichever cloud provider is your favorite. For best results, use the most recent LTS version of Ubuntu. Note this new server's IP address (we'll call it $SERVER_IP). Make sure it's able to connect to the internet via ports 80, 443, 4222, and 4223 (no action required on DigitalOcean, Security Group config needs to be setup properly on AWS).

Set up DNS so that $DOMAINNAME points to this server's IP address.

ubuntu@ip-10-0-0-68:~/indra$ bash ops/logs.sh node
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
mgh71z2iqkb94hkorymwniwpq indra_node.1 indra_builder:latest ip-10-0-0-68 Running Running 22 hours ago
2020-04-01T15:42:42.516Z [CF-Node] Node signer address: 0xF80fd6F5eF91230805508bB28d75248024E50F6F
2020-04-01T15:42:42.520Z [CF-Node] Node public identifier: xpub6E3tjd9js7QMrBtYo7f157D7MwauL6MWdLzKekFaRBb3bvaQnUPjHKJcdNhiqSjhmwa6TcTjV1wSDTgvz52To2ZjhGMiQFbYie2N2LZpNx6
2020-04-01T15:42:42.526Z [SwapRateMessaging] Connected message pattern "*.swap-rate.>" to function bound getLatestSwapRate
2020-04-01T15:42:42.526Z [Main] SwapRateModule dependencies initialized
2020-04-01T15:42:42.543Z [CFCoreProvider] Balance of signer address 0xF80fd6F5eF91230805508bB28d75248024E50F6F on ganache (chainId 4447): 100000000000000000000000
2020-04-01T15:42:42.543Z [CFCoreProvider] CFCore crea
2020-03-30 21:54:21 UTC Configured for Kotti Testnet using Clique engine
2020-03-30 21:54:27 UTC Public node URL: enode://44d72b3be8fd36db271dfb9ce022debe02508b5ee1fe93f5069a081ab65bffbd9b55a4cd529c89d1ee89dba9eaeb014ffd7d1f655dc18f55930
f6cf62bd66862@10.128.15.240:30000
2020-03-30 21:54:29 UTC Panic occurred, see stderr for details
====================
0: panic_hook::gen_panic_msg
1: panic_hook::set_with::{{closure}}
2020-03-18 18:16:38 UTC Syncing #835637 0x133a…69da 162.04 blk/s 0.0 tx/s 0.0 Mgas/s 4340+ 0 Qed #839978 1/25 peers 6 MiB chain 16 MiB db 9 MiB
queue 50 MiB sync RPC: 0 conn, 0 req/s, 16 µs
2020-03-18 18:16:43 UTC Syncing #836580 0xa7bd…333d 188.34 blk/s 0.0 tx/s 0.0 Mgas/s 3398+ 0 Qed #839978 1/25 peers 6 MiB chain 16 MiB db 7 MiB
queue 50 MiB sync RPC: 0 conn, 0 req/s, 16 µs
2020-03-18 18:16:48 UTC Syncing #837523 0xf523…76ea 188.52 blk/s 0.0 tx/s 0.0 Mgas/s 2454+ 0 Qed #839978 1/25 peers 6 MiB chain 16 MiB db 5 MiB
queue 50 MiB sync RPC: 0 conn, 0 req/s, 16 µs
2020-03-18 18:16:53 UTC Syncing #838462 0x3b41…1647 187.61 blk/s 0.0 tx/s 0.0 Mga
ERROR[03-13|15:44:34.914]
########## BAD BLOCK #########
Chain config: NetworkID: 6, ChainID: 6 Engine: clique EIP1014: 1705549 EIP1052: 1705549 EIP1108: 2200013 EIP1344: 2200013 EIP140: 716617 EIP145: 1705549 EIP150: 0 EIP152: 2200013 EIP155: 0 EIP160: 0 EIP161abc: 716617 EIP161d: 716617 EIP170: 716617 EIP1884: 2200013 EIP198: 716617 EIP2028: 2200013 EIP211: 716617 EIP212: 716617 EIP213: 716617 EIP214: 716617 EIP2200: 2200013 EIP658: 716617 EIP7: 0 EthashECIP1010Continue: 2000000 EthashECIP1010Pause: 0 EthashECIP1017: 5000000 EthashECIP1041: 0 EthashEIP100B: 716617 EthashEIP2: 0 EthashHomestead: 0
Number: 2058192
Hash: 0xf56efd9b074eed67c79d903c26bd0059e701c37200dc3cb86cc6c38159406d36
0: cumulative: 25352 gas: 25352 contract: 0x0000000000000000000000000000000000000000 status: 1 tx: 0x0ae3504d52fed3fdc92fb4267d6b36523d022b33663fc44b4eeddea0bcaa51cb logs: [] bloom: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000