How to get idl from rust on-chain program of solana?

Viewed 1065

I have just started to work as Solana developer.
I have developed my own smart contract but I can't get idl even after building.
How can I call the contract function?

2 Answers

did you try anchor?

Anchor is a framework for Solana's Sealevel (opens new window)runtime providing several convenient developer tools.

  • Rust crates and eDSL for writing Solana programs

  • IDL (opens new window)specification

  • TypeScript package for generating clients from IDL

  • CLI and workspace management for developing complete applications

If you're familiar with developing in Ethereum's Solidity (opens new window), Truffle (opens new window), web3.js (opens new window)or Parity's Ink! (opens new window), then the experience will be familiar. Although the DSL syntax and semantics are targeted at Solana, the high level flow of writing RPC request handlers, emitting an IDL, and generating clients from IDL is the same.

Easiest way is use https://beta.solpg.io/. This is like Remix for solidity.

You write your contract, build and then export idl.

enter image description here

Related