How can i extract information from Ethereum blockchain using python?

0 votes

I am looking to do some analysis on the Ethereum blockchain, particularly, looking for correlations in the data between available hash power and transaction confirmation times.

 However, I am unable to make sense of how to go about downloading either of the blockchains or extract the transaction and worker information from them. Ideally, I would download the blockchains, then use a python script to extract the relevant information from the blockchain to a CSV file or something like that? Any pointers on how this can be achieved?

Jul 31, 2018 in Blockchain by Perry
• 17,090 points
122 views

1 answer to this question.

0 votes

Give the RPC (--rpc) option when you start the process. Make sure you have the entire blockchain. 
The rpc starts a server process on localhost:8545. You can change the port as per your wish by --rpcport option.
Simply send HTTP Get requests (by CURL or some http module) to localhost:8545 and get the necessary info in JSON format. You can also use web3.js or web3.py APIs, which interface with the blockchain, basically execute on the console that is opened by the process. https://github.com/ethereum/wiki/wiki/JSON-RPC

answered Jul 31, 2018 by Shashank
• 10,350 points

Related Questions In Blockchain

+1 vote
1 answer
0 votes
1 answer

How do I withdraw the balance from a contract on Ethereum test blockchain?

Your need to improvise your code a ...READ MORE

answered Aug 3, 2018 in Blockchain by Perry
• 17,090 points
94 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,810 points
186 views
+1 vote
1 answer
0 votes
1 answer

Python request module for bitcoin json rpc

This should work: #!/usr/bin/env python import getpass import json import requests ...READ MORE

answered Aug 28, 2018 in Blockchain by digger
• 26,600 points
313 views
+1 vote
1 answer

How can I initiate a transaction on ethereum private network using mobile device?

There is no android wallet to connect ...READ MORE

answered Apr 18, 2018 in Blockchain by Shashank
• 10,350 points
65 views
0 votes
1 answer

How can I retrieve to and from address in transaction directly from blockchain?

The spending conditions, i.e., who is able ...READ MORE

answered Jul 11, 2018 in Blockchain by Shashank
• 10,350 points
90 views