Skip to content

IteraLabs/luciene-sl

Repository files navigation

luciene-sl

Transparent and Stateless Agent for OnChain Financial Models.

Local testing

This is done in 3 steps:

  1. Configure and start a local validator.
  2. Generate and fund a signer.
  3. Validate and localy use the program.

In one terminal

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.

In another terminal

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

Devnet deployment

Config

Configure to devnet

solana config set --url devnet

validate

solana config get

Wallet and Funds

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 and deploy program

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 the declare_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

Initialize, update and test program's functionality

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

https://explorer.solana.com/

About

Transparent and Stateless Agent for OnChain Financial Models.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages