bitcart/bitcart

[BUG]After I created a wallet, I got an error(I configured an ETH testnet installation.)

fintechee opened this issue ยท 14 comments

Hi,

This project is amazing, absolutely underestimated. I love it!

Describe the bug
After I created a wallet, a tip error appeared above the ID column of the datatable:
"Error loading wallet. Either the currency of this wallet is no longer supported or it was disabled on the server. Check server logs for more information"

To Reproduce
Steps to reproduce the behavior:

I configured an ETH testnet installation(I unchecked BTC installation and no lightning).
Installation is done successfully.
I can open admin panel and store.

  1. Create a wallet
  2. Set contract to USDT
  3. Set xpub to Metamask's public key
  4. Save

Server:

  • OS: Ubuntu 20.04(self-hosted)
  • Version 20.04

Hi! You can join our community groups for faster investigation

Do you see eth in "Daemons management"?

One common fix might be this: the usdt contract you selected is for mainnet, so for testnet you should manually enter needed contract's address

Many thanks for your fast response.

Where is your community group? Telegram?

Do you see eth in "Daemons management"?

Yes, the page shows:
ETH
Credentials
URL
http://ethereum:5002
Username
electrum
Password
electrumz
Network
testnet

I wonder which testnet the deployment is connected to.
Goerli?

the usdt contract you selected is for mainnet, so for testnet you should manually enter needed contract's address

Actually in the datatable, I can see the correct contract address.
If I choose "Edit" icon, the contract field on the popup dialog shows the correct contract address as well.
I checked it by comparing it with the Metamask's USDT contract address.

The server log:
2022-10-24 10:44:13,840 - [PID 1] - api.settings.log_startup_info [line 251] - INFO - Successfully loaded 1 cryptos
2022-10-24 10:44:13,840 - [PID 1] - api.settings.log_startup_info [line 252] - INFO - 17 notification providers available
2022-10-24 10:44:13,852 - [PID 1] - api.ext.update.refresh [line 32] - INFO - Checking for updates...
2022-10-24 10:44:14,183 - [PID 1] - api.ext.update.refresh [line 38] - INFO - No updates found
2022-10-24 11:41:12,987 - [PID 1] - api.utils.wallets.get_wallet_balance [line 52] - ERROR - Error getting wallet balance for wallet PuLCNTLUteAoBFuLkkwFWLZSwesronQB with currency eth:

Traceback (most recent call last):
File "/app/api/utils/wallets.py", line 49, in get_wallet_balance
divisibility = None if not wallet.contract else await coin.server.readcontract(wallet.contract, "decimals")
File "/usr/local/lib/python3.9/site-packages/bitcart/providers/jsonrpcrequests.py", line 132, in wrapper
raise UnknownError(f"Unknown error from server: {message}")
bitcart.errors.UnknownError: Unknown error from server: web3.exceptions.BadFunctionCallOutput: Could not decode contract function call to decimals with return data: b'', output_types: ['uint8']

2022-10-24 11:41:13,003 - [PID 1] - api.tasks.sync_wallet [line 29] - ERROR - Wallet PuLCNTLUteAoBFuLkkwFWLZSwesronQB failed to sync:

Traceback (most recent call last):
File "/app/api/tasks.py", line 27, in sync_wallet
balance = await coin.balance()
File "/usr/local/lib/python3.9/site-packages/bitcart/coins/btc.py", line 137, in balance
data = await self.server.getbalance()
File "/usr/local/lib/python3.9/site-packages/bitcart/providers/jsonrpcrequests.py", line 131, in wrapper
raise generate_exception(exc["exc_name"])(exc["docstring"])
bitcart.errors.InvalidKeyProvidedError: Invalid key provided. We support seed, private, public keys and address directly as a key

Yes, our chat is in telegram or similar https://bitcartcc.com#community
But error you shown is indeed when invalid contract name is used
Could you send contract address and which testnet network is it?

If I choose USD(contract) and eth(currency), then the contract address 0xdAC17F958D2ee523a2206206994597C13D831ec7 will be shown automatically by Bitcartcc after I press "Save".
I'm using Goerli testnet via Metamask.
Bitcartcc can't specify testnet's name during the installation flow. So I don't know which testnet Bitcartcc is using.

As I've told, 0xdAC17F958D2ee523a2206206994597C13D831ec7 is address of usdt in mainnet, and in goerli testnet there is probably a different one
Though if using configurator, I think eth doesn't really use a testnet
What does
./bitcart-cli.sh -c eth getinfo

output?

{
"blockchain_height": 0,
"connected": true,
"gas_price": 1000000000,
"path": "/home/electrum/.bitcart-eth/testnet",
"server": "http://geth:8545",
"server_height": 0,
"spv_nodes": 0,
"synchronized": true,
"version": "4.3.0"
}

It is using mainnet, but is having problems with finding peers due to eth merge
So on which network do you want it to run?

I need to do test on the Goerli testnet and then go live.

You would need a goerli RPC then

export ETH_NETWORK=goerli
export ETH_SERVER=https://rpcurl
./setup.sh

It's either goerli on infura or some public RPC if you find it

So, I need to replace rpcurl with what I find later?
Do I need to remove the current deployment and reinstall?

I will try tomorrow.
Many thanks for your help!!

No need to remove anything
It can be re-configured any time
Good luck!

Hi,

I re-setup the server by using these parameters:
export ETH_SERVER=https://goerli.optimism.io
export BITCART_CRYPTOS=eth
export ETH_NETWORK=goerli

And then run:
./setup.sh

I found the USDT contract address on goerli is:
0xe802376580c10fe23f027e1e19ed9d54d4c9311e

And after I created a wallet, the same error occurred.

Server log:
2022-10-25 03:56:10,669 - [PID 1] - api.utils.wallets.get_wallet_balance [line 52] - ERROR - Error getting wallet balance for wallet WvfKxvmFFxvNFQmPYiFZCeezWjDmSvWL with currency eth:

Traceback (most recent call last):
File "/app/api/utils/wallets.py", line 49, in get_wallet_balance
divisibility = None if not wallet.contract else await coin.server.readcontract(wallet.contract, "decimals")
File "/usr/local/lib/python3.9/site-packages/bitcart/providers/jsonrpcrequests.py", line 132, in wrapper
raise UnknownError(f"Unknown error from server: {message}")
bitcart.errors.UnknownError: Unknown error from server: web3.exceptions.BadFunctionCallOutput: Could not decode contract function call to decimals with return data: b'', output_types: ['uint8']

2022-10-25 03:56:11,012 - [PID 1] - api.tasks.sync_wallet [line 29] - ERROR - Wallet WvfKxvmFFxvNFQmPYiFZCeezWjDmSvWL failed to sync:

Traceback (most recent call last):
File "/app/api/tasks.py", line 27, in sync_wallet
balance = await coin.balance()
File "/usr/local/lib/python3.9/site-packages/bitcart/coins/btc.py", line 137, in balance
data = await self.server.getbalance()
File "/usr/local/lib/python3.9/site-packages/bitcart/providers/jsonrpcrequests.py", line 131, in wrapper
raise generate_exception(exc["exc_name"])(exc["docstring"])
bitcart.errors.InvalidKeyProvidedError: Invalid key provided. We support seed, private, public keys and address directly as a key


./bitcart-cli.sh -c eth getinfo

{
"blockchain_height": 2260570,
"connected": true,
"gas_price": 1,
"path": "/home/electrum/.bitcart-eth/goerli",
"server": "https://goerli.optimism.io",
"server_height": 2260571,
"spv_nodes": 0,
"synchronized": true,
"version": "4.3.0"
}


daemon management:
ETH
Credentials

URL
http://ethereum:5002

Username
electrum

Password
electrumz

Network
goerli

Resolved via telegram (:

Yes, forgot to close it here!
Many thanks.