Deploying SOON Projects
Welcome to building on SOON Network! In this guide, we’ll walk through creating, deploying, and testing your first project using the Anchor framework.
Create Your Project
Let’s start by setting up a new project in Solana Playground. Open Solana Playground in your browser and follow these steps:
-
Click the “Create a new project” button on the left-side panel
-
Enter a project name
-
Select “Anchor” as your framework
-
Click “Create”
You’ll see a new project with this starter code in lib.rs
:
This program does something simple but important - it creates an account and stores a number in it. Let’s understand each part:
-
The
initialize
function takes a number (data
) and stores it in a new account -
The
Initialize
struct defines what accounts our function needs -
NewAccount
defines the structure of our data storage
Build Your Program
Before deploying to SOON Network, we need to build our program. In the Playground terminal, run:
You’ll notice the declare_id!()
address updates - this will be your program’s address on SOON Network.
Configure SOON Network
Before deploying, we need to switch to SOON’s network to Faucet Devnet:
-
Click the network selector dropdown (shows “devnet” by default)
-
Choose “Custom RPC”
Get Test Tokens
Deploying a program requires some SOL to allocate space for the program. Get some test tokens by running:
Deploy Your Program
Now we’re ready to deploy! Run this command in the terminal:
You should see output indicating your program was deployed successfully. Note that deploying on SOON Network offers several advantages:
-
Faster deployment confirmation thanks to our Layer 2 architecture
-
Lower deployment costs while maintaining security
-
Full Solana program compatibility through our Decoupled SVM
Testing Your Program
The starter project includes a test file in tests/anchor.test.ts
. This demonstrates how to interact with your program:
Run the test with:
You should see output indicating the test passed, along with your stored data value.
View Transaction Details
Each transaction on SOON Network can be viewed in our explorer. Just click the transaction signature link that appears in your test output or add it manually to:
Close Your Program
If you want to recover the SOL allocated to your program, you can close it using:
Replace [PROGRAM-ID]
with the address shown in your declare_id!()
.
Next Steps
Congratulations! You’ve deployed your first program on SOON Network. This is just the beginning - your program is now running on our high-performance Layer 2, ready to power decentralized applications with:
-
Rapid transaction processing through Decoupled SVM
-
Ethereum’s robust security guarantees
-
Cost-effective operation at scale
Ready to build more? Check out our guides on:
-
Creating complex programs with multiple instructions
-
Integrating with other SOON Network programs
-
Optimizing for Layer 2 performance