-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to make ERC20 Transfer or any other transfer on self-hosted GETH Blockchain/Node #258
Comments
Hi, you don't have any Ether to pay transaction fees. You can see it in the error message: "balance 0" |
It should use the native token of the blockchain which is "CUSH". As you can see when I print the wallet balance, it's a number greater than 1. I've rebuilt the same code in JS and have no issues at the moment. I only seem to be getting the issue over here. Could it be because it isn't detecting the blockchain's currency or something? Is there an extra config for this somewhere? This blockchain is a private one I have setup using GETH. |
You only print out the balance of the GBP token (99898899000000000000000000), not the CUSH balance (0?). Try |
So how would I get this to work? My CUSH balance is 900k+ and my GBP balance (ERC-20) is 900k+. But when I try to send either CUSH (native token) or the ERC 20, it says insufficient funds as above |
In that case, the node you are connected to is out of sync. How did you initialize the |
It can't be out of sync, I am replicating the same functionality into Node.js and it works without any issue sadly. Either I'm missing something or something is broken. This is how I initialize the client: # Contract
@contract = Eth::Contract.from_abi(name: "GBP", address: @contract_address, abi: @erc20_abi)
# Client
client = Eth::Client.create(@rpc_url) # URL of RPC
balance = client.get_balance(@wallet_address)
transfer = client.transfer_and_wait(to, 1, sender_key: @private_key, legacy: true)
# Regular Transaction
transaction = client.transfer_and_wait(to, 1, sender_key: @private_key, legacy: true)
# ERC 20
transaction_erc20 = client.transfer_erc20_and_wait(@contract, to, 0, sender_key: @private_key, legacy: true, gas_limit: 21578)
# Tried this too but same error
manual_erc20 = client.transact_and_wait(@contract, "transfer", address: to, amount: 0, sender_key: @private_key, legacy: true, gas_limit: 21578)
# These transactions are not all run at once, I have placed them here so you can see what I am trying to do This blockchain is GETH clone with only 3 nodes (boot node, rpc endpoint & 1 miner) |
Error:
Any ideas what I may be doing wrong? I tried a normal transfer too but I keep getting the same error. My default coin for this GETH Blockchain is called "CUSH". Please advise further, thanks! I did manage to make sending transactions work via calling the RPC directly, but sadly couldn't get it to work for ERC20, so I thought this would be a better approach. Please advise further.
The text was updated successfully, but these errors were encountered: