-
Apologies for any dumb questions, I don't normally write python and have no experience writing anything web3 related. I wanted to try running First, if I try to run $ ./main.py 0x... 2021-01-01 2021-12-31
Traceback (most recent call last):
File "/.../dfkreport/./main.py", line 110, in <module>
main()
File "/.../dfkreport/./main.py", line 41, in main
with open('../transactions/{0}'.format(reportInfo[8]), 'rb') as file:
FileNotFoundError: [Errno 2] No such file or directory: '../transactions/74e0c7ead1384985a8a68a3c3ba767ec' Why does the app expect a Second, how do I serve the UI? I saw the other discussion about running Any help would be appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 8 replies
-
Okay I figured $ ../main.py 0x... 2021-01-01 2021-12-31
reportInfo: ('0x...', '2021-01-01', '2021-12-31', 1657494143, 890, 0, 890, 0, '', '', 1, 'fifo', 1, None)
Traceback (most recent call last):
File "/.../dfkreport/.venv/lib/python3.9/site-packages/web3/contract.py", line 1513, in call_contract_function
output_data = web3.codec.decode_abi(output_types, return_data)
File "/.../dfkreport/.venv/lib/python3.9/site-packages/eth_abi/codec.py", line 181, in decode_abi
return decoder(stream)
File "/.../dfkreport/.venv/lib/python3.9/site-packages/eth_abi/decoding.py", line 127, in __call__
return self.decode(stream)
File "/.../dfkreport/.venv/lib/python3.9/site-packages/eth_utils/functional.py", line 45, in inner
return callback(fn(*args, **kwargs))
File "/.../dfkreport/.venv/lib/python3.9/site-packages/eth_abi/decoding.py", line 173, in decode
yield decoder(stream)
File "/.../dfkreport/.venv/lib/python3.9/site-packages/eth_abi/decoding.py", line 127, in __call__
return self.decode(stream)
File "/.../dfkreport/.venv/lib/python3.9/site-packages/eth_abi/decoding.py", line 198, in decode
raw_data = self.read_data_from_stream(stream)
File "/.../dfkreport/.venv/lib/python3.9/site-packages/eth_abi/decoding.py", line 305, in read_data_from_stream
raise InsufficientDataBytes(
eth_abi.exceptions.InsufficientDataBytes: Tried to read 32 bytes. Only got 0 bytes
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/.../dfkreport/web/../main.py", line 91, in main
reportData = taxmap.buildTaxMap(txData, args.wallet, datetime.datetime.strptime(args.startDate, '%Y-%m-%d').date(
File "/.../dfkreport/taxmap.py", line 61, in buildTaxMap
eventMap = events.checkTransactions(txns[0], account, startDate, endDate, 'harmony')
File "/.../dfkreport/events.py", line 166, in checkTransactions
results = extractSwapResults(w3, tx, account, timestamp, receipt)
File "/.../dfkreport/events.py", line 737, in extractSwapResults
fiatValues = getSwapFiatValues(timestamp, sentToken[0], sentAmount[0], rcvdToken[0], rcvdAmount[0])
File "/.../dfkreport/events.py", line 783, in getSwapFiatValues
fiatReceiveValue = prices.priceLookup(timestamp, rcvdToken) * rcvdAmount
File "/.../dfkreport/prices.py", line 64, in priceLookup
return decimal.Decimal(getPrice(token, lookupDate, fiatType))
File "/.../dfkreport/prices.py", line 126, in getPrice
prices = fetchPriceData(token, date)
File "/.../dfkreport/prices.py", line 92, in fetchPriceData
result = fetchItemPrice(token, date)
File "/.../dfkreport/prices.py", line 108, in fetchItemPrice
price = getCurrentPrice(token, '0x72Cb10C6bfA5624dD07Ef608027E366bd690048F')
File "/.../dfkreport/prices.py", line 149, in getCurrentPrice
tokenDecimals = getTokenInfo(w3, token)[1]
File "/.../dfkreport/prices.py", line 174, in getTokenInfo
contract = w3.eth.contract(address=address, abi=ABI)
File "/.../dfkreport/.venv/lib/python3.9/site-packages/web3/eth.py", line 720, in contract
return ContractFactory(address)
File "/.../dfkreport/.venv/lib/python3.9/site-packages/web3/contract.py", line 338, in __init__
self.address = normalize_address(self.web3.ens, address)
File "/.../dfkreport/.venv/lib/python3.9/site-packages/web3/_utils/normalizers.py", line 250, in normalize_address
validate_name_has_address(ens, address)
File "/.../dfkreport/.venv/lib/python3.9/site-packages/web3/_utils/ens.py", line 45, in validate_name_has_address
addr = ens.address(name)
File "/.../dfkreport/.venv/lib/python3.9/site-packages/ens/main.py", line 133, in address
return cast(ChecksumAddress, self.resolve(name, 'addr'))
File "/.../dfkreport/.venv/lib/python3.9/site-packages/ens/main.py", line 235, in resolve
resolver = self.resolver(normal_name)
File "/.../dfkreport/.venv/lib/python3.9/site-packages/ens/main.py", line 247, in resolver
resolver_addr = self.ens.caller.resolver(normal_name_to_hash(normal_name))
File "/.../dfkreport/.venv/lib/python3.9/site-packages/web3/contract.py", line 1453, in call_function
return fn(*args, **kwargs).call(transaction, block_identifier)
File "/.../dfkreport/.venv/lib/python3.9/site-packages/web3/contract.py", line 957, in call
return call_contract_function(
File "/.../dfkreport/.venv/lib/python3.9/site-packages/web3/contract.py", line 1530, in call_contract_function
raise BadFunctionCallOutput(msg) from e
web3.exceptions.BadFunctionCallOutput: Could not transact with/call contract function, is contract deployed correctly and chain synced? Any idea what the issue is? |
Beta Was this translation helpful? Give feedback.
-
Additional info that might be useful: I've got a vagrant box running ubuntu focal (20) and finally have the app up. I did have to use Python 3.8 (because otherwise pip was getting unfortunate combinations of dependencies) ... the pyhmy issue seems to be due to their changing/resetting their versioning and pip getting the older (but yanked) versions of the library. I also had to explicitly install I haven't run anything through 2021 yet though, so I haven't run into the gecko issue. |
Beta Was this translation helpful? Give feedback.
-
@pwillworth when I run an address with just DFK selected on the live site, I get the data I expect. But when I run locally, I only get a few records. (So, for example, I see 12 wallet transactions on production, but 0 locally.) I've run blockCrawler, and Harmony looks fine, but DFKChain is acting differently. Anything obvious I might be missing? Do I need to use the covalent branch? |
Beta Was this translation helpful? Give feedback.
Okay I figured
main.py
is supposed to be ran fromweb
and got past theFileNotFoundError
by adding atransactions
directory to the root. Now I'm getting this error: