Anchor workspace for the Solvent Index options protocol on-chain program.
programs/mhi/— Rust program sourcetests/— TypeScript integration tests (mocha + anchor-bankrun)Anchor.toml— Anchor workspace configCargo.toml/Cargo.lock— Rust workspacepackage.json/tsconfig.json— test harness deps
npm install
anchor build
anchor test # full validator
npm test # bankrun-only suiteThe program ID is declared in Anchor.toml ([programs.localnet]) and in
programs/mhi/src/lib.rs (declare_id!). Update both if you redeploy under a
new keypair.
anchor build emits the IDL and TypeScript bindings as a side effect:
target/idl/mhi.json- IDL consumed by clients and explorerstarget/types/mhi.ts— TypeScript types used by the test harness
To regenerate the IDL without a full program rebuild:
anchor idl build -o target/idl/mhi.jsonTo publish the IDL on-chain after deployment (so explorers and clients can fetch it from the program account):
anchor idl init <PROGRAM_ID> --filepath target/idl/mhi.json
anchor idl upgrade <PROGRAM_ID> --filepath target/idl/mhi.json # subsequent updatesTo fetch the on-chain IDL of a deployed program:
anchor idl fetch <PROGRAM_ID> -o solvent_index.json