3

The documentations explain how to deploy a Solana program using the CLI tools. Is there a way to achieve that in JS/TS using the @solana/spl-token client?

Edit: What I actually meant is @solana/spl-token or @solana/web3 or the JavaScript SDK in general. I apologize for the confusion.

1

2 Answers 2

5

Technically you can deploy with javascript, but it is quite lengthy and usually not recommended due to the amount of transactions that need to be executed.

Solana Playground runs deploy using just typescript implementing the BPFUpgradableLoader Program.

1

TL;DR NO.

If it exists, Maybe Jon C. is the best person to answer that.

The @solana/spl-token library, only enables you to interact with the Token Program and the ATA program when using JS/TS.

Are you facing any challenges using the cli tools?

5
  • I'm trying to keep my whole workflow around TypeScript and have my own set of functions to interact with Solana network. Using CLI isn't reliable in my case since I won't have full flexibility especially when it's about key management.
    – iMrDJAi
    Commented Oct 4, 2023 at 17:38
  • Do you have a Solana Program? If upgrading your program is a concern you can make your program immutable.
    – Jimii
    Commented Oct 4, 2023 at 17:43
  • Actually, I plan to keep the program upgradable since I'm planning to add more features in the future.
    – iMrDJAi
    Commented Oct 4, 2023 at 17:50
  • Well, the only option that I would suggest which is counter intuitive is to write TS/JS scripts that call the solana-cli commands. Also, if you are writing a solana program I'd highly suggest using anchor, but you can also write solana programs in Python using seahorse or even Move but I am not certain about the product readiness of the last two.
    – Jimii
    Commented Oct 4, 2023 at 18:14
  • As far as I understand, it is possible to make custom transaction instructions with @solana/web3. I think I can implement this functionality, but I need help finding out what transactions are being sent when deploying a program and their payload schema.
    – iMrDJAi
    Commented Oct 4, 2023 at 18:44

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.