Skip to content

Instantly share code, notes, and snippets.

View garethtdavies's full-sized avatar

Gareth Davies garethtdavies

View GitHub Profile
@garethtdavies
garethtdavies / coda-blocks.csv
Created June 20, 2020 21:46
All blocks between epochs 1 and 11
canonical creator dateTime length epoch slot globalSlot stateHash
TRUE 4vsRCVsHK6JzHAehoLDZMKwX4 2020-06-09T19:36:00.000Z 130 1 2 482 D2rcXVQbdASpdRCygkAmZ3A2J
TRUE 4vsRCVP4z8nJZXCqSovNjHmEX 2020-06-09T19:42:00.000Z 131 1 4 484 D2rcXVQbdWSHmQgSkoprCQdCu
TRUE 4vsRCVaJmjRqg6SvTcMLwNfpT 2020-06-09T19:54:00.000Z 132 1 8 488 3j7Fqw9d9wEtDbvBFe1kuoRBS
TRUE 4vsRCVsHK6JzHAehoLDZMKwX4 2020-06-09T20:12:00.000Z 133 1 14 494 D2rcXVQbboLnXatZARpTjMiEX
TRUE 4vsRCVP4z8nJZXCqSovNjHmEX 2020-06-09T20:27:00.000Z 134 1 19 499 D2rcXVQbcV62dnoNmy1jDqesE
TRUE 4vsRCVyZyY1cuHruj2HqxW6V7 2020-06-09T20:39:00.000Z 135 1 23 503 3j7Fqw9esLnj4F1Wo1e7GjPnA
TRUE 4vsRCVaJmjRqg6SvTcMLwNfpT 2020-06-09T20:42:00.000Z 136 1 24 504 D2rcXVQa7xXohceXR9ddHb455
TRUE 4vsRCVVKs7iC2JHNRyNrYyKPT 2020-06-09T20:48:00.000Z 137 1 26 506 D2rcXVQYd6T4Q3mGUQrsqmfh8
TRUE 4vsRCVsHK6JzHAehoLDZMKwX4 2020-06-09T21:18:00.000Z 138 1 36 516 D2rcXVQd7gPBbfpr65DjsCyBS
@garethtdavies
garethtdavies / coda.blocks.csv
Created June 18, 2020 15:05
List of all blocks seen
We can't make this file beautiful and searchable because it's too large.
canonical,creator,dateTime,blockchainLength,receivedTime,stateHash
true,4vsRCVyZyY1cuHruj2HqxW6V7QsUgMxC8D4vprr8QkvkDGAcceibvmrvW6oVKFRK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bKX4CKiFpNKi22HKaTQ57ryXYMCkzPbujsA1USD9ZeB7npMRY","Fee Excess":{"magnitude":"40000000","sgn":["Pos"]},"Supply Increase":"0"},{"Work_id":918613940,"Source":"4mKBT3x3Hj2L6qhfq9eDz9iqsWwc1xE3NHqqCZJPdY6kPdA8ckfDdZpCgGE5TV8RrPeeXBeR3KuN2VUuzE3kRD42GML6BMiezWEsfSPeaz3yf9qjMdgL8RGHse2it1v3q15TSkovfPp8qKn2WywPyCjaeyWA2yjvMU5ahWaEKkt7BkBifGEkPxAh7xgBYzaVN7ijK31eTR8vF
@garethtdavies
garethtdavies / docker-run-command.sh
Last active June 10, 2020 14:04
Docker Run Coda Daemon
docker run -d --name coda \
-e "CODA_PRIVKEY_PASS=xxxxxx" \
--mount type=bind,source="$(pwd)"/keys,target=/root/keys \
-p 8302:8302 \
-p 8303:8303 \
-p 3085:3085 \
--restart always \
codaprotocol/coda-daemon:0.0.12-beta-feature-bump-genesis-timestamp-3e9b174 daemon \
-block-producer-key /root/keys/my-wallet \
-coinbase-receiver <PUBLIC_KEY> \
@garethtdavies
garethtdavies / crash.txt
Created April 3, 2020 22:48
Coda docker
docker run --publish 3085:3085 -it codaprotocol/coda-demo:0.0.12-beta-wallet-custom-onboarding-2-f193685
2020-04-03 22:46:24 UTC [Info] Coda daemon is booting up; built with commit "f19368523b05d6cb430fe3f6ca1b6c9252b36bb4" on branch "wallet/custom-onboarding-2"
2020-04-03 22:46:24 UTC [Info] Daemon will expire at "2024-12-10 14:00:00-07:00"
2020-04-03 22:46:24 UTC [Info] Booting may take several seconds, please wait
2020-04-03 22:46:24 UTC [Info] Looking for the genesis tar file "coda_genesis_f1936852_5f69e1300e9b0392.tar.gz"
2020-04-03 22:46:24 UTC [Info] Found genesis tar file at "/var/lib/coda" and extracted it to $path
path: "/root/.coda-config/coda_genesis_f1936852_5f69e1300e9b0392"
2020-04-03 22:46:24 UTC [Info] Successfully retrieved genesis ledger and genesis proof from "/var/lib/coda"
2020-04-03 22:46:25 UTC [Fatal] Unhandled top-level exception: $exn
Generating crash report
@garethtdavies
garethtdavies / zcash-metrics.py
Last active December 4, 2020 04:58
Outputs aggregated metrics from the Zcash blockchain
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Output stats from Zcash blockchain using Blocksci
Uses https://github.com/cryptolu/BlockSci for Zcash Blocksci adaptation
Credit @st4d https://github.com/str4d for transaction type detection
"""
import blocksci
import os
@garethtdavies
garethtdavies / transaction_timer.py
Last active September 10, 2019 21:56
Time a Coda transaction
import asyncio
import time
import CodaClient
import datetime
coda = CodaClient.Client(graphql_host="localhost", graphql_port="8000")
# This currently responds to all tx for the provided public key on L#33 - it could be filtered to listen for payment id
async def blockReceived(message):
receivedTime = datetime.datetime.now()
@garethtdavies
garethtdavies / mongo-memo.json
Created September 8, 2019 20:19
Extract matching memo data from Coda blocks
db.getCollection("blocks").find({
"transactions.userCommands": {
"$elemMatch": {
"memo": "2pn2vgS9sRdjnwZqRDndxVdGzeocYEwyJcHC1zbTgqrkmTnCFTA4MU"
}
}
});
@garethtdavies
garethtdavies / SnarkProducers.py
Last active August 31, 2019 04:04
Parses the Coda GraphQL API to get public keys for those producing SNARK work
# A super quick "unofficial" script to parse the GraphQL API to get public keys for those producing SNARK work
# Install dependencies and run with `python3 SnarkProducers.py`
# You'll need to be running the GraphQL API see here for quick setup https://codaprotocol.com/docs/developers/graphql-api/
# and here for a detailed overview https://garethtdavies.com/crypto/first-steps-with-coda-graphql-api.html and update line 14 if required
# Your results may vary depending on how many blocks your node has seen
# Dependencies
# >=Python 3.5
# pip3 install git+https://github.com/CodaProtocol/coda-python-client.git
# pip3 install pandas
@garethtdavies
garethtdavies / fully-shielded-sapling-tx.json
Created August 11, 2019 20:27
Fully Shielded Sapling Transaction
{
"txid": "5328354a0b14c95b1f8ac26ec99c7b365638cd877a04aa3fb27d19deedc90fb7",
"overwintered": true,
"version": 4,
"versiongroupid": "892f2085",
"locktime": 0,
"expiryheight": 572130,
"vin": [
],
"vout": [