Hello World on Axion
We at axion think solana tooling is great thats why we are focused on making 1:1 dropin replacement to solana.
This guide walks you through deploying a simple smart contract to Axion Testnet. we are wire compatible with solana, so every tool used on solana should work same, just have to change some endpoint.
Prerequisites
You'll have to do a few things before you can deploy your smart contract to Axion Testnet.
Install Dependencies
Install Rust, Cargo.
Copy
You can check if the installation was successful by running the following commands:
Copy
ii. We'll also have to install Node.js and npm using, which will be used later in this guide.
Visit the official Node.js download page and download the installation binary for your system. Versions recommended are 20 and above. If you have trouble with this, you might consider using Homebrew or some other package manager.
Note that npm is bundled with the Node.js installation, so you don't have to install it separately.
iii. Now let's install the Solana CLI. This allows you to interact with Solana clusters (Axion Testnet in this case).
Copy
iv. Instead of setting your Solana CLI to a local cluster, set it to Axion Testnet with the following command:
Copy
v. If this is your first time using the Solana CLI, you will need to generate a new keypair:
Copy
This will generate a new key pair and save it to your local machine. You will need this key pair to sign transactions to deploy your smart contract to Axion Testnet.
Getting Your Axion Public Address
Copy the previously generated "Solana" address using the Solana CLI: solana-keygen new --no-outfile
or solana-keygen new --outfile my-wallet.json
.
The public key in the output should resemble something like this following: 2YkWYdXYWQ1gzLhVPFrXQZkjvLqYSdJbXceeVUSbmfED
Deploying the Smart Contract
Now that we've set up our environment, we can deploy our smart contract to Axion Testnet. Let's make sure that everything is installed properly by running a local Solana cluster.
Copy
In case the validator fails to start, restart your computer and run the following command:
Copy
We don't need that local Solana cluster but we're using it to check that everything is installed properly. Next, we'll clone the Solana Hello World repository and install the dependencies.
Copy
We build the smart contract:
Copy
Finally, we can deploy the smart contract to Axion Testnet:
Copy
We can run the JavaScript client and confirm whether the smart contract was deployed successfully:
Copy
The output should be something like this:
Copy
Not seeing the expected output?
Make sure you've run all the commands in the previous steps.
Inspect the program logs by running
solana logs
to see why the program failed.
An example of what you might find is given below.
Copy
Last updated