Create programs on X1
Basic setup for creating programs on X1 with Anchor
Last updated
Basic setup for creating programs on X1 with Anchor
Last updated
You can also use .
This section covers the steps to set up your local environment for X1 development.
On Linux, run this single command to install all dependencies.
After installation, you should see output similar to the following:
If the quick installation command above doesn't work, please refer to instructions below to install each dependency individually.
The Solana CLI provides all the tools required to build and deploy Solana programs.
Install the Solana CLI tool suite using the official install command:
You can replace stable
with the release tag matching the software version of your desired release (i.e. v2.0.3
), or use one of the three symbolic channel names: stable
, beta
, or edge
.
If it is your first time installing the Solana CLI, you may see the following message prompting you to add a PATH
environment variable:
If you are using a Linux or WSL terminal, you can add the PATH
environment variable to your shell configuration file by running the command logged from the installation or by restarting your terminal.
To verify that the installation was successful, check the Solana CLI version:
To later update the Solana CLI to the latest version, you can use the following command:
Using command solana-keygen to generate a new wallet. It will generate a 12-word seed (aka. mnemonic, or recovery) phrase. Save it safe.
Use the latest stable rust version:
Check version:
On Linux systems you may need to install libssl-dev, pkg-config, zlib1g-dev, protobuf etc.
Rust installation link for reference:
Install avm using Cargo. Note this will replace your anchor binary if you had one installed:
Install the latest version of the CLI using avm, and then set it to be the version to use:
Verify installation:
Anchor installation link for reference:
programs: <project name> = "program ID" cluster = localnet wallet = path to wallet scripts: how yarn is used to run a test
To verify set network, use:
Verify received airdrop:
Or:
Go back to original <project name> directory, before building and deploying program again.
The byte size is pre-set for initial deployment. You can increase byte size by:
Change localnet to: