Install required library:
sudo apt-get install libudev-dev cargo
Install Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Install solana cli tool
(See solana-cli usage)
sh -c "$(curl -sSfL https://release.solana.com/stable/install)"
Install spl-token-cli
cargo install spl-token-cli
Next, create new keypair
solana-keygen new --outfile ~/.config/solana/devnet.json
You will get:
- path to ID:
~/.config/solana/devnet.json
- pubkey:
A8wk...Xu
[you can see it by typingsolana-keygen pubkey
] - passphrase to recover your new keypair:
throw board ... lawn response
. Store it!
Next, say solana to use generated key and set network to devnet
solana config set --keypair ~/.config/solana/devnet.json --url https://api.devnet.solana.com
Next, add balance (run in additional window, it will take long time):
for i in {1..25}; do solana airdrop 1; sleep 1; done
cd js; npm install; cd -
Full documentation is available at https://spl.solana.com/token-swap
Smart Contract is in the ./program
directory.
JavaScript bindings are available in the ./js
directory.
cd js; npm run build:program; cd -
Need to have at least 4 SOL.
cd js; npm run deploy:program; cd -
To get wallet address run
solana address
Provide Roman address and ask to send you coins To confirm you have enough tokens run
spl-token accounts
To get SOL (Wrapped) run:
spl-token wrap 25
Create js/.env
by running the following command
cd js; npm run cluster:devnet; cd -
- SOLX: 3Wm65cRmFAbiC52YXjw1dZkJLsYA75kvNFBdaZVjVQwD
- USDC: CB74zeEZk138FikM4W7b71eshsFttLq3LRFWqpAwXFXi
- USDT: CWgY911b1UszYmKiGYAoEbWrTNNgY1KuybJufzhsTxKx
- SOL(WRAP): So11111111111111111111111111111111111111112
Fullfill js/.env and run:
cd js; npm run create-pool; cd -