CLI for creating and minting ALIENGOAT tokens on Stellar.
- Testnet workflow is one-command simple (
setup) - Mainnet workflow is supported with safety guards (
--network mainnet --yes-mainnet) - Asset code is parameterized (
--asset-codeorALIENGOAT_ASSET_CODE)
Start here before running commands:
- README-Learn-fast.md — narrative onboarding (the why, not just the how)
- README-Manual-QA.md — manual QA checklist after setup/mint
- README-goatmemo.md — compact 28-byte memo convention (GoatMemo v1)
- README-goatmemo-long.md — long-form encrypted IPFS + Stellar memo-hash pattern
- README-Game-Seeding.md — operator-funded game reward seeding on Stellar
- README-Custodial-Chain.md — cloud-native custody/ownership hierarchy for operators
- README-Social-Narrative.md — why blockchain "immutability" is socially enforced stability
- README-Phase-II-Contracts.md — Soroban contract phase plan + starter scaffold
- README-Trade-XLM.md — practical XLM⇄stable trading checklist and cost discipline
npm install
npm link
cp .env.example .env- Default network:
testnet - For mainnet, pass
--network mainnet(or setALIENGOAT_NETWORK=mainnet) - Any write command on mainnet requires
--yes-mainnet
Write commands: trust, mint, lock-issuer, cleanup.
alien-goats setup --mint-amount 40000000This creates/funds issuer+holder, builds trustline, and mints.
Example with custom asset code:
ALIENGOAT_ASSET_CODE=GATORXYZ alien-goats setup --asset-code GATORXYZ --mint-amount 1000alien-goats --network mainnet trust \
--holder-secret S... \
--issuer G... \
--yes-mainnetalien-goats --network mainnet mint \
--issuer-secret S... \
--destination G... \
--amount 1000 \
--yes-mainnetalien-goats --network mainnet lock-issuer \
--issuer-secret S... \
--auth-required \
--auth-revocable \
--yes-mainnetOptional (irreversible):
alien-goats --network mainnet lock-issuer \
--issuer-secret S... \
--make-immutable \
--yes-mainnetALIENGOAT_NETWORK=testnet
ALIENGOAT_TESTNET_HORIZON=https://horizon-testnet.stellar.org
ALIENGOAT_MAINNET_HORIZON=https://horizon.stellar.org
ALIENGOAT_FRIENDBOT=https://friendbot.stellar.org
ALIENGOAT_ASSET_CODE=ALIENGOAT
ALIENGOAT_ISSUER_SECRET=S...
ALIENGOAT_ISSUER_PUBLIC=G...
ALIENGOAT_HOLDER_SECRET=S...
ALIENGOAT_DESTINATION=G...
ALIENGOAT_PUBLIC=G...
ALIENGOAT_MINT_AMOUNT=1000CLI flags override env vars.
alien-goats keygen
alien-goats fund --public-key G...
alien-goats trust --holder-secret S... --issuer G...
alien-goats mint --issuer-secret S... --destination G... --amount 1000
alien-goats balance --public-key G...
alien-goats setup --mint-amount 100Write commands now support both Stellar memo types:
- Memo Text (
--memo-text): UTF-8 text up to 28 bytes - Memo Hash (
--memo-hash): 32-byte hash as 64 hex characters
Examples:
alien-goats mint --issuer-secret S... --destination G... --amount 1000 --memo-text "GOAT mint v1"
alien-goats mint --issuer-secret S... --destination G... --amount 1000 --memo-hash 71e05ccbb99c36ed5a26d2396b6d28457594aae03c4d555775232b42fc1e1863setup also supports per-step memo controls:
--trust-memo-text/--trust-memo-hash--mint-memo-text/--mint-memo-hash
- Verify asset identity as
ASSET_CODE:ISSUER_PUBLIC(code alone is not unique). - Never publish or commit
ISSUER_SECRET/HOLDER_SECRET. - On mainnet, always dry-run values on testnet first.
- Start with tiny mint amounts before larger batches.
- Keep issuer and distribution duties separate.
- Record tx hashes for trust/mint/lock operations.
Mainnet write blocked...→ add--yes-mainnetonly after review.Memo text too long...→ keep--memo-textto 28 bytes max.Invalid memo hash...→ pass exactly 64 hex chars.Account not found: G...→ destination/trustline account is missing on selected network.Missing <field>...→ provide CLI flag or set matching.envvariable.
npm run test:e2eRuns testnet setup + balance and verifies minted amount appears.
Custom-asset test example:
ALIENGOAT_ASSET_CODE=GATORXYZ npm run test:e2eOptional Soroban step (deploy + init reward-controller as part of e2e):
ALIENGOAT_SOROBAN_TOKEN_ID=C... \
ALIENGOAT_SOROBAN_SOURCE=admin \
npm run test:e2e:soroban
# Optional override (otherwise auto-resolved from `stellar keys address $ALIENGOAT_SOROBAN_SOURCE`):
# ALIENGOAT_SOROBAN_ADMIN_ADDRESS=G...npm run cleanup -- --issuer-secret S... --holder-secret S...Mainnet cleanup requires explicit confirmation:
npm run cleanup -- --network mainnet --issuer-secret S... --holder-secret S... --yes-mainnetCleanup does:
- sends holder ALIENGOAT back to issuer
- removes holder trustline
- merges holder account into issuer
These were generated by this CLI on Stellar testnet during development.
- ISSUER_PUBLIC:
GAOKZGSGUQESQ4LA2TX6CO4DDA6L63Q6U4BIDBAZODOZFAHQSDCI5IGC - ISSUER_SECRET:
SCVVAP3CKALTT4NRRTIFZ4XNZ5Y44RBQ5TAHJ6JM3FXKXY7CYC3VDK4M - HOLDER_PUBLIC:
GDR5NK2KNTXR2KMAMETKU4IV24MMM2KXDLI2E2HUPNMKWYYUPFPU4N5I - HOLDER_SECRET:
SCLO6SCQGZNZZJZ2G55SMA4MDMSTATCDPFJZ6X2OXZMWQZD3IQM7H3PX
- ISSUER_PUBLIC:
GB2AQJO7KSGI7XWI3NBIGO5HXW5AZDLFFBXIBOK4M6AD334OYJZFM2GU - ISSUER_SECRET:
SCSKCYNR2C55PS4JO3WZNS3EM3W7ZGJWRTQLH4Z75EHPVSPBTR5XRTXU - HOLDER_PUBLIC:
GCUVFJPBXSL4U5O3VKVUI7DRSGSG7UDVXMEFMGIWN4ZTLBM3AZARN4AY - HOLDER_SECRET:
SD42UBUDBAU2VDEFHVAL3WZYZBHJGMJBINR3HI2JO27ZHA7ZTIN2WUEK
Note: the cleanup validation holder account was merged, so that holder public key no longer resolves.
These actions create irreversible on-chain effects and can move real value.
cp .env.mainnet.example .envFill .env with your real mainnet values:
ALIENGOAT_NETWORK=mainnetALIENGOAT_ISSUER_PUBLIC,ALIENGOAT_ISSUER_SECRETALIENGOAT_DESTINATIONALIENGOAT_MINT_AMOUNT
- Issuer account exists on mainnet and has enough XLM reserve/fees
- Destination account exists on mainnet and has XLM reserve
- Destination trustline exists for
ALIENGOATfrom your issuer - You are using the correct issuer keypair (public must match secret)
alien-goats --network mainnet trust \
--holder-secret S... \
--issuer G... \
--yes-mainnetUsing env values:
alien-goats --network mainnet mint --yes-mainnetOr explicit args:
alien-goats --network mainnet mint \
--issuer-secret S... \
--destination G... \
--amount 1000 \
--yes-mainnetalien-goats --network mainnet lock-issuer \
--issuer-secret S... \
--auth-required \
--auth-revocable \
--yes-mainnetTo permanently make issuer immutable (cannot be undone):
alien-goats --network mainnet lock-issuer \
--issuer-secret S... \
--make-immutable \
--yes-mainnet- Start with a tiny mint amount first (e.g.,
1) - Verify balances and transaction hash after each step
- Keep issuer secret offline where possible
- Prefer multisig for production issuer/distribution accounts
- Never commit real secrets to git or share in chat logs
See TOKENOMICS.md for seed allocation models, donation-to-token formulas, dilution math, and mint policy guardrails.
A browser-only simulator is included at:
simulator/index.html
It models:
- testnet vs production stages
- account creation (issuer/holder)
- trustline setup
- mint + transfer flow
- seed allocation math (
donation / price * multiplier) - simple market tick for price movement
Quick plain-English glossary for what this CLI is doing.
- Stellar: The blockchain network where these token actions happen.
- Testnet: Practice network with fake value. Safe for development.
- Mainnet: Real network with real value. Actions are production-impacting.
- Issuer Account: The account that creates (issues/mints) your token.
- Distribution/Holding Account: Account that receives and holds issued tokens.
- Asset Code: Token symbol/name on Stellar (here:
ALIENGOAT). - Asset Issuer: The public key of the issuer account; together with asset code it defines the token.
- Trustline: Opt-in permission from a holder account to accept a specific issued asset.
- Mint (Payment op): Sending issued asset units from issuer to destination; this is token issuance in this flow.
- Horizon: Stellar API endpoint used by the CLI to read/write blockchain data.
- Network Passphrase: Chain identity protection (testnet vs mainnet transactions are not interchangeable).
- Base Fee: Network fee paid in XLM per operation in a transaction.
- Memo: Optional short note attached to a transaction.
- Tx Hash: Transaction ID used to verify the exact on-chain action.
- Auth Flags: Issuer controls (e.g., require authorization, revocable trustlines, clawback support).
- Immutable Issuer: Permanent flag that disables future account setting changes (irreversible).
- Account Merge: Closes one account and transfers remaining XLM to another account.
- Create/fund accounts (issuer + holder).
- Holder creates trustline to issuer's
ALIENGOATasset. - Issuer mints by paying
ALIENGOATto holder. - Verify balances and tx hashes on Horizon/explorer.
- (Optional) lock issuer controls for production policy.
- Mainnet Horizon:
https://horizon.stellar.org - Testnet Horizon:
https://horizon-testnet.stellar.org - Testnet Friendbot:
https://friendbot.stellar.org
Useful account query pattern:
https://horizon-testnet.stellar.org/accounts/<PUBLIC_KEY>
https://horizon.stellar.org/accounts/<PUBLIC_KEY>
Useful transaction query pattern:
https://horizon-testnet.stellar.org/transactions/<TX_HASH>
https://horizon.stellar.org/transactions/<TX_HASH>
- Stellar Laboratory (build/sign/inspect tx):
https://laboratory.stellar.org/
- Stellar Expert (explorer):
https://stellar.expert/explorer/publichttps://stellar.expert/explorer/testnet
- Developer Docs:
https://developers.stellar.org/docs
- CLI source:
src/cli.js - Cleanup script:
scripts/cleanup.js - E2E smoke test:
scripts/test-e2e.js - Mainnet env template:
.env.mainnet.example - Token math guide:
TOKENOMICS.md - Browser simulator:
simulator/index.html
- Run command and copy returned
Hash: ... - Open Horizon transaction endpoint with that hash
- Confirm operation type, source account, destination, amount, and asset issuer
- Check destination account balances endpoint