Deploy to Solana

Install Dependencies

Ensure you have the following dependencies installed:

  1. Solana v1.18.10

  2. Anchor v0.29.0

Deploy NTT

Create a new NTT project (or use an existing NTT project):

ntt new my-ntt-deployment
cd my-ntt-deployment

Initialize a new deployment.json file, specifying the network.

# Testnet Deployment
ntt init Testnet
# Or, Mainnet Deployment
ntt init Mainnet

Deploy your Solana Token

If you haven't already, deploy a token to Solana.

Deploy an SPL Token (Basic)

1. Generate a new Solana keypair in order to create a wallet:

solana-keygen grind --starts-with w:1 --ignore-case
  1. Set Solana config to use the new keypair:

solana config set --keypair <PATH_TO_KEYPAIR_STEP1>
  1. Set the Solana configuration to use the default RPC URL for devnet:

solana config set -ud
  1. Request an airdrop of 2 SOL and check the balance:

solana airdrop 2 & solana balance
  1. Install or update the SPL Token CLI:

cargo install spl-token-cli
  1. Create a new spl token with the SPL Token CLI:

spl-token create-token 
  1. Create a new account for the token:

spl-token create-account <ADDRESS_CREATED_TOKEN_STEP6>
  1. Mint 1000 tokens to the created account:

spl-token mint <ADDRESS_CREATED_TOKEN_STEP6> 1000
Deploy a token with the Token-2022 Program (Advanced)

1. Generate a new Solana keypair in order to create a wallet:

solana-keygen grind --starts-with w:1 --ignore-case
  1. Set Solana config to use the new keypair:

solana config set --keypair <PATH_TO_KEYPAIR_STEP1>
  1. Set the Solana configuration to use the default RPC URL for devnet:

solana config set -ud
  1. Request an airdrop of 2 SOL and check the balance:

solana airdrop 2 & solana balance
  1. Install or update the SPL Token CLI:

cargo install spl-token-cli
  1. Create a new token with the SPL Token CLI using the token-2022 program:

spl-token create-token --program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb 
  1. Create a new account for the token:

spl-token create-account <ADDRESS_CREATED_TOKEN_STEP6> --program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
  1. Mint 1000 tokens to the created account:

spl-token mint <ADDRESS_CREATED_TOKEN_STEP6> 1000

NTT versions >=v2.0.0+solana support SPL tokens with transfer hooks.

Generate NTT Program Keypair

When you deploy a Solana program, you need to hardcode the program ID (which is itself a pubkey) into the program code. The NTT CLI allows you to do this seamlessly.

Generate a new NTT program keypair using:

solana-keygen grind --starts-with ntt:1 --ignore-case

Derive the 'token-authority' PDA of the newly generated NTT Program id

ntt solana token-authority <your-ntt-program-keypair>

Set SPL token Mint Authority to newly generated 'token authority' PDA

spl-token authorize <TOKEN_ADDRESS> mint <DERIVED_PDA>

If deploying to Solana in burning mode, set the mint authority for your SPL token to the NTT program ID you generated in the previous step.

Deploy NTT

Generate or export your payer keypair, then run:

ntt add-chain Solana --latest --mode burning --token <your-SPL-token> --payer <your-keypair.json> --program-key <your-ntt-program-keypair.json>

The NTT Solana program will then compile and deploy.

Configure NTT

The NTT CLI takes inspiration from git. You can run:

  • ntt status to check whether your deployment.json file is consistent with what's actually on-chain

  • ntt pull to sync your deployment.json file with the on-chain configuration and set up rate limits with the appropriate number of decimals, depending on the specific chain. For example:

    For Solana, the limits are set with 9 decimal places:

        "inbound": {
            "Sepolia": "1000.000000000"  # inbound limit from Sepolia to Solana
        }

    For Sepolia (Ethereum testnet), the limits are set with 18 decimal places:

        "inbound": {
          "Solana": "1000.000000000000000000" # inbound limit from Solana to Sepolia
        }

This initial configuration ensures that the rate limits are correctly represented for each chain's token precision

Push deployment to Solana, specifying the Keypair that will cover the gas fees

ntt push --payer <your-keypair.json>

By default, NTT transfers to Solana support manual relaying, which requires the user to perform a transaction on Solana to complete the transfer. UI components such as Wormhole Connect support this out of the box. For automatic relaying support on Solana, contact Wormhole contributors.

Last updated