File Files Metca Ethereum Block CSV: Complex Source for History Bitcoins
Blockchain Bitcoin pretepel significant changes with its creation in 2009, and new blockers are added to the net with non -utensil heating. One of the aspect of this process, which can be difficult to dispersed in a hand, there is a block -Metal, which are written on the blockchain as part of each consumed unit.
In this state, we have submitted a solution for the CSV complex file, the content of every block of the block of bitcoins from the high block. This file allows you to easily load and analyze historical data, related to each block.
how is it work
To relate to the squeezed file CSV, we can use the API Blockchain.info, which provides a simple safety blotching trickle tackle from the blockchain. That's how:
1.
- Submit New Koschelek : Submit New Bitcoin -Koshelek, using the ended pointCreatewallet ‘. This will be henerized to the public address and the lyric key that you can use transaction and plate.
- Cat API token : Invite the token API from your diminted cuts. You will be paid to this token for authentification with API blockchain.info.
- We will use the following final point:
https: // api.blockchain.info/v1/blockchain/timeSpan.json
.
AMEP API
Answer from the API will be the content of the masses, every one from which the one presents a single block with the time with the following -ups:
Timestamp
: The Block Timestamp in Seconds with Janwar 2009.
Block_height
: Highly Fighting Block on Blockchain.
Pre -Trial_hash
: six -type -editing Hisha pre -ant -block.
Hash
: Specker’s presentation has a teking block.
Here’s the primer of the otvet from API:
`Json
[
{
"Time": 1000000,
"Block_height": 1,
"Pre -area_hash": "...
}
{
"Timestamp": 20,000,000,
"Block_height": 2,
...
}
]
CSV Generation
To pre -form the API API in the CSV file, we can use the CSVKIT ibblogate in python. Here’s the primer fragments of the code:
`Python
Import CSV
Def Generate_csv (file_path):
with open (file_path, 'w') how CSVFILE:
Writer = CSV.Writer (CSVFILE)
Header = ['Timestamp', 'Block_height', 'Pre -area_hash', 'Hash]
Writer.writerow (zagolovok)
For the utility B api_response:
Timestamp = Int (Answer ['Timestamp']) / 1000
Block_height = Response ['Block_height']
Pre -
hash = hex (answer ['hash'])
Writer.writerow ([timestamp, block_height, preying_hash, hash])
Change 'api_ressponse' on the factual answer API from blockchain.info
Generate_csv ('ethereum_block_timestamps.csv')
This code will generate the CSV file with the name ethereum_block_timestamps.csv
in the coaching work of the catalog. Each string of the file introduces a single block -meth in the history of bitcoins, including at the time of the tap, high block, pre -presence of the hash and the hash.
Conclusion
Construction of the complex file CSV, the content of every block of the block in the history of bitcoins from the high block, now it is that -lib. The follow -up of these stages, you can make a renewal source for analysis of historical data, connected with each block.
Leave a Reply