Skip to content

ifiokjr/wasm_solana

Repository files navigation

solana development with a rust based wasm client

Continuous integration badge for github actions


Description

This repository contains several crates that make it easier to interact with Solana in WebAssembly environments:

Crate Version Description
memory_wallet 0.1.16 A memory based wallet standard implementation primarily used for testing.
test_utils_insta 0.1 Test utilities for working with insta redactions
test_utils_keypairs 0.1 Test utilities for working with pre defined keypairs
test_utils_solana 0.5 Testing utilities for Solana programs
test_utils_anchor 0.5 Testing utilities specific to Anchor programs
wasm_client_anchor 0.7.0 WebAssembly client for interacting with Anchor programs
wasm_client_solana 0.7.0 WebAssembly client for interacting with Solana programs

Crate Details

  • memory_wallet: A memory based wallet standard implementation primarily used for testing.

  • test_utils_insta: Test utilities for working with insta redactions.

  • test_utils_keypairs: Test utilities for working with pre defined keypairs.

  • test_utils_solana: A collection of utilities to make testing Solana programs easier. Includes helpers for setting up test validators, creating test accounts, and managing test transactions.

  • test_utils_anchor: Extension of test utilities specifically designed for testing Anchor programs. Provides additional helpers for working with Anchor IDLs and program testing.

  • wasm_client_anchor: A WebAssembly client for interacting with Anchor programs. Provides a type-safe interface for program interactions compiled to WebAssembly.

  • wasm_client_solana: A WebAssembly client for general Solana program interactions. Includes methods for account management, transaction building, and RPC interactions.

See the individual crates for more information.

Contributing

scripts

  • anchor: The anchor executable
  • build:all: Build all crates with all features activated.
  • build:docs: Build documentation site.
  • coverage:all: Run coverage across the crates
  • fix:all: Fix all autofixable problems.
  • fix:clippy: Fix clippy lints for rust.
  • fix:es: Fix lints for JS / TS.
  • fix:format: Format files with dprint.
  • generate:keypair: Generate a local solana keypair. Must provide a name.
  • install:all: Install all packages.
  • install:cargo:bin: Install cargo binaries locally.
  • install:solana: Install the version of solana or use one from the cache.
  • lint:all: Run all checks.
  • lint:clippy: Check that all rust lints are passing.
  • lint:es: Check lints for all JS / TS files.
  • lint:format: Check that all files are formatted.
  • release-plz: The release-plz executable
  • setup:ci: Setup devenv for GitHub Actions
  • setup:docker: Setup devenv shell for docker.
  • setup:helix: Setup for the helix editor.
  • setup:vscode: Setup the environment for vscode.
  • test:all: Run all tests across the crates
  • update:deps: Update dependencies.

devenv is used to provide a reproducible development environment for this project. Follow the getting started instructions.

To automatically load the environment you should install direnv and then load the direnv.

# The security mechanism didn't allow to load the `.envrc`.
# Since we trust it, let's allow it execution.
direnv allow .

At this point you should see the nix commands available in your terminal. Any changes made to the .envrc file will require you to run the above command again.

Run the following commands to install all the required dependencies.

install:all

This installs all the node dependencies, cargo binaries and solana tooling locally so you don't need to worry about polluting your global namespace.

Upgrading devenv

If you have an outdated version of devenv you can update it by running the following commands. If you have an easier way, please create a PR and I'll update these docs.

nix profile list # find the <index> of the devenv package
nix profile upgrade <index>

Editor Setup

To setup recommended configuration for your favorite editor run the following commands.

setup:vscode # Setup vscode

License

Unlicense, see the LICENSE file.