Add extract_tokens command

This commit is contained in:
Evgeny Medvedev
2019-04-06 20:32:26 +07:00
parent 140af3e649
commit f07752907a
23 changed files with 281 additions and 20 deletions

View File

@@ -34,6 +34,7 @@ from ethereumetl.cli.extract_csv_column import extract_csv_column
from ethereumetl.cli.extract_field import extract_field
from ethereumetl.cli.extract_geth_traces import extract_geth_traces
from ethereumetl.cli.extract_token_transfers import extract_token_transfers
from ethereumetl.cli.extract_tokens import extract_tokens
from ethereumetl.cli.filter_items import filter_items
from ethereumetl.cli.get_block_range_for_date import get_block_range_for_date
from ethereumetl.cli.get_block_range_for_timestamps import get_block_range_for_timestamps
@@ -60,6 +61,7 @@ cli.add_command(export_traces, "export_traces")
cli.add_command(export_geth_traces, "export_geth_traces")
cli.add_command(extract_geth_traces, "extract_geth_traces")
cli.add_command(extract_contracts, "extract_contracts")
cli.add_command(extract_tokens, "extract_tokens")
# streaming
cli.add_command(stream, "stream")

View File

@@ -0,0 +1,63 @@
# MIT License
#
# Copyright (c) 2018 Evgeny Medvedev, evge.medvedev@gmail.com
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
import csv
import json
import click
from blockchainetl.csv_utils import set_max_field_size_limit
from blockchainetl.file_utils import smart_open
from ethereumetl.jobs.exporters.tokens_item_exporter import tokens_item_exporter
from ethereumetl.jobs.extract_tokens_job import ExtractTokensJob
from ethereumetl.logging_utils import logging_basic_config
from ethereumetl.providers.auto import get_provider_from_uri
from ethereumetl.thread_local_proxy import ThreadLocalProxy
from web3 import Web3
logging_basic_config()
@click.command(context_settings=dict(help_option_names=['-h', '--help']))
@click.option('-c', '--contracts', type=str, required=True, help='The JSON file containing contracts.')
@click.option('-p', '--provider-uri', default='https://mainnet.infura.io', type=str,
help='The URI of the web3 provider e.g. '
'file://$HOME/Library/Ethereum/geth.ipc or https://mainnet.infura.io')
@click.option('-o', '--output', default='-', type=str, help='The output file. If not specified stdout is used.')
@click.option('-w', '--max-workers', default=5, type=int, help='The maximum number of workers.')
def extract_tokens(contracts, provider_uri, output, max_workers):
"""Extracts tokens from contracts file."""
set_max_field_size_limit()
with smart_open(contracts, 'r') as traces_file:
if contracts.endswith('.json'):
contracts_iterable = (json.loads(line) for line in traces_file)
else:
contracts_iterable = csv.DictReader(traces_file)
job = ExtractTokensJob(
contracts_iterable=contracts_iterable,
web3=ThreadLocalProxy(lambda: Web3(get_provider_from_uri(provider_uri))),
max_workers=max_workers,
item_exporter=tokens_item_exporter(output))
job.run()

View File

@@ -28,3 +28,4 @@ class EthToken(object):
self.name = None
self.decimals = None
self.total_supply = None
self.block_number = None

View File

@@ -46,8 +46,9 @@ class ExportTokensJob(BaseJob):
for token_address in token_addresses:
self._export_token(token_address)
def _export_token(self, token_address):
def _export_token(self, token_address, block_number=None):
token = self.token_service.get_token(token_address)
token.block_number = block_number
token_dict = self.token_mapper.token_to_dict(token)
self.item_exporter.export_item(token_dict)

View File

@@ -28,7 +28,8 @@ FIELDS_TO_EXPORT = [
'symbol',
'name',
'decimals',
'total_supply'
'total_supply',
'block_number'
]

View File

@@ -52,6 +52,10 @@ class ExtractContractsJob(BaseJob):
self.batch_work_executor.execute(self.traces_iterable, self._extract_contracts)
def _extract_contracts(self, traces):
for trace in traces:
trace['status'] = int(trace['status'])
trace['block_number'] = int(trace['block_number'])
contract_creation_traces = [trace for trace in traces
if trace['trace_type'] == 'create' and trace['to_address'] is not None
and len(trace['to_address']) > 0 and trace['status'] == 1]

View File

@@ -0,0 +1,42 @@
# MIT License
#
# Copyright (c) 2018 Evgeny Medvedev, evge.medvedev@gmail.com
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
from ethereumetl.jobs.export_tokens_job import ExportTokensJob
class ExtractTokensJob(ExportTokensJob):
def __init__(self, web3, item_exporter, contracts_iterable, max_workers):
super().__init__(web3, item_exporter, [], max_workers)
self.contracts_iterable = contracts_iterable
def _export(self):
self.batch_work_executor.execute(self.contracts_iterable, self._export_tokens_from_contracts)
def _export_tokens_from_contracts(self, contracts):
tokens = [contract for contract in contracts if contract.get('is_erc20') or contract.get('is_erc721')]
for token in tokens:
self._export_token(token_address=token['address'], block_number=token['block_number'])

View File

@@ -29,5 +29,6 @@ class EthTokenMapper(object):
'symbol': token.symbol,
'name': token.name,
'decimals': token.decimals,
'total_supply': token.total_supply
'total_supply': token.total_supply,
'block_number': token.block_number
}

View File

@@ -215,3 +215,25 @@ def enrich_contracts(blocks, contracts):
raise ValueError('The number of contracts is wrong ' + str(result))
return result
def enrich_tokens(blocks, tokens):
result = list(join(
tokens, blocks, ('block_number', 'number'),
[
'type',
'address',
'symbol',
'name',
'decimals',
'total_supply',
'block_number'
],
[
('timestamp', 'block_timestamp'),
('hash', 'block_hash'),
]))
if len(result) != len(tokens):
raise ValueError('The number of tokens is wrong ' + str(result))
return result

View File

@@ -1,16 +1,16 @@
import logging
from blockchainetl.jobs.exporters.console_item_exporter import ConsoleItemExporter
from blockchainetl.jobs.exporters.in_memory_item_exporter import InMemoryItemExporter
from ethereumetl.enumeration.entity_type import EntityType
from ethereumetl.jobs.export_blocks_job import ExportBlocksJob
from ethereumetl.jobs.export_receipts_job import ExportReceiptsJob
from ethereumetl.jobs.export_tokens_job import ExportTokensJob
from ethereumetl.jobs.export_traces_job import ExportTracesJob
from blockchainetl.jobs.exporters.console_item_exporter import ConsoleItemExporter
from blockchainetl.jobs.exporters.in_memory_item_exporter import InMemoryItemExporter
from ethereumetl.jobs.extract_contracts_job import ExtractContractsJob
from ethereumetl.jobs.extract_token_transfers_job import ExtractTokenTransfersJob
from ethereumetl.jobs.extract_tokens_job import ExtractTokensJob
from ethereumetl.streaming.enrich import enrich_transactions, enrich_logs, enrich_token_transfers, enrich_traces, \
enrich_contracts
enrich_contracts, enrich_tokens
from ethereumetl.thread_local_proxy import ThreadLocalProxy
from web3 import Web3
@@ -64,13 +64,14 @@ class EthStreamerAdapter:
# Export tokens
tokens = []
if self._should_export(EntityType.TOKEN):
tokens = self._export_tokens(contracts)
tokens = self._extract_tokens(contracts)
enriched_transactions = enrich_transactions(blocks, transactions, receipts)
enriched_logs = enrich_logs(blocks, logs)
enriched_token_transfers = enrich_token_transfers(blocks, token_transfers)
enriched_traces = enrich_traces(blocks, traces)
enriched_contracts = enrich_contracts(blocks, contracts)
enriched_tokens = enrich_tokens(blocks, tokens)
logging.info('Exporting with ' + type(self.item_exporter).__name__)
@@ -81,7 +82,7 @@ class EthStreamerAdapter:
(enriched_token_transfers if EntityType.TOKEN_TRANSFER in self.entity_types else []) +
(enriched_traces if EntityType.TRACE in self.entity_types else []) +
(enriched_contracts if EntityType.CONTRACT in self.entity_types else []) +
(tokens if EntityType.TOKEN in self.entity_types else [])
(enriched_tokens if EntityType.TOKEN in self.entity_types else [])
)
def _export_blocks_and_transactions(self, start_block, end_block):
@@ -154,13 +155,10 @@ class EthStreamerAdapter:
contracts = exporter.get_items('contract')
return contracts
def _export_tokens(self, contracts):
token_addresses = (contract['address'] for contract in contracts
if contract['is_erc20'] or contract['is_erc721'])
def _extract_tokens(self, contracts):
exporter = InMemoryItemExporter(item_types=['token'])
job = ExportTokensJob(
token_addresses_iterable=token_addresses,
job = ExtractTokensJob(
contracts_iterable=contracts,
web3=ThreadLocalProxy(lambda: Web3(self.batch_web3_provider)),
max_workers=self.max_workers,
item_exporter=exporter
@@ -197,4 +195,4 @@ class EthStreamerAdapter:
raise ValueError('Unexpected entity type ' + entity_type)
def close(self):
self.item_exporter.close()
self.item_exporter.close()

View File

@@ -44,6 +44,7 @@ def read_resource(resource_group, file_name):
(1755634, 1755635, 1, 'blocks_1755634_1755635', EntityType.ALL_FOR_INFURA, 'mock'),
skip_if_slow_tests_disabled([1755634, 1755635, 1, 'blocks_1755634_1755635', EntityType.ALL_FOR_INFURA, 'infura']),
(508110, 508110, 1, 'blocks_508110_508110', ['trace', 'contract', 'token'], 'mock'),
(2112234, 2112234, 1, 'blocks_2112234_2112234', ['trace', 'contract', 'token'], 'mock'),
])
def test_stream(tmpdir, start_block, end_block, batch_size, resource_group, entity_types, provider_type):
try:

