I am following this tutorial on how to create a token with metadata


but when it comes down to creating the token, and trying out this command

spl-token create-token --program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb \
 --enable-metadata my_own_keypair.json

Above returns this Error: Program(IncorrectProgramId)

If --enable-metadata is removed, the token is created without any issues.

I want to update the metadata using a command similar to the one below.

spl-token initialize-metadata niceG6oxHmPcXVdNaUoECzWXn8Jz8fA5Q99QauJ4Gun \
  'Some Token' 'SOME' \

Also, is there a way to specify a maximum supply when creating a token, if not, how do I dos something like that?

  • Most likely, my_own_keypair.json is already being used in another program, because that command works on my own testing. Or you might be using an out-of-date local solana-test-validator.
    – Jon C
    Commented May 28 at 11:52

1 Answer 1


Initialized a token 22 mint with the metadata extension like this.

Try removing the quotes and see if it there is a change.

spl-token initialize-metadata teseCZW7zZkyFJvHpDp7gB6rgvzYJa65XdPWL3Y7ivf Kobeni22 KB2 https://github.com/687c/solana-nft-native-client/blob/main/metadata.json --update-authority  4kg8oh3jdNtn7j2wcS7TrUua31AgbLzDVkBZgTAe44aF

ref: spl-token documentation

As for supply, I am uncertain whether that can be capped using the CLI(I haven't worked with token extensions extensively yet).

You might want to also check out the JS examples

  • what's a token 22 ?
    – AlienDecoy
    Commented May 25 at 20:50
  • Token.extensions program, previously called token program
    – Jimii
    Commented May 25 at 21:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.