Developer Resources
  • Overview
    • Introduction
    • TBCs on Solana
  • Get started
    • Quick Start Guide
    • TBC on Solana
      • Step 1: Create token
      • Step 2: Initialize Token Bonding Curve (TBC)
        • TBC Guides
        • TBC Examples
        • FAQs
      • Step 3: Swap Tokens
    • Grants
  • Tools
    • Swap for sRLY
  • Resources
    • FAQ
    • Solana Docs
    • Discord
    • Github
    • Anchor
    • Example React App
  • Archived
    • RLY Rewards
      • Bootstrap phase
      • Mature phase
Powered by GitBook
On this page
  • Prerequisites
  • Additional resources
  • Create your token
  • Step 1: Create Token
  • That's it!
  • Additional Resources
  1. Get started
  2. TBC on Solana

Step 1: Create token

Learn how to create your application token

PreviousTBC on SolanaNextStep 2: Initialize Token Bonding Curve (TBC)

Last updated 1 year ago

Prerequisites

Solana CLI:

RLY CLI:

RLY TS:

npm i -g rly-cli

or

yarn global add rly-cli
$ npm i rly-js

or

yarn add i rly-js

If you're experiencing permission issues installing the npm package globally on your local machine, please visit

Additional resources

  • Example React app:

  • Example TS tests:

Create your token

If you have already created an SPL token via Solana's Token Program, skip to

Step 1: Create Token

Configure your token parameters, additional metadata, and the initial token supply to mint. A balance of at least 1 SOL is required.

rly-cli create-token [options]

Options:
  -e, --env <string>     Solana cluster env name (default:
                         "devnet")
  -k, --keypair <path>   Solana wallet location (default:
                         "--keypair not provided")
  -n, --name <string>    token name
  -s, --symbol <string>  token symbol
  -d, --dec <number>     token decimals (default: "9")
  --supply <number>      initial supply (integer value)
  -h, --help             display help for command
// token

import { Keypair, Connection, clusterApiUrl } from 'solana/web3js`;
import { createToken, getMetadata } from 'rly-js';

const initialSupply = new BN(1_000_000);
const name = "TestToken";
const symbol = "TKNSYMBL";
const decimals = 9

const walletKeyPair = Keypair.generate();
const connection = new Connection(clusterApiUrl("devnet"))
const wallet = new NodeWallet(walletKeyPair)

//create token

const { tx, tokenMint } = await createToken({
            initialSupply,
            tokenData: { name, symbol, decimals },
            connection,
            wallet
        })

// fetch metadata

const metadata await getMetadata({ tokenMint: tokenMint.publicKey, connection })

The default configuration allows you to mint additional tokens after the initial mint.

The initial token supply will be minted to the associated token account for the keypair creating the token.

That's it!

In this section you should have:

  1. Created your on-chain SPL app token

  2. Minted an initial token supply to the associated token account

  3. Verified your token and supply on chain

  4. Verified your token name, symbol, and logo on an explorer/wallet

Additional Resources

Examples:

Solana CLI guide:

Solana wallet guide:

https://docs.solana.com/cli/install-solana-cli-tools
https://github.com/rally-dfs/rly-ts/tree/main/packages/cli
https://github.com/rally-dfs/rly-ts/tree/main/packages/ts
https://docs.npmjs.com/downloading-and-installing-node-js-and-npm
https://rly-ts-eight.vercel.app/
https://github.com/rally-dfs/dfs-ts/tree/main/ts/tests
Step 2: Initializing Token Bonding Curve (TBC).
https://github.com/rally-dfs/dfs-ts/tree/main/ts/tests
https://docs.solana.com/cli/install-solana-cli-tools
https://docs.solana.com/wallet-guide/cli