Prerequisites
- Node.js 18+ installed locally
- A throwaway wallet private key — never use a key that holds real funds for testnet work
- Polygon Amoy testnet MATIC — get free tokens at faucet.polygon.technology
1
Install the SDK and CLI
Install the Ankara Chain TypeScript SDK as a project dependency:Or install the CLI globally so you can run You can also use the CLI without installing it globally by prefixing every command with
ankara commands from any directory:npx:2
Initialize your project
Run the The wizard prompts you for three things:After the wizard completes, your project directory looks like this:The generated
ankara init wizard to scaffold a project directory and generate your config:ankara.config.json starts with just the network set:ankara init writes PRIVATE_KEY= to .env and adds .env to .gitignore. Confirm .gitignore exists and contains .env before committing anything.3
Deploy the Token Factory
The on-chain The CLI reads your
TokenFactory contract must be deployed once per network before you can issue tokens. It acts as a registry and deployment hub for all asset tokens you create.PRIVATE_KEY from .env, deploys the factory contract to Polygon Amoy, and writes the resulting address back to ankara.config.json:You only run
deploy-factory once. After the factory address is saved in ankara.config.json, all subsequent ankara deploy and ankara mint commands read that address automatically.4
Deploy a token
With the factory deployed, you can now issue your first RWA token. Run the interactive deploy wizard:The wizard walks you through selecting an asset template and filling in the asset-specific metadata. Here is an example session deploying a tokenized farmland parcel in Kano State, Nigeria:The six available asset templates are: Farmland, Commodity, Real Estate, Invoice, Carbon Credit, and Mining Rights. Each template has its own metadata schema — see Asset Templates for the full field reference.
5
Mint tokens
Mint fractional shares of the deployed asset to an investor address:The CLI prompts you to select the deployed token (from
ankara.config.json), enter the recipient address, and specify the amount to mint. Token amounts use 18 decimal places by default, matching the ERC-20 standard.Using the SDK Directly
The CLI is a wrapper around the@ankarachain/sdk TypeScript API. For programmatic use in your application — server-side deployment scripts, backend APIs, or automated workflows — use the SDK directly:
deployFarmland() call returns a DeployResult object:
TokenFactory constructor accepts a factoryAddress override. If you omit it, the adapter uses the default factory address for the network — useful once Ankara Chain ships mainnet factory deployments. You can also pass rpcUrl to override the default RPC endpoint, or provider if you already have an ethers Provider instance in scope.
React Hooks
The@ankarachain/sdk/react entry point exports React hooks that wrap the SDK for use in front-end applications. Import from the separate entry point to avoid pulling React into server-side bundles:
Next Steps
Stellar Quickstart
Deploy the same token on Stellar Soroban testnet using the unified SDK API.
Asset Templates
Explore full metadata schemas for all six asset classes.
CLI Commands
Full reference for every
ankara command and flag.TokenFactory SDK
Programmatic deploy API with full TypeScript type signatures.