Skip to content

feat(lazer): add anchor based example for solana #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Apr 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/ci-lazer-anchor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: "Lazer Anchor contract test"
on:
push:
branches:
- main
pull_request:
paths:
- lazer/solana-anchor/
- .github/workflows/ci-lazer-anchor.yml

jobs:
lazer-anchor-example-test:
name: Lazer Anchor example contract test
runs-on: ubuntu-22.04
defaults:
run:
working-directory: lazer/solana-anchor/
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: 1.82.0
- uses: actions/setup-node@v4
with:
node-version: 22
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 10
run_install: |
recursive: false
cwd: lazer/solana-anchor/
- name: Install Solana Cli
run: |
sh -c "$(curl -sSfL https://release.anza.xyz/stable/install)"
echo "$HOME/.local/share/solana/install/active_release/bin" >> "$GITHUB_PATH"
- name: Set Solana Cli version
run: agave-install init 1.18.26
- name: Create Solana key
run: solana-keygen new --no-bip39-passphrase
- name: Install Anchor
run: |
rustup install 1.79.0
rustup install nightly-2025-04-15
RUSTFLAGS= cargo +1.79.0 install --git https://github.com/coral-xyz/anchor --tag v0.30.1 --locked anchor-cli
- name: Run anchor tests
run: pnpm run test:anchor
File renamed without changes.
7 changes: 7 additions & 0 deletions lazer/solana-anchor/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.anchor
.DS_Store
target
**/*.rs.bk
node_modules
test-ledger
.yarn
7 changes: 7 additions & 0 deletions lazer/solana-anchor/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.anchor
.DS_Store
target
node_modules
dist
build
test-ledger
21 changes: 21 additions & 0 deletions lazer/solana-anchor/Anchor.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[features]
resolution = true
skip-lint = false

[programs.localnet]
solana_anchor = "FpmpVrP57C6ADT8d4dQp9TkM1vmxohZJ5WEQQc9RGLPY"

[registry]
url = "https://api.apr.dev"

[provider]
cluster = "Localnet"
wallet = "~/.config/solana/id.json"

[scripts]
test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"

[test]
[[test.genesis]]
address = "pytd2yyk641x7ak7mkaasSJVXh6YYZnC7wTmtgAyxPt"
program = "fixtures/pyth_lazer_solana_contract.so"
Loading
Loading