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 localhostStart a local validator for testing purposes.
solana-test-validatorAnd 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 buildanchor deployGenerate a signer to be the default
solana-keygen new -o target/deploy/luciene-keypair.jsonConfigure to devnet
solana config set --url devnetvalidate
solana config getoptionally, create a new wallet.
solana-keygen new --outfile ~/.config/solana/id.jsonGet the solana address
solana addressFund the wallet with SOL (in devnet)
solana airdrop 5Verify it was sucessfully created and additioned the new 5 SOL balance
solana balanceBuild the program
anchor buildGenerate the program ID
solana address -k target/deploy/luciene-keypair.jsonNow, update the program ID in the respective codes.
programs/luciene-sl/src/lib.rsin thedeclare_id!("<PROGRAM_ID>")line.Anchor.tomlin the `lucien = "<PROGRAM_ID>"
Now, rebuild the program.
anchor buildValidate manually the PROGRAM_ID is correctly updated. Then, deploy to the devnet.
anchor deployCheck the status of the program, now should be deployed.
solana program show PROGRAM_IDor look at the logs
solana logs PROGRAM_IDIn 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