coral-xyz / anchor

⚓ Solana Sealevel Framework
https://anchor-lang.com
Apache License 2.0
3.36k stars 1.25k forks source link

`anchor idl init` deploys new idl data account and doesn't show `Anchor Program IDL` at the program address page at the explorers #3015

Open ouoabcde opened 3 weeks ago

ouoabcde commented 3 weeks ago

When I run anchor idl init, this deploys new idl data account. I'm new to the solana and anchor, so I have no idea that this is the right result, but anyway it does deploys the idl account. At devnet, I used this command.

$ anchor idl init --filepath target/idl/<program_name>.json 5yYKAKV5r62ooXrKZNpxr9Bkk7CTtpyJ8sXD7k2WryUc --provider.cluster devnet

And this command generated this new account, 6MiEUjVXFR4dL12vLQXjft8pa4QBZmWiYmNWaKYA7B1N. You can find it at the explorer.

I understand that this command is for publishing the anchor idl file to the on-chain, but I can't find the Anchor Program IDL tab at any of those accounts (5yYKAKV5r62ooXrKZNpxr9Bkk7CTtpyJ8sXD7k2WryUc: program account, 6MiEUjVXFR4dL12vLQXjft8pa4QBZmWiYmNWaKYA7B1N: idl data account).

What should I do to show the Anchor IDL file at the explorer? Is this command is not for this?

My version

acheroncrypto commented 3 weeks ago

Your IDL has been successfully deployed on-chain, but the Solana explorer doesn't yet support the latest IDL spec.

You can verify this by running:

anchor idl fetch 5yYKAKV5r62ooXrKZNpxr9Bkk7CTtpyJ8sXD7k2WryUc --provider.cluster devnet

It might be worth it to create an issue in the Solana Explorer repo to update Anchor as it's using an ancient version of Anchor (0.23.0):

https://github.com/solana-labs/explorer/blob/06b186421c6d8eb8383e21d72f55f859a3fd7e0c/package.json#L20

Or comment on https://github.com/solana-labs/explorer/issues/316.