oceanprotocol / pdr-backend

Instructions & code to run predictoors, traders, more.
Apache License 2.0
26 stars 22 forks source link

[README] Trouble getting started "insufficient balance to pay fees" #1517

Closed gordonkoehn closed 3 weeks ago

gordonkoehn commented 1 month ago

Hi Oceaners,

I am just getting started with pdr-backend aiming to make predictions.

Working through the README I fail to run the predictor bot on sapphire testnet pdr predictoor my_ppss.yaml sapphire-testnet

I keep running into the following error when the bot tries to submit the first prediction:

2024-08-12 13:04:16,534 predictoor_agent INFO Submitting predictions to the chain... Pending nonce: 22 client: transaction check failed: runtime error: module: core code: 5 message: insufficient balance to pay fees

To my understanding of the oasis explorer: I got OCEAN and I got ROSES on testnet.

I've already debugged a bit on the Ocean Discord, yet I seem to get nowhere. Hence, I post it also here whilst this is probably not a bug, but an issue with my setup. I am relatively new to web3, so it's likely me.

I'd appreciate any suggestions - I can't wait to get to the data science part.

My bot makes contract calls, so the connection works fine.

Here is how I set up the rest:

To my understanding, I have about 1000 OCEAN on Sapphire testnet and about 50 Test Tokens, which I assume to be ROSES. See on OASIS explorer

Screenshots

Screenshot 2024-08-12 at 13 26 47

Desktop:

trizin commented 1 month ago

Hello!

Please ensure your pdr-backend is up to date. Try running git pull to fetch the most recent changes. If you're still experiencing issues, feel free to let me know and we can troubleshoot further.

gordonkoehn commented 1 month ago

Hi, thanks for offering to help troubleshooting!

I cloned the repo a few days ago; after a fresh git pull, I got insufficient balance again.

Best, Gordon

trizin commented 1 month ago

Thanks for the update! I wasn't able to reproduce the issue that you're experiencing. Could you please share the error message and relevant logs, specifically the 4-5 lines leading up to it? Additionally, ensure that you're running the command on sapphire-testnet and not sapphire-mainnet

gordonkoehn commented 1 month ago

Thanks for trying ! Yes, I run the command for sapphire-testnet. I've attached the log.

I suppose it is a misunderstanding or misuse from my side, not the software.

bot_only: pred_submitter_mgr: "0x06bf8B3f6871D0D84A5cD7D509EF4192a37d20De" # DeployNewMgr | <address of deployed mgr>

as written in the tutorial.

Another concern of mine: The only way I supplied to the pdr-backend which wallet to use is via the environmental variable: export PRIVATE_KEY=<PRIVATE KEY>

Is this correct?

This is the full log:

failure_log.txt

gordonkoehn commented 1 month ago

Reading the log line by line – the last lines lead me to think there is something wrong with the format of my private key perhaps ? I've exported it to my console as export PRIVATE_KEY="0x....67" and also tried export PRIVATE_KEY=0x....67 Is this correct ?

An issue here seems odd to me aspdr-backend manages to make Contract Calls, yet not submit predictions to chain. Is there a different kind of checking happening perhaps ?

return to_type(primitive, hexstr=hexstr) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/gordonkoehn/Documents/Projects/QuantFinance/repos/pdr-backend/pdr-backend_x/lib/python3.12/site-packages/eth_utils/decorators.py", line 81, in wrapper _assert_one_val(*args, **kwargs) File "/Users/gordonkoehn/Documents/Projects/QuantFinance/repos/pdr-backend/pdr-backend_x/lib/python3.12/site-packages/eth_utils/decorators.py", line 44, in _assert_one_val raise TypeError( TypeError: Exactly one of the passed values can be specified. Instead, values were: (None,), {'hexstr': None}

I've also created new keys and checked that I have Test Roses on ParaTimes: Sapphire when importing my private key with RoseWallet. Same result.

I am out of ideas for getting this running.

@trentmc @trizin Do you perhaps see where I am using pdr-backend wrongly? I would really love to get started on the data science part :)

Best From Hamburg.

trizin commented 1 month ago

Thanks for sharing the logs! I noticed it's failing when submitting the predictions. To troubleshoot, would you like to try going back to a fresh install of pdr-backend? Here are the steps:

I've also never tested it on Windows before. If the issue persists even after a fresh installation, using Windows Subsystem for Linux (WSL) may be worth considering.

gordonkoehn commented 4 weeks ago

Alright, it works now. I cannot pin down what went wrong.

I was convinced I had done every step religiously as the ReadMe prescribes.

In retrospect – I might have missed the Mac-specific setup below:

# so that sapphire.py works. Details in #66
codesign --force --deep --sign - venv/sapphirepy_bin/sapphirewrapper-arm64.dylib

# so that xgboost works. Details in #1339
brew install libomp

After your response, I read the ReadMe concerning the OS more carefully. Perhaps it was this.

Whatever it was, the error message I got before was misleading. Insufficient gas to pay fees led me to think there was something wrong with my wallet not with my setup.

Thank you for investigating this issue with me! Debugging with someone is invaluable, even for something as trivial as this !

Feel free to close the issue unless you think the error message is worth improving. I'm happy to help investigate.

Best Gordon

trizin commented 3 weeks ago

Awesome! Thanks for the update.

I've created a new issue #1548 to improve the error message.