Skip to content

Instantly share code, notes, and snippets.

View medvedev1088's full-sized avatar

Evgeny Medvedev medvedev1088

View GitHub Profile
with
d0 as (
select
array_to_string(x.addresses,',') as address,
date(block_timestamp) as date,
value
from `bigquery-public-data.crypto_dogecoin.transactions` join unnest(outputs) as x
)
,daily_incomes as (
select
chain throughput time
bitcoin_cash 281 tx/sec 2018-11-10 14:34:35 UTC
dash 67 tx/sec 2018-11-11 10:21:44 UTC
dogecoin 55 tx/sec 2014-08-05 02:53:06 UTC
litecoin 27 tx/sec 2018-09-03 22:38:57 UTC
ethereum 27 tx/sec 2018-10-06 07:49:21 UTC
ethereum_classic 24 tx/sec 2019-01-13 08:09:56 UTC
bitcoin 22 tx/sec 2015-08-01 01:06:41 UTC
zcash 8 tx/sec 2018-08-03 02:08:54 UTC
{
"jsonrpc": "2.0",
"result": [
{
"action": {
"callType": "call",
"from": "0xd6e2940d8f314a865596fd5898de399cc55d8031",
"gas": "0x1068",
"input": "0x",
"to": "0x5ce65bcd84ca828497a8f60fd4043263b26b5026",
{
"jsonrpc": "2.0",
"result": [
{
"action": {
"callType": "call",
"from": "0xd6e2940d8f314a865596fd5898de399cc55d8031",
"gas": "0x1068",
"input": "0x",
"to": "0x5ce65bcd84ca828497a8f60fd4043263b26b5026",
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')
[2019-05-08 01:57:12,394] {base_task_runner.py:101} INFO - Job 35305: Subtask export_receipts_and_logs [2019-05-08 01:57:12,389] {models.py:1760} ERROR - ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
[2019-05-08 01:57:12,395] {base_task_runner.py:101} INFO - Job 35305: Subtask export_receipts_and_logs Traceback (most recent call last):
[2019-05-08 01:57:12,395] {base_task_runner.py:101} INFO - Job 35305: Subtask export_receipts_and_logs File "/opt/python3.6/lib/python3.6/site-packages/urllib3/connectionpool.py", line 600, in urlopen
[2019-05-08 01:57:12,396] {base_task_runner.py:101} INFO - Job 35305: Subtask export_receipts_and_logs chunked=chunked)
[2019-05-08 01:57:12,396] {base_task_runner.py:101} INFO - Job 35305: Subtask export_receipts_and_logs File "/opt/python3.6/lib/python3.6/site-packages/urllib3/connectionpool.py", line 384, in _make_request
[2
projects/crypto-etl-ethereum-prod/topics/crypto_ethereum.blocks
{
"type": "block",
"number": 7713656,
"hash": "0xfbdd64e0bff8f3676bd5874a734d0523bbc6e0b122658c831366fd29de278f83",
"parent_hash": "0x2d013d43a3cba4c990138c2b84ec0cb439a2c7b38e67355a6b76c1419b93edba",
"nonce": "0x908f931c06821044",
"sha3_uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"logs_bloom": "0xaa002302a240310c04c84c1ec394c03201a0880221289498d10395800841c0024882ac18200142be60516110100f020942681408182cb92141eb088004bf120a05040080a403194c0c9182c821080118180d003fd3f4204589042500140340400ccd40205b0944791408400320040c011000d800a984a40005089d954264410030222a16a804ac28122cae0380200c080964820035500d2421264800002640286b1a901751d52440e742622009488424b835c40805a2c88e6004c9401d822441f0011cb2a2520240204301001590000230106200890080090800202a0323693101376880010010004c37104944a32290714013a454024a9d6818324040700106",
apiVersion: apps/v1
kind: StatefulSet
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"apps/v1","kind":"StatefulSet","metadata":{"annotations":{},"name":"etc-prod-ss-2","namespace":"default"},"spec":{"replicas":1,"selector":{"matchLabels":{"app":"etc-prod-app-2"}},"serviceName":"etc-prod-ss-2","template":{"metadata":{"labels":{"app":"etc-prod-app-2"}},"spec":{"affinity":{"nodeAffinity":{"preferredDuringSchedulingIgnoredDuringExecution":[{"preference":{"matchExpressions":[{"key":"failure-domain.beta.kubernetes.io/zone","operator":"In","values":["us-central1-c"]}]},"weight":100}]}},"containers":[{"args":["--jsonrpc-interface=all","--jsonrpc-apis=all","--jsonrpc-port=8545","--tracing=on","-d /data","-l info","--pruning=archive","--db-compaction=ssd","--chain=classic"],"command":["./entrypoint.sh"],"image":"gcr.io/crypto-etl-clients/parity:v2.3.2","name":"parity","ports":[{"containerPort":8545,"name":"web-socket"},{"containerPort":8546,"name":"jsonrpc"},{"conta
{
"parser": {
"type": "log",
"contract_address": "0xf0ad5cad05e10572efceb849f6ff0c68f9700455",
"abi": {
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "name",
CREATE TEMP FUNCTION
DECODE_ERC721_TRANSFER(data STRING, topics ARRAY<STRING>)
RETURNS STRUCT<`from` STRING, `to` STRING, tokenId STRING>
LANGUAGE js AS """
var CRYPTOKITTY_TRANSFER = {"anonymous": false,"inputs": [{"indexed": false,"name": "from","type": "address"},{"indexed": false,"name": "to","type": "address"},{"indexed": false,"name": "tokenId","type": "uint256"}],"name": "Transfer","type": "event"};
var interface_instance = new ethers.utils.Interface([CRYPTOKITTY_TRANSFER]);
var parsedLog = interface_instance.parseLog({topics: topics, data: data});
return parsedLog.values;
CREATE TEMP FUNCTION
calc_ages(credits ARRAY<FLOAT64>, balances ARRAY<FLOAT64>)
RETURNS ARRAY<FLOAT64>
LANGUAGE js AS """
var ethdays = [];
var ages = [];
var runningEthdays = 0;
var runningAge = 0;