Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature bsc run etl #3

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ coverage.xml
.venv
venv/
ENV/
.vscode/
4 changes: 2 additions & 2 deletions blockchainetl/exporters.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

import decimal
import six

from typing import cast

class BaseItemExporter(object):

Expand Down Expand Up @@ -210,4 +210,4 @@ def to_unicode(text, encoding=None, errors='strict'):
'object, got %s' % type(text).__name__)
if encoding is None:
encoding = 'utf-8'
return text.decode(encoding, errors)
return cast(bytes,text).decode(encoding,errors)
4 changes: 2 additions & 2 deletions blockchainetl/streaming/streamer.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@
# SOFTWARE.


from io import TextIOWrapper
import logging
import os
import time

from blockchainetl.streaming.streamer_adapter_stub import StreamerAdapterStub
from blockchainetl.file_utils import smart_open
from blockchainetl.file_utils import NoopFile, smart_open


class Streamer:
Expand Down Expand Up @@ -133,7 +134,6 @@ def read_last_synced_block(file):
with smart_open(file, 'r') as last_synced_block_file:
return int(last_synced_block_file.read())


def write_to_file(file, content):
with smart_open(file, 'w') as file_handle:
file_handle.write(content)
502 changes: 502 additions & 0 deletions blocks.csv

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions ethereumetl/service/eth_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ def get_block_range_for_timestamps(self, start_timestamp, end_timestamp):
class BlockTimestampGraph(object):
def __init__(self, web3):
self._web3 = web3
from web3.middleware import geth_poa_middleware
self._web3.middleware_stack.inject(geth_poa_middleware, layer=0)

def get_first_point(self):
# Ignore the genesis block as its timestamp is 0
Expand Down
Empty file added get-blocks.io-transactions.csv
Empty file.
502 changes: 502 additions & 0 deletions get-blocks.io.csv

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions getblock-io-transactions-date-range.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12847328,12853698
12 changes: 12 additions & 0 deletions pyrightconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"venv": "/Users/prasanna/codeBase/ethereum-etl/.venv/bin/python",
"pythonVersion": "3.9",
"include": [
"blockchainetl",
"ethereumetl",
"tests",
"schemas"
],
"useLibraryCodeForTypes": true,
"typeCheckingMode": "basic"
}
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def read(fname):
],
keywords='ethereum',
# web3.py doesn't work on 3.5.2 and less (https://github.com/ethereum/web3.py/issues/1012)
python_requires='>=3.5.3,<3.8.0',
# python_requires='>=3.5.3,<3.8.0',
install_requires=[
'web3==4.7.2',
'eth-utils==1.3.0',
Expand Down
Empty file added transactions.csv
Empty file.