Skip to content

Latest commit

 

History

History
102 lines (75 loc) · 2.56 KB

File metadata and controls

102 lines (75 loc) · 2.56 KB

AnchorKit Quick Start

Get up and running with AnchorKit on Stellar testnet in minutes.

Prerequisites

  • Rust toolchain (curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh)
  • Soroban CLI (cargo install --locked soroban-cli)

1. Build

cargo build --release

2. Start from the testnet example config

The fastest way to get started is with the minimal reference config:

cp configs/testnet-example.json configs/my-anchor.json

Open configs/my-anchor.json and replace the placeholder values:

Field What to change
contract.name Your anchor name (lowercase, hyphens only)
attestors[0].address Your attestor's Stellar public key (starts with G)
attestors[0].endpoint Your attestor's HTTPS endpoint URL

3. Validate your config

cargo run --bin anchorkit -- validate configs/my-anchor.json

Expected output:

✔ configs/my-anchor.json: valid JSON

For strict schema validation (field lengths, patterns, enums):

python validate_config.py

4. Run environment diagnostics

cargo run --bin anchorkit -- doctor

5. Register an attestor

cargo run --bin anchorkit -- register \
  --address GYOUR_ATTESTOR_ADDRESS_HERE \
  --services deposits,withdrawals,kyc \
  --endpoint https://your-anchor.example.com

Config reference

The minimal config only requires two top-level sections:

{
  "contract": {
    "name": "my-anchor",        // lowercase alphanumeric + hyphens
    "version": "1.0.0",         // semver
    "network": "stellar-testnet" // stellar-testnet | stellar-mainnet | stellar-futurenet
  },
  "attestors": {
    "registry": [
      {
        "name": "kyc-provider",
        "address": "G...",       // 56-char Stellar public key
        "endpoint": "https://...",
        "role": "kyc-issuer",   // see valid roles below
        "enabled": true
      }
    ]
  }
}

Valid attestor roles: kyc-issuer, transfer-verifier, compliance-approver, rate-provider, attestor

See configs/testnet-example.json for the annotated minimal config, or the more complete examples:

  • configs/fiat-on-off-ramp.json — fiat deposit/withdrawal with KYC
  • configs/remittance-anchor.json — cross-border remittance with AML
  • configs/stablecoin-issuer.json — stablecoin issuance with reserve audits

Further reading