Skip to content

Implement anchor IDL support for C++ #80

Open
@godmodegalactus

Description

We want to implement anchor IDL support for solcpp. At start we do not expect a runtime support for IDL but a generator is fine. The generator will create classes, methods which can be compiled and used to interact with onchain program. This generator can be in any language but preferably python, typescript etc.

For more info check :
https://www.anchor-lang.com/docs/cli#idl

What is anchor IDL :
When you create a smart contract for solana with anchor, with anchor cli you can also create an IDL for the same program. The IDL consists of information about the instructions handled by the program in binary format. This IDL is then uploaded in the cluster so that anyone can query the cluster to find out which instructions are available for a smart contract.

Check https://kevinheavey.github.io/anchorpy/clientgen/ for python implementation to decrypt IDL.
The you should be able to compile this c++ class and then link create library.

You should then test your implementation to interact with basic program like:
https://github.com/coral-xyz/anchor/tree/master/tests/tictactoe

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions