Urgent.News

What's breaking now, across hundreds of outlets.

Tech

devnet-fixtures: funded wallets, mints and token balances from a YAML file

An end-to-end test for a Solana app needs a starting state before it can check anything. There must be a wallet with some SOL to pay fees, a second wallet to receive, a mint with known decimals, token accounts, and balances the test can assert on. Most projects build that state with a setup script: a few airdrops, a mint creation, some mintTo calls, then a list of addresses copied into…

Devnet-fixtures is a small command-line interface (CLI) designed to simplify end-to-end testing of Solana applications. The tool generates a starting state for a test by creating wallets, mints, and token balances from a YAML configuration file. Users can specify the needed wallets, mints, and token balances in the YAML file, and devnet-fixtures handles the rest, including creating them on a cluster and printing their addresses as .env lines or JSON.

The YAML spec consists of various sections for cluster selection, key management, airdrops, accounts, mints, and token accounts. Users can customize the configuration to suit their testing needs. Some key features of devnet-fixtures include:

1. Testing on multiple networks: devnet-fixtures supports localnet, devnet, testnet, and can also be used with a custom URL. It falls back to a local validator if the specified network is not available.

2. Automated airdrops: The tool handles airdrops with caution, splitting requests into chunks and retrying with exponential backoff. If airdrops still fail, it can use a configured funder wallet to transfer SOL.

3. Token minting: devnet-fixtures supports creating SPL Tokens and Token-2022 mints using the default token program or Token-2022, respectively. It ensures exact amounts are used to avoid float drift.

4. Idempotent runs: The keypairs are reused from the keysDir, and mints are remembered per cluster genesis hash in keysDir/state.json. This allows for idempotent runs without creating duplicate transactions.

5. Environment variables: The tool outputs public keys and keypair file paths in .env lines or JSON format, which can be used as environment variables in subsequent test steps.

To use devnet-fixtures, users need Node.js 20 or later and a solana-test-validator running locally. The tool can be cloned, built, and executed from the checkout directory with various flags to customize the output format and how the generated environment variables are handled.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

How to run your test suite in a clean microVM with sandscale sandbox run

Sometimes you want to know whether your tests pass on a clean machine, not on the laptop that has accumulated three years of global packages.

  • Use sandscale sandbox run command to run test suite in clean microVM.
  • --sync . flag copies current folder to sandbox's /workspace directory.
  • --keep flag preserves sandbox for further inspection upon failure.

n2n supernode's REGISTER_SUPER_NAK path trusted a 16-bit length

n2n supernode's REGISTER_SUPER_NAK path trusted a 16-bit length The n2n peer-to-peer VPN uses supernodes to help edges find each other and exchange control messages.

  • n2n VPN uses supernodes for communication
  • CVE-2026-136404 allows supernode registration with oversized tokensize
  • Mitigation involves patching, restricting UDP access, and monitoring

A website chat that only answers from what you approve

Most website chatbots fail in a boring way. They answer confidently, and they answer wrong. If a visitor asks "Do you serve Whitefield on weekends?" and the bot makes something up, you have created a…

  • BPAI's chatbot only responds with business owner-approved information
  • Visitors can ask questions in their own words, AI provides approved answers
  • Human team members can take over when AI lacks specific information

More from Friday 27 November →