SoproX
Search…
Updating to New Releases
Note that this section is to update your existing project to newer versions.
Before update your project to new releases, please make a research about version compatibility to disable unintended errors.
There are two files you need to consider to upgrade namely package.json, and src/program/Cargo.toml.

Package.json

In this file you need to update fields:
testnetDefaultChannel - which should be perfectly matched solona-sdk version in Cargo.toml.
@solana/web3.js - which specifies the version of web3 that the client, an off-chain program, use to communicate with the on-chain program.
other dependencies - which are your options.
After updating the version number, please reinstall those dependencies,
1
npm install
Copied!

Cargo.toml

This one directly affects how your programs will be compiled which may lead your previous build to be stale. You may lose controls of your programs. Thus, carefully consider pros and cons before upgrading.
solana-sdk - you change version to your desired number.
other dependencies - similar to package.json, they are yours.
Cargo doesn't require you reinstall whenever you change versions like npm.
If you are running a devnet, you should restart it for all changes to be propagated.
1
npm run localnet:down
2
npm run localnet:up
Copied!

Version Confusion

Cited from pinned messages in the Solana Discord
There has been some understandable confusion around deploying programs and the versions of the various Solana tools. To help clarify and give current status:
  • A new BPF loader is in the process of being deployed, it's called BPFLoader2
  • BPFLoader2 is enabled on testnet only (NOT on devnet or mainnet yet)
  • solana_sdk rust crate 1.3.5 switches to using BPFLoader2 by default
  • solana-web3.js v0.71.9 requires you to specify which loader to use when loading a program
    Recommendation: The network you choose to deploy determines which loader you will be using:
  • If devnet or mainnet, build your program against solana_sdk v1.3.4 and deploy use the latest solana-web3.js v0.71.9 specifying BPFLoader, or deploy using solana-cli v1.3.4.
  • If testnet, build your program against solana-sdk v1.3.5 or later and deploy using solana-web3.js v0.71.9 specifying BPFLoader2 or deploy using solana-cli v1.3.5 or later.
Last modified 1yr ago