Transparent and Stateless Agent for OnChain Financial Models.
This is done in 3 steps:
- Configure and start a local validator.
- Generate and fund a signer.
- Validate and localy use the program.
Start from empty project
cargo clean && anchor clean
Configure Solana CLI to use localhost
, which usually would be http://localhost::8099
solana config set --url localhost
Start a local validator for testing purposes.
solana-test-validator
And this will run undefinitely until stopped.
Make sure there is enough balance,
solana balance
If not enough balance, you can airdrop yourself solana tokens.
solana airdrop 10
build the anchor program
anchor build
anchor deploy
Generate a signer to be the default
solana-keygen new -o target/deploy/luciene-keypair.json
Configure to devnet
solana config set --url devnet
validate
solana config get
optionally, create a new wallet.
solana-keygen new --outfile ~/.config/solana/id.json
Get the solana address
solana address
Fund the wallet with SOL (in devnet)
solana airdrop 5
Verify it was sucessfully created and additioned the new 5 SOL balance
solana balance
Build the program
anchor build
Generate the program ID
solana address -k target/deploy/luciene-keypair.json
Now, update the program ID in the respective codes.
programs/luciene-sl/src/lib.rs
in thedeclare_id!("<PROGRAM_ID>")
line.Anchor.toml
in the `lucien = "<PROGRAM_ID>"
Now, rebuild the program.
anchor build
Validate manually the PROGRAM_ID
is correctly updated. Then, deploy to the devnet
.
anchor deploy
Check the status of the program, now should be deployed.
solana program show PROGRAM_ID
or look at the logs
solana logs PROGRAM_ID
In order to conduct tests, as they are defined in /test
run the following command
with the --skip-local-validator
flag in order to avoid the full cycle of build, deploy,
test and shutdown. In favor for a more granular sequence.
anchor test --skip-local-validator