npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@turnstile-portal/deploy

v0.6.9

Published

Turnstile Deployment Tools

Readme

Turnstile Deploy Package

This package provides tools for deploying Turnstile contracts to various environments including local sandbox and testnets.

Architecture

The deploy package is designed with an environment-based architecture that makes it easy to support different deployment environments. The main components are:

  • Environment Configuration - JSON files that specify how to connect to different environments
  • Environment Implementations - Code specific to each environment (local, testnet, etc.)
  • Common Deployment Workflow - Shared deployment logic for all environments

Usage

Deploying to Local Sandbox

# Start a fresh deployment to local sandbox
pnpm tsx packages/deploy/src/scripts/deploy-sandbox.ts

# Or use the CLI directly
pnpm tsx packages/deploy/src/cli.ts deploy -e packages/deploy/examples/local.json \
  -k docker/turnstile-sandbox/sandbox-keys.json \
  -d sandbox_deployment.json \
  --with-tokens \
  --setup-sandbox

Deploying to Testnet

# Deploy to testnet using environment variables for configuration
TESTNET_KEYS=keys/testnet-keys.json \
TESTNET_CONFIG=packages/deploy/examples/testnet.json \
DEPLOYMENT_FILE=testnet_deployment.json \
WITH_TOKENS=true \
pnpm tsx packages/deploy/src/scripts/deploy-testnet.ts

# Or use the CLI directly
pnpm tsx packages/deploy/src/cli.ts deploy -e packages/deploy/examples/testnet.json \
  -k keys/testnet-keys.json \
  -d testnet_deployment.json \
  --with-tokens

Configuration

Environment Configuration

Each environment is configured using a JSON file. Example configuration files are provided in the examples directory:

  • local.json - Configuration for local sandbox development
  • testnet.json - Configuration for testnet deployment

Key Files

Private keys and account information are stored in separate JSON files:

{
  "l1PrivateKey": "0x...",
  "l2PrivateKey": "0x...",
  "l2SecretKey": "0x...",
  "l1Address": "0x...",
  "l2Address": "0x..."
}

Adding New Environments

To add support for a new environment:

  1. Create a new implementation class in src/environments/
  2. Register the implementation in src/environments/index.ts
  3. Create a configuration file for the new environment

Core Components

  • DeploymentEnvironment - Base class that defines the interface for all environments
  • LocalEnvironment - Implementation for local sandbox environments
  • TestnetEnvironment - Implementation for testnet environments

Configuration File Structure

The config.json file uses a unified format for all environments:

{
  "name": "Environment Name",
  "connection": {
    "ethereum": {
      "rpc": "http://example.com/eth-rpc",
      "chainId": 31337
    },
    "aztec": {
      "pxe": "http://example.com/pxe",
      "registryAddress": "0x1234...",  // Required for deployment
      "rollupAddress": "0x5678..."     // Additional Aztec addresses
    }
  },
  "deployment": {
    "overwrite": false,           // Whether to overwrite existing deployment data
    "generateKeysIfMissing": true, // Auto-generate keys if not found
    "tokens": {                   // Tokens to deploy (empty = no tokens)
      "DAI": { "name": "DAI", "symbol": "DAI", "decimals": 18 },
      "USDC": { "name": "USD Coin", "symbol": "USDC", "decimals": 6 }
    }
  }
}

Usage

# Basic deployment with environment name
pnpm tsx packages/deploy/src/cli.ts deploy --env sandbox

# Using a custom config directory
pnpm tsx packages/deploy/src/cli.ts deploy --env devnet --config-dir ./my-configs

# Force overwrite of existing deployments
pnpm tsx packages/deploy/src/cli.ts deploy --env testnet --overwrite

Environment Examples

Example configuration files for different environments are provided in packages/deploy/examples/config-examples/:

  • sandbox/config.json - Local sandbox environment configuration
  • devnet/config.json - Devnet environment configuration
  • testnet/config.json - Testnet environment configuration

To get started, copy these examples to your config directory:

mkdir -p config/sandbox
cp packages/deploy/examples/config-examples/sandbox/config.json config/sandbox/

The deployment command will use these configuration files to deploy all necessary contracts and tokens.