소스 검색

researching on etherscan with api

saliveja 4 년 전
부모
커밋
d35ad2be49
6개의 변경된 파일105개의 추가작업 그리고 0개의 파일을 삭제
  1. 12 0
      .idea/inspectionProfiles/Project_Default.xml
  2. 6 0
      .idea/inspectionProfiles/profiles_settings.xml
  3. 6 0
      .idea/misc.xml
  4. 8 0
      .idea/modules.xml
  5. 8 0
      .idea/whallets.iml
  6. 65 0
      docs/eth_api_info.md

+ 12 - 0
.idea/inspectionProfiles/Project_Default.xml

@@ -0,0 +1,12 @@
+<component name="InspectionProjectProfileManager">
+  <profile version="1.0">
+    <option name="myName" value="Project Default" />
+    <inspection_tool class="PyPep8Inspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
+      <option name="ignoredErrors">
+        <list>
+          <option value="E114" />
+        </list>
+      </option>
+    </inspection_tool>
+  </profile>
+</component>

+ 6 - 0
.idea/inspectionProfiles/profiles_settings.xml

@@ -0,0 +1,6 @@
+<component name="InspectionProjectProfileManager">
+  <settings>
+    <option name="USE_PROJECT_PROFILE" value="false" />
+    <version value="1.0" />
+  </settings>
+</component>

+ 6 - 0
.idea/misc.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="MarkdownSettingsMigration">
+    <option name="stateVersion" value="1" />
+  </component>
+</project>

+ 8 - 0
.idea/modules.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/whallets.iml" filepath="$PROJECT_DIR$/.idea/whallets.iml" />
+    </modules>
+  </component>
+</project>

+ 8 - 0
.idea/whallets.iml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="PYTHON_MODULE" version="4">
+  <component name="NewModuleRootManager">
+    <content url="file://$MODULE_DIR$" />
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 65 - 0
docs/eth_api_info.md

@@ -0,0 +1,65 @@
+# getting info from Etherscan API
+
+Resources: 
+- https://github.com/pcko1/etherscan-python/blob/master/README.md
+- https://www.youtube.com/watch?v=pIOg-f0GBBk
+- https://rattibha.com/thread/1512983745988419588, 
+
+
+- register a free account on etherscan
+- install etherscan-python with: pip install etherscan-python
+- https://github.com/pcko1/etherscan-python/blob/master/README.md
+
+The github gives info on how to access the data in categories:
+- accounts:(examples)
+get_normal_txs_by_address(address, startblock, endblock, sort)
+eth.get_erc20_token_transfer_events_by_address(address, startblock, endblock, sort)
+
+You will get these columns from normal txs:
+['blockHash', 'blockNumber', 'confirmations', 'contractAddress', 'cumulativeGasUsed', 'from', 'gas', 'gasPrice', 'gasUsed', 'hash', 'input', 'isError', 'nonce', 'timeStamp', 'to', 'transactionIndex', 'txreceipt_status', 'value']
+
+- On the github there are example of responses returned.
+
+- contacts
+- transactions
+- blocks
+- GETH/Parity Proxy
+- Tokens
+- Gas tracker
+- Stats
+- Pro (PRO API key needed) for:
+	- get_hist_eth_balance_for_address_by_block_no
+	- get_daily_average_block_size
+    	- get_daily_block_count_and_rewards
+    	- get_daily_block_rewards
+    	- get_daily_average_block_time
+    	- get_daily_uncle_block_count_and_rewards
+    	- get_hist_erc20_token_total_supply_by_contract_address_and_block_no
+    	- get_hist_erc20_token_account_balance_for_token_contract_address_by_block_no
+    	- get_token_info_by_contract_address
+    	- get_daily_average_gas_limit
+    	- get_eth_daily_total_gas_used
+    	- get_eth_daily_average_gas_price
+    	- get_eth_daily_network_tx_fee
+    	- get_daily_new_address_count
+    	- get_daily_network_utilization
+    	- get_daily_average_network_hash_rate
+    	- get_daily_tx_count
+    	- get_daily_average_network_difficulty
+    	- get_eth_hist_daily_market_cap
+    	- get_eth_hist_price
+
+
+Other resources than Etherscan:
+- Coingecko --> we can create an api and request info
+- Infura: https://infura.io/ --> they have free tier with up to 100 k requests/day
+To use Infura with python, this is an example of code to use in python:
+
+from web3 import Web3
+
+w3 = Web3(Web3.HTTPProvider(projectID))
+receipt=w3.eth.get_transaction_receipt(trHash)
+
+-- Once you get the receipt, you need to get the DEX smart contract ABI --
+-- ABI basically tells you how does which function look like when you see it in logs --
+