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 6 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
48 changes: 48 additions & 0 deletions .github/workflows/ci-lazer-anchor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: "Lazer Solana 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
- name: install taplo
run: cargo install --locked taplo-cli@0.9.3
# Libusb is a build requirement for the node-hid package and so pnpm
# install will fail if this isn't in the build environment and if a
# precompiled binary isn't found.
- name: Install libusb
run: sudo apt-get update && sudo apt-get install -y libusb-1.0-0-dev libudev-dev
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: true
- 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: anchor test
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
16 changes: 16 additions & 0 deletions lazer/solana-anchor/Anchor.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[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 = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
Loading
Loading