anchor
anchor copied to clipboard
Unable to upload Solang generated idl
Steps to reproduce:
-
anchor init testprogram --solidity
-
anchor build
-
anchor keys sync
-
anchor idl init -f target/idl/testprogram.json `solana address -k target/deploy/testprogram-keypair.json`
This last commands outputs:
Error: RPC response error -32002: Transaction simulation failed: Error processing Instruction 0: invalid program argument [3 log messages]
Caused by:
RPC response error -32002: Transaction simulation failed: Error processing Instruction 0: invalid program argument [3 log messages]
I haven't been able to find any solution for this. I also do not know how to access those [3 log messages]
.
edit
These are my program versions in case it's some compatibility issue:
- solana-cli 1.16.17
- anchor-cli 0.28.0
- solang version v0.3.2
@seanyoung any insight?
I'm aware of this, I have not fully debugged it yet. It certainly looks like a solang issue.
Is there a workaround where I can load the idl from a file within my webapp?
Is there a workaround where I can load the idl from a file within my webapp?
Yes, the IDL is just a JSON file, you can load it from anywhere and pass it to new anchor.Program(idl, ...)
.
Ah that's right, thanks!
I was looking for a way to modify: const idl = await Program.fetchIdl(programID, getProvider());
But a simple import idl from "./testprogram.json";
suffices.
I am having issue initing my idl too. Worth noting that I am able to upgrade existing idls. But unable to init a new idl.
solana-cli 1.16.18 anchor-cli 0.29.0
linking https://solana.stackexchange.com/questions/7897/anchor-idl-upgrade-triggers-require-gte-expression-was-violated if it isnt by any chance related. you can add https://github.com/amilkov3/anchor/commit/b9d85109b6ea318a98a0ab6fce334c1cc9d077f3 and then recompile anchor and run ./target/deploy/anchor init ....
to print the error logs to figure out what the actual errors is
also is this project even being maintained anymore? like can barely get an answer on discord or anywhere else
@conky-dev @amilkov3
This issue is related to Solang only, please create a new issue if you don't use Solang.