In this series, we will build our decentralized exchange on Solana. There is some similar guide on the Internet, but I found they are somehow dated. I have modified their code and built the project at least twice to ensure they are functional now (Oct 2022). At the end of this series, we will be able to create our token and build a cloned oyster swap on the Solana chain. You may vist the final product here.
Step 1: We must install the Solana tool suite on our computer. You may find the documentation here or find it on the Solana discord. In this article, I will use Windows 10 as an example. Follow the instructions on Solana documentation to install the Solana tool suite if you are using other OSs.
Step 2: Go to the start menu and search for the command prompt. Run it as administrator.
Step 3: Enter the command below to download the installer into a temporary directory (It is the same as the Solana documentation page)
curl https://release.solana.com/v1.14.3/solana-install-init-x86_64-pc-windows-msvc.exe --output C:\solana-install-tmp\solana-install-init.exe --create-dirs
Step 4: Enter the command below to install the Solana tool suite version I used. You may refer to the Solana documentation to install the latest version.
C:\solana-install-tmp\solana-install-init.exe v1.14.3
Step 5: After installing the Solana tool suite, use a new command prompt without admin rights and then move to the folder below.
cd C:\Users\silicon\.config\solana
In my case, it is
cd C:\Users\silicon\.config\solana
Step 6: Generate a wallet using the command below. Copy your pubkey (your wallet) address for later use. For example, my pubkey (wallet address) is 4yM8YKG84DSFvvSryBXwhK4Fmu4QHdCWSGV8K12zVLFy. REMEMBER TO JOT DOWN YOUR SEED PHRASE AND STORE IT IN A SAFE PLACE.
solana-keygen new --outfile id.json
Step 7: Move to the Solana Devnet with the command below.
solana config set --url https://api.devnet.solana.com
Step 8: Set up your wallet using the command below.
solana config set --keypair id.json
Step 9: Obtain some free SOL for testing with this command. You cannot get more than 2 sol each time. Don’t be so greedy XD.
solana airdrop 2
In my case, it is
solana airdrop 2 4yM8YKG84DSFvvSryBXwhK4Fmu4QHdCWSGV8K12zVLFy
Step 10: You may check your balance with the command below
solana balance
In my case, it is
solana balance 4yM8YKG84DSFvvSryBXwhK4Fmu4QHdCWSGV8K12zVLFy
We have created our wallet with the Solana tool suite and obtained some free SOL for testing on the Devnet. The following article will teach you how to make your token on Solana.
If you think this article is helpful, leave a comment below. 🙂
You may also sponsor this website by sending some SOL to this address: AGzgnsepqh7NePfTrNWfrXPaRXKd1ce8jUwfmFh9FfMe