| Crates.io | fragmetric-cpi |
| lib.rs | fragmetric-cpi |
| version | 0.5.1 |
| created_at | 2024-12-20 12:05:30.510542+00 |
| updated_at | 2025-03-14 07:26:40.474135+00 |
| description | Fragmetric program library for CPI and clients |
| homepage | https://fragmetric.xyz |
| repository | https://github.com/fragmetric-labs/contracts |
| max_upload_size | |
| id | 1490118 |
| size | 698,795 |
This repository contains the full business logic of Fragmetric on-chain programs and it's test codes.
solana-cli with this reference.anchor-cli (v0.30.1)# instead of using AVM, install from latest git rev to pick a fix for `anchor idl build -- CARGO_ARGS`.
$ cargo install --git https://github.com/coral-xyz/anchor anchor-cli --locked --rev 1c0b2132ec4713343f9c672479721f432ccbf904 --force
# check proper CLI has been installed
$ anchor idl build --help
Generates the IDL for the program using the compilation method
Usage: anchor idl build [OPTIONS] [-- <CARGO_ARGS>...]
Arguments:
[CARGO_ARGS]... Arguments to pass to the underlying `cargo test` command
...
# install node packages
$ yarn
# add below PATH to your shell profile:
export PATH=$PATH:/usr/local/lib/node_modules/node/bin:./node_modules/.bin
# to sync program keypair to ./target/deploy/ dir:
$ anchor run sync-keypairs -- local
# for authorized engineers:
$ anchor run download-keypairs
$ anchor test -p restaking
$ anchor build -p restaking -- --features devnet|mainnet
$ tsx tools/restaking/repl_entrypoint.ts
[?] select target environment (local/devnet/mainnet): local
[7:04:17 PM] [keychain] loaded local wallet
...
[!] Type 'restaking.' and press TAB to start...
http://0.0.0.0:8899 >
# test-validator will be still running after initialization test done.
$ JUST_INIT=1 anchor test --detach -p restaking
...
# now connect to test-validator
$ tsx tools/restaking/repl_entrypoint.ts -- local
...
$ CI=true anchor test -p restaking | sed "s|$(pwd)||g" | sed -e "s|slot=[0-9]*|slot=*|g" | grep -v "anchor" > ./tests/restaking.snapshot.txt
...
# can compare it manually for now...
$ git diff --no-index tests/restaking.snapshot.v0.3.1.txt tests/restaking.snapshot.txt
Anchor.tmoltsx ./tests/mock_mainnet_accounts.ts or anchor run sync-test-accounts