View File

@@ -1,2 +1,2 @@
address,symbol,name,decimals,total_supply
0x86fa049857e0209aa7d9e616f7eb3b3b78ecfdb0,,,18,1000000000000000000000000000
address,symbol,name,decimals,total_supply,block_number
0x86fa049857e0209aa7d9e616f7eb3b3b78ecfdb0,,,18,1000000000000000000000000000,
1 address symbol name decimals total_supply block_number
2 0x86fa049857e0209aa7d9e616f7eb3b3b78ecfdb0 18 1000000000000000000000000000

View File

@@ -1,2 +1,2 @@
address,symbol,name,decimals,total_supply
0xf763be8b3263c268e9789abfb3934564a7b80054,ETH,ETH,18,6547475210000000000
address,symbol,name,decimals,total_supply,block_number
0xf763be8b3263c268e9789abfb3934564a7b80054,ETH,ETH,18,6547475210000000000,
1 address symbol name decimals total_supply block_number
2 0xf763be8b3263c268e9789abfb3934564a7b80054 ETH ETH 18 6547475210000000000

View File

@@ -0,0 +1 @@
{"type": "contract", "address": "0xdbdacfc9eb9d42559ac1efbdb40460c728139e6a", "bytecode": "0x6060604052361561008d5760e060020a600035046306fdde03811461008f578063095ea7b3146100a557806318160ddd1461012457806323b872dd1461012f578063313ce567146101dc578063475a9fa9146101f057806370a0823114610215578063721a37d21461024357806395d89b411461008f578063a9059cbb14610268578063dd62ed3e146102e7575b005b61031d6040805160208101909152600081525b90565b61038b60043560243560007319ee743d2e356d5f0e4d97cc09b96d06e933d0db63c6605267600160005085856040518460e060020a0281526004018084815260200183600160a060020a0316815260200182815260200193505050506020604051808303818660325a03f4156100025750506040515191506103179050565b6102316003546100a2565b61038b60043560243560443560008054604080517fa00bfa1100000000000000000000000000000000000000000000000000000000815260016004820152600160a060020a038781166024830152868116604483015260648201869052929092166084830152517319ee743d2e356d5f0e4d97cc09b96d06e933d0db9163a00bfa119160a482810192602092919082900301818660325a03f4156100025750506040515195945050505050565b604080516000815290519081900360200190f35b61038b6004356024356000805433600160a060020a0390811691161461039f57610002565b600160a060020a03600435166000908152600160205260409020545b60408051918252519081900360200190f35b61038b6004356024356000805433600160a060020a039081169116146103ce57610002565b61038b60043560243560007319ee743d2e356d5f0e4d97cc09b96d06e933d0db6388d5fecb600160005085856040518460e060020a0281526004018084815260200183600160a060020a0316815260200182815260200193505050506020604051808303818660325a03f4156100025750506040515191506103179050565b610231600435602435600160a060020a038281166000908152600260209081526040808320938516835292905220545b92915050565b60405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600302600f01f150905090810190601f16801561037d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b604080519115158252519081900360200190f35b50600160a060020a03821660009081526001602081905260409091208054830190556003805483019055610317565b600160a060020a038316600090815260016020526040902054821161040a57506040600020805482900390556003805482900390556001610317565b50600061031756", "function_sighashes": ["0x06fdde03", "0x095ea7b3", "0x18160ddd", "0x23b872dd", "0x313ce567", "0x475a9fa9", "0x70a08231", "0x721a37d2", "0x95d89b41", "0xa9059cbb", "0xdd62ed3e"], "is_erc20": true, "is_erc721": false, "block_number": 2112234, "block_timestamp": 1471774428, "block_hash": "0xd279067d9852394d6b6c00b13c49696503c9618d3ed3b23c6b1b1321857ddd92"}

View File

@@ -0,0 +1 @@
{"type": "token", "address": "0xdbdacfc9eb9d42559ac1efbdb40460c728139e6a", "symbol": "", "name": "", "decimals": 0, "total_supply": 0, "block_number": 2112234, "block_timestamp": 1471774428, "block_hash": "0xd279067d9852394d6b6c00b13c49696503c9618d3ed3b23c6b1b1321857ddd92"}

View File

@@ -0,0 +1,2 @@
{"type": "trace", "transaction_index": 0, "from_address": "0x4b638dd891b0669242742bc0f4198a7c60bfbf00", "to_address": "0xdbdacfc9eb9d42559ac1efbdb40460c728139e6a", "value": 0, "input": "0x606060405260008054600160a060020a03191633179055610412806100246000396000f36060604052361561008d5760e060020a600035046306fdde03811461008f578063095ea7b3146100a557806318160ddd1461012457806323b872dd1461012f578063313ce567146101dc578063475a9fa9146101f057806370a0823114610215578063721a37d21461024357806395d89b411461008f578063a9059cbb14610268578063dd62ed3e146102e7575b005b61031d6040805160208101909152600081525b90565b61038b60043560243560007319ee743d2e356d5f0e4d97cc09b96d06e933d0db63c6605267600160005085856040518460e060020a0281526004018084815260200183600160a060020a0316815260200182815260200193505050506020604051808303818660325a03f4156100025750506040515191506103179050565b6102316003546100a2565b61038b60043560243560443560008054604080517fa00bfa1100000000000000000000000000000000000000000000000000000000815260016004820152600160a060020a038781166024830152868116604483015260648201869052929092166084830152517319ee743d2e356d5f0e4d97cc09b96d06e933d0db9163a00bfa119160a482810192602092919082900301818660325a03f4156100025750506040515195945050505050565b604080516000815290519081900360200190f35b61038b6004356024356000805433600160a060020a0390811691161461039f57610002565b600160a060020a03600435166000908152600160205260409020545b60408051918252519081900360200190f35b61038b6004356024356000805433600160a060020a039081169116146103ce57610002565b61038b60043560243560007319ee743d2e356d5f0e4d97cc09b96d06e933d0db6388d5fecb600160005085856040518460e060020a0281526004018084815260200183600160a060020a0316815260200182815260200193505050506020604051808303818660325a03f4156100025750506040515191506103179050565b610231600435602435600160a060020a038281166000908152600260209081526040808320938516835292905220545b92915050565b60405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600302600f01f150905090810190601f16801561037d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b604080519115158252519081900360200190f35b50600160a060020a03821660009081526001602081905260409091208054830190556003805483019055610317565b600160a060020a038316600090815260016020526040902054821161040a57506040600020805482900390556003805482900390556001610317565b50600061031756", "output": "0x6060604052361561008d5760e060020a600035046306fdde03811461008f578063095ea7b3146100a557806318160ddd1461012457806323b872dd1461012f578063313ce567146101dc578063475a9fa9146101f057806370a0823114610215578063721a37d21461024357806395d89b411461008f578063a9059cbb14610268578063dd62ed3e146102e7575b005b61031d6040805160208101909152600081525b90565b61038b60043560243560007319ee743d2e356d5f0e4d97cc09b96d06e933d0db63c6605267600160005085856040518460e060020a0281526004018084815260200183600160a060020a0316815260200182815260200193505050506020604051808303818660325a03f4156100025750506040515191506103179050565b6102316003546100a2565b61038b60043560243560443560008054604080517fa00bfa1100000000000000000000000000000000000000000000000000000000815260016004820152600160a060020a038781166024830152868116604483015260648201869052929092166084830152517319ee743d2e356d5f0e4d97cc09b96d06e933d0db9163a00bfa119160a482810192602092919082900301818660325a03f4156100025750506040515195945050505050565b604080516000815290519081900360200190f35b61038b6004356024356000805433600160a060020a0390811691161461039f57610002565b600160a060020a03600435166000908152600160205260409020545b60408051918252519081900360200190f35b61038b6004356024356000805433600160a060020a039081169116146103ce57610002565b61038b60043560243560007319ee743d2e356d5f0e4d97cc09b96d06e933d0db6388d5fecb600160005085856040518460e060020a0281526004018084815260200183600160a060020a0316815260200182815260200193505050506020604051808303818660325a03f4156100025750506040515191506103179050565b610231600435602435600160a060020a038281166000908152600260209081526040808320938516835292905220545b92915050565b60405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600302600f01f150905090810190601f16801561037d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b604080519115158252519081900360200190f35b50600160a060020a03821660009081526001602081905260409091208054830190556003805483019055610317565b600160a060020a038316600090815260016020526040902054821161040a57506040600020805482900390556003805482900390556001610317565b50600061031756", "trace_type": "create", "call_type": null, "reward_type": null, "gas": 4589988, "gas_used": 228729, "subtraces": 0, "trace_address": [], "error": null, "status": 1, "transaction_hash": "0xa7a876923fdf69617794ea3fd77734bfb46bde6a44a3dc4264c0ca9f9cada30c", "block_number": 2112234, "block_timestamp": 1471774428, "block_hash": "0xd279067d9852394d6b6c00b13c49696503c9618d3ed3b23c6b1b1321857ddd92"}
{"type": "trace", "transaction_index": null, "from_address": null, "to_address": "0xbcdfc35b86bedf72f0cda046a3c16829a2ef41d1", "value": 5000000000000000000, "input": null, "output": null, "trace_type": "reward", "call_type": null, "reward_type": "block", "gas": null, "gas_used": null, "subtraces": 0, "trace_address": [], "error": null, "status": 1, "transaction_hash": null, "block_number": 2112234, "block_timestamp": 1471774428, "block_hash": "0xd279067d9852394d6b6c00b13c49696503c9618d3ed3b23c6b1b1321857ddd92"}

View File

@@ -0,0 +1,33 @@
{
"jsonrpc": "2.0",
"result": {
"author": "0xbcdfc35b86bedf72f0cda046a3c16829a2ef41d1",
"difficulty": "0x39aacc6c90cc",
"extraData": "0x7777772e62772e636f6d",
"gasLimit": "0x47e7c4",
"gasUsed": "0x55b99",
"hash": "0xd279067d9852394d6b6c00b13c49696503c9618d3ed3b23c6b1b1321857ddd92",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"miner": "0xbcdfc35b86bedf72f0cda046a3c16829a2ef41d1",
"mixHash": "0xe4adcf78b32ad4b732dc03869ca3334af1c261d3870494d5c38f5e76a365712f",
"nonce": "0x24a26b600397a6ff",
"number": "0x203aea",
"parentHash": "0x30e5015921e68480c36c19e9ccc7b84ebdd7e9061c0ac4950bc812fc01907a10",
"receiptsRoot": "0x78620aef378942ae50681605b4eff20b7a199b2849d9a5b640e71667f38278c7",
"sealFields": [
"0xa0e4adcf78b32ad4b732dc03869ca3334af1c261d3870494d5c38f5e76a365712f",
"0x8824a26b600397a6ff"
],
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": "0x6a0",
"stateRoot": "0x1c6813ec39c6d94f2eefeec7f4bef825e001686cd1d8c05a72892eb5a723bcbb",
"timestamp": "0x57b97edc",
"totalDifficulty": "0x2bcce6872fdde6f27",
"transactions": [
"0xa7a876923fdf69617794ea3fd77734bfb46bde6a44a3dc4264c0ca9f9cada30c"
],
"transactionsRoot": "0x40a15014cbf97701fb2be46dc70f81eea767f5899a79eaa1e4921054c28e2d96",
"uncles": []
},
"id": 0
}

View File

@@ -0,0 +1,5 @@
{
"jsonrpc": "2.0",
"result": "0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000",
"id": 1
}

View File

@@ -0,0 +1,5 @@
{
"jsonrpc": "2.0",
"result": "0x0000000000000000000000000000000000000000000000000000000000000000",
"id": 3
}

View File

@@ -0,0 +1,5 @@
{
"jsonrpc": "2.0",
"result": "0x0000000000000000000000000000000000000000000000000000000000000000",
"id": 2
}

View File

@@ -0,0 +1,5 @@
{
"jsonrpc": "2.0",
"result": "0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000",
"id": 0
}

View File

@@ -0,0 +1,27 @@
{
"jsonrpc": "2.0",
"id": 0,
"result": {
"difficulty": "0x64d0e37238b83",
"extraData": "0x50505945206e616e6f706f6f6c2e6f7267",
"gasLimit": "0x7a121d",
"gasUsed": "0x7a0ce0",
"hash": "0x7af5ba284473186783cef5ca9b5c6312e01864c5242f91a3d6c10b83358e149f",
"logsBloom": "0x9908a1011222281c841d1542020e521220081bc0400603089008b881102001a025008040000c4205285060a010cd1880005044851431a409006a80ad043801c5020000857827080148809428850140804210000c302020020005800001400080801490402a1140490000306100080c01402012102070480140004013f20080026ac004214451200004001104822440008020818803be202604022045600000600301813000c830402905100090c0880026082104221020004112804818a401554044000a8908300043000004d43020c001a028a03038001a2d2013005404280c029a04202c024a02788805024c60830819448228000184052418406208b08027",
"miner": "0x52bc44d5378309ee2abf1539bf71de1b7d7be3b5",
"mixHash": "0x42245eebe197738fd69f2ea618aaddc2678c4d4f6d0e43bfc866aa2e13456323",
"nonce": "0x89db6d03e1c16278",
"number": "0x71993a",
"parentHash": "0xb47bcc6c1bedfe7c2de455148f0d3347db81928cc800fde85b1227d5bb1c2c58",
"receiptsRoot": "0xd5d5d1e7ee670765759db01b7d39c9ba1a22c8ee204a6f5bcfa926f6803ee604",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": "0x9163",
"stateRoot": "0x478e0766a68ec7f297023f07f5836df8ac18dc5a0b2c9e239e50423b15f7acab",
"timestamp": "0x5c9a39ac",
"totalDifficulty": "0x208b82b4db121da54e4",
"transactions": [
],
"transactionsRoot": "0x7f155c8eed53603ddd5e04ba904405fded3f91667a5216abe5c6fbe0d26f4007",
"uncles": []
}
}

View File

