Skip to content

Instantly share code, notes, and snippets.

@jo-tud
jo-tud / Supply_at_block.sql
Created August 18, 2020 17:17
ETH supply at block 9193265
#standardSQL
-- MIT License
-- Copyright (c) 2018 Evgeny Medvedev, evge.medvedev@gmail.com
-- slightly modified to calculate supply and account for destroyed ETH by johannes.pfeffer@atpar.io
-- Run at https://console.cloud.google.com/marketplace/product/ethereum/crypto-ethereum-blockchain?filter=solution-type:dataset&q=ethereum%20cryptocurrency
-- Pads indexes in trace_address to 5 so trace addresses can be chronologically ordered
CREATE TEMPORARY FUNCTION normalize_trace_address(trace_address STRING)
RETURNS STRING AS ((
SELECT ARRAY_TO_STRING(ARRAY_AGG(lpadded), ',') as arr
@jo-tud
jo-tud / ETH_supply_at_block.sql
Created August 18, 2020 10:56
Calculate ETH supply at a block height
#standardSQL
-- MIT License
-- Copyright (c) 2018 Evgeny Medvedev, evge.medvedev@gmail.com
-- slightly modified to calculate supply and account for destroyed ETH by johannes.pfeffer@atpar.io
-- Run at https://console.cloud.google.com/marketplace/product/ethereum/crypto-ethereum-blockchain?filter=solution-type:dataset&q=ethereum%20cryptocurrency
with double_entry_book as (
-- debits
select to_address as address, value as value, block_number as block_height
from `bigquery-public-data.crypto_ethereum.traces`
@jo-tud
jo-tud / Supply_at_block.sql
Created August 17, 2020 22:05
Calculates ETH supply at block 10663796 using the public Google Ethereum dataset
#standardSQL
-- MIT License
-- Copyright (c) 2018 Evgeny Medvedev, evge.medvedev@gmail.com
-- slightly modified to calculate supply and account for destroyed ETH by johannes.pfeffer@atpar.io
-- Run at https://console.cloud.google.com/marketplace/product/ethereum/crypto-ethereum-blockchain?filter=solution-type:dataset&q=ethereum%20cryptocurrency
-- Calculates supply at block 10663796
with double_entry_book as (
-- debits
select to_address as address, value as value, block_number as block_height
@jo-tud
jo-tud / ETH_supply.sql
Created August 17, 2020 08:38
Calculates the exact ETH supply at most recent block
#standardSQL
-- MIT License
-- Copyright (c) 2018 Evgeny Medvedev, evge.medvedev@gmail.com
-- slightly modified to calculate supply and account for destroyed ETH by johannes.pfeffer@atpar.io
-- Run at https://console.cloud.google.com/marketplace/product/ethereum/crypto-ethereum-blockchain?filter=solution-type:dataset&q=ethereum%20cryptocurrency
with double_entry_book as (
-- debits
select to_address as address, value as value, block_number as block_height
from `bigquery-public-data.crypto_ethereum.traces`
[
"enode://…",
"enode://…",
"…"
]
@jo-tud
jo-tud / EthOn_block_example.turtle.rdf
Created December 22, 2016 10:50
Describing a block with EthOn
ethereum:Block0
a ethon:Block ;
rdfs:label "Genesis Block" ;
rdfs:comment "This is the block with block number 0. It is the Genesis Block of the Ethereum blockchain." ;
ethon:number 0 ;
ethon:blockBeneficary ethereum:Account0 ;
ethon:blockReward 5000000000000000000 ;
ethon:gasLimit 5000 ;
ethon:blockNonce "0000000000000042"^^xsd:hexBinary ;
[...]
@jo-tud
jo-tud / code.js
Created June 4, 2016 08:55 — forked from maxkfranz/code.js
Cola demo
var cy;
$(function(){ // on dom ready
cy = cytoscape({
container: document.getElementById('cy'),
style: [{"selector":"core","style":{"selection-box-color":"#AAD8FF","selection-box-border-color":"#8BB0D0","selection-box-opacity":"0.5"}},{"selector":"node","style":{"width":"mapData(score, 0, 0.006769776522008331, 20, 60)","height":"mapData(score, 0, 0.006769776522008331, 20, 60)","content":"data(name)","font-size":"12px","text-valign":"center","text-halign":"center","background-color":"#555","text-outline-color":"#555","text-outline-width":"2px","color":"#fff","overlay-padding":"6px","z-index":"10"}},{"selector":"node[?attr]","style":{"shape":"rectangle","background-color":"#aaa","text-outline-color":"#aaa","width":"16px","height":"16px","font-size":"6px","z-index":"1"}},{"selector":"node[?query]","style":{"background-clip":"none","background-fit":"contain"}},{"selector":"node:selected","style":{"border-width":"6px","border-color":"#AAD8FF","border-opacity":"0.5","background-color":"#77828C","t
1. Output of `owncloud --logwindow` or `owncloud --logfile log.txt`
...
01-30 15:41:18:937 oc_module: owncloud_stat ownclouds://abc.def.com/remote.php/webdav/Für andere/Paul - Johannes/Feuerwerk Silvester 13 4.JPG called
01-30 15:41:18:937 csync_walker: file: ownclouds://abc.def.com/remote.php/webdav/Für andere/Paul - Johannes/Feuerwerk Silvester 13 4.JPG
01-30 15:41:18:937 _csync_detect_update: ==> file: Für andere/Paul - Johannes/Feuerwerk Silvester 13 4.JPG - hash 16161904951273736124, mtime: 1388587138, fileId:
01-30 15:41:18:937 csync_statedb_get_stat_by_hash: No result record found for phash = 16161904951273736124
01-30 15:41:18:938 _csync_detect_update: file: Für andere/Paul - Johannes/Feuerwerk Silvester 13 4.JPG, instruction: INSTRUCTION_NEW <<=
01-30 15:41:18:938 oc_module: owncloud_stat ownclouds://abc.def.com/remote.php/webdav/Für andere/Paul - Johannes/Feuerwerk Silvester 13 1.JPG called
01-30 15:41:18:938 csync_walker: file: ownclouds://abc.def.com/remote.php/webdav/Für andere/Paul - Johannes/F