@@ -0,0 +1,41 @@
{
"jsonrpc": "2.0",
"result": [
{
"action": {
"from": "0x4b638dd891b0669242742bc0f4198a7c60bfbf00",
"gas": "0x4609a4",
"init": "0x606060405260008054600160a060020a03191633179055610412806100246000396000f36060604052361561008d5760e060020a600035046306fdde03811461008f578063095ea7b3146100a557806318160ddd1461012457806323b872dd1461012f578063313ce567146101dc578063475a9fa9146101f057806370a0823114610215578063721a37d21461024357806395d89b411461008f578063a9059cbb14610268578063dd62ed3e146102e7575b005b61031d6040805160208101909152600081525b90565b61038b60043560243560007319ee743d2e356d5f0e4d97cc09b96d06e933d0db63c6605267600160005085856040518460e060020a0281526004018084815260200183600160a060020a0316815260200182815260200193505050506020604051808303818660325a03f4156100025750506040515191506103179050565b6102316003546100a2565b61038b60043560243560443560008054604080517fa00bfa1100000000000000000000000000000000000000000000000000000000815260016004820152600160a060020a038781166024830152868116604483015260648201869052929092166084830152517319ee743d2e356d5f0e4d97cc09b96d06e933d0db9163a00bfa119160a482810192602092919082900301818660325a03f4156100025750506040515195945050505050565b604080516000815290519081900360200190f35b61038b6004356024356000805433600160a060020a0390811691161461039f57610002565b600160a060020a03600435166000908152600160205260409020545b60408051918252519081900360200190f35b61038b6004356024356000805433600160a060020a039081169116146103ce57610002565b61038b60043560243560007319ee743d2e356d5f0e4d97cc09b96d06e933d0db6388d5fecb600160005085856040518460e060020a0281526004018084815260200183600160a060020a0316815260200182815260200193505050506020604051808303818660325a03f4156100025750506040515191506103179050565b610231600435602435600160a060020a038281166000908152600260209081526040808320938516835292905220545b92915050565b60405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600302600f01f150905090810190601f16801561037d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b604080519115158252519081900360200190f35b50600160a060020a03821660009081526001602081905260409091208054830190556003805483019055610317565b600160a060020a038316600090815260016020526040902054821161040a57506040600020805482900390556003805482900390556001610317565b50600061031756",
"value": "0x0"
},
"blockHash": "0xd279067d9852394d6b6c00b13c49696503c9618d3ed3b23c6b1b1321857ddd92",
"blockNumber": 2112234,
"result": {
"address": "0xdbdacfc9eb9d42559ac1efbdb40460c728139e6a",
"code": "0x6060604052361561008d5760e060020a600035046306fdde03811461008f578063095ea7b3146100a557806318160ddd1461012457806323b872dd1461012f578063313ce567146101dc578063475a9fa9146101f057806370a0823114610215578063721a37d21461024357806395d89b411461008f578063a9059cbb14610268578063dd62ed3e146102e7575b005b61031d6040805160208101909152600081525b90565b61038b60043560243560007319ee743d2e356d5f0e4d97cc09b96d06e933d0db63c6605267600160005085856040518460e060020a0281526004018084815260200183600160a060020a0316815260200182815260200193505050506020604051808303818660325a03f4156100025750506040515191506103179050565b6102316003546100a2565b61038b60043560243560443560008054604080517fa00bfa1100000000000000000000000000000000000000000000000000000000815260016004820152600160a060020a038781166024830152868116604483015260648201869052929092166084830152517319ee743d2e356d5f0e4d97cc09b96d06e933d0db9163a00bfa119160a482810192602092919082900301818660325a03f4156100025750506040515195945050505050565b604080516000815290519081900360200190f35b61038b6004356024356000805433600160a060020a0390811691161461039f57610002565b600160a060020a03600435166000908152600160205260409020545b60408051918252519081900360200190f35b61038b6004356024356000805433600160a060020a039081169116146103ce57610002565b61038b60043560243560007319ee743d2e356d5f0e4d97cc09b96d06e933d0db6388d5fecb600160005085856040518460e060020a0281526004018084815260200183600160a060020a0316815260200182815260200193505050506020604051808303818660325a03f4156100025750506040515191506103179050565b610231600435602435600160a060020a038281166000908152600260209081526040808320938516835292905220545b92915050565b60405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600302600f01f150905090810190601f16801561037d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b604080519115158252519081900360200190f35b50600160a060020a03821660009081526001602081905260409091208054830190556003805483019055610317565b600160a060020a038316600090815260016020526040902054821161040a57506040600020805482900390556003805482900390556001610317565b50600061031756",
"gasUsed": "0x37d79"
},
"subtraces": 0,
"traceAddress": [],
"transactionHash": "0xa7a876923fdf69617794ea3fd77734bfb46bde6a44a3dc4264c0ca9f9cada30c",
"transactionPosition": 0,
"type": "create"
},
{
"action": {
"author": "0xbcdfc35b86bedf72f0cda046a3c16829a2ef41d1",
"rewardType": "block",
"value": "0x4563918244f40000"
},
"blockHash": "0xd279067d9852394d6b6c00b13c49696503c9618d3ed3b23c6b1b1321857ddd92",
"blockNumber": 2112234,
"result": null,
"subtraces": 0,
"traceAddress": [],
"transactionHash": null,
"transactionPosition": null,
"type": "reward"
}
],
"id": 0
}