Skip to content

Nanle-code/StarForge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

62 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

⚑ starforge

A developer productivity CLI for Stellar and Soroban workflows β€” built in Rust.

License: MIT Language: Rust Network: Stellar Status: Active Stellar Wave


Overview

starforge is a free, open-source command-line toolkit for developers building on the Stellar network. It brings together the most common Stellar and Soroban developer workflows β€” wallet management, project scaffolding, and contract deployment β€” into a single fast, ergonomic CLI.

Think of it as the "Hardhat or Foundry" experience for the Stellar ecosystem, built in Rust for speed and reliability.

This project is actively maintained and participates in the Stellar Wave Program on Drips β€” a monthly open-source contribution sprint where contributors earn rewards for merged pull requests.


Features

πŸ”‘ Wallet Management

Create and manage Stellar ed25519 keypairs locally. Generate cryptographically secure keys using proper Stellar strkey encoding (G... for public, S... for secret). Optionally encrypt keys at rest with AES-256-GCM. Fund testnet accounts via Friendbot, list all saved wallets, inspect live on-chain balances, and securely store keys in ~/.starforge/config.toml.

β—» Project Scaffolding

Scaffold new Soroban smart contract projects from battle-tested templates with one command. Choose from: hello-world, token, nft, and voting. Use interactive mode (--interactive) to customize contract options like author, license, storage type, and test inclusion. Also scaffolds full Stellar dApp frontends (Vite + React).

πŸš€ Contract Deployment

Validate, size-check, and deploy compiled Soroban .wasm files to Testnet or Mainnet. Verifies account balance on-chain, calculates WASM hash, and generates the exact stellar contract deploy command to complete the deployment.


Installation

Prerequisites

Build from source

git clone https://github.com/YOUR_USERNAME/starforge.git
cd starforge
cargo build --release

# Move the binary to your PATH
cp target/release/starforge ~/.local/bin/
# or on macOS:
cp target/release/starforge /usr/local/bin/

Verify installation

starforge --version
# starforge 0.1.0

starforge info

Usage

Wallet commands

# Create a new keypair
starforge wallet create alice

# Create a wallet with encrypted storage (prompts for passphrase)
starforge wallet create alice --encrypt

# Create and fund immediately (testnet only)
starforge wallet create deployer --fund

# List all saved wallets
starforge wallet list

# Show wallet details + live balance
starforge wallet show alice

# Reveal secret key (prompts for passphrase if encrypted)
starforge wallet show alice --reveal

# Fund an existing wallet via Friendbot
starforge wallet fund alice

# Remove a wallet
starforge wallet remove alice

Network commands

# Show current network and available networks
starforge network show

# Switch to mainnet
starforge network switch mainnet

# Add a custom network
starforge network add mynet \
  --horizon-url https://my-horizon.example.com \
  --soroban-rpc-url https://my-soroban.example.com

# Switch to custom network
starforge network switch mynet

# Test network connectivity
starforge network test
starforge network test mainnet

Scaffold commands

# Scaffold a Soroban contract (hello-world template)
starforge new contract my-contract

# Scaffold interactively with custom options
starforge new contract my-contract --interactive

# Scaffold with a specific template
starforge new contract my-token --template token
starforge new contract my-nft --template nft
starforge new contract my-vote --template voting

# Scaffold a Stellar dApp frontend (Vite + React)
starforge new dapp my-dapp

Deploy commands

# Deploy a compiled contract
starforge deploy --wasm target/wasm32-unknown-unknown/release/my_contract.wasm

# Deploy to mainnet using a specific wallet
starforge deploy \
  --wasm target/wasm32-unknown-unknown/release/my_contract.wasm \
  --network mainnet \
  --wallet deployer

# Skip confirmation prompt (for CI)
starforge deploy --wasm ./my_contract.wasm --yes

Contract commands

# Inspect a deployed contract instance
starforge contract inspect CCPYZFKEAXHHS5VVW5J45TOU7S2EODJ7TZNJIA5LKDVL3PESCES6FNCI

# Inspect on a specific network
starforge contract inspect CCPYZFKEAXHHS5VVW5J45TOU7S2EODJ7TZNJIA5LKDVL3PESCES6FNCI --network mainnet

Environment info

starforge info

Shell completions

# Bash β€” add to ~/.bashrc
source <(starforge completions bash)

# Zsh β€” add to ~/.zshrc
source <(starforge completions zsh)

# Fish β€” save to fish completions directory
starforge completions fish > ~/.config/fish/completions/starforge.fish

After adding the line to your shell config, restart your shell or run source ~/.bashrc / source ~/.zshrc. Tab-completion for all subcommands and flags will then be active.


Project Structure

starforge/
β”œβ”€β”€ Cargo.toml
└── src/
    β”œβ”€β”€ main.rs                  # CLI entry point + banner
    β”œβ”€β”€ commands/
    β”‚   β”œβ”€β”€ mod.rs
    β”‚   β”œβ”€β”€ wallet.rs            # wallet create/list/show/fund/remove
    β”‚   β”œβ”€β”€ new.rs               # project scaffolding + templates
    β”‚   β”œβ”€β”€ contract.rs          # contract inspect + invoke
    β”‚   β”œβ”€β”€ deploy.rs            # contract deployment
    β”‚   └── info.rs              # environment info
    └── utils/
        β”œβ”€β”€ mod.rs
        β”œβ”€β”€ config.rs            # ~/.starforge/config.toml read/write
        β”œβ”€β”€ horizon.rs           # Horizon API + Friendbot HTTP calls
        β”œβ”€β”€ soroban.rs           # Soroban RPC helpers
        └── print.rs             # Consistent CLI output helpers

Configuration

starforge stores all data in ~/.starforge/config.toml:

network = "testnet"

[[wallets]]
name = "alice"
public_key = "GABC...XYZ"
secret_key = "SABC...XYZ"  # plaintext or encrypted (see Security section)
network = "testnet"
created_at = "2025-01-01T00:00:00Z"
funded = true

[networks.testnet]
horizon_url = "https://horizon-testnet.stellar.org"
soroban_rpc_url = "https://soroban-testnet.stellar.org"

Security

Secret keys can be stored encrypted at rest using the --encrypt flag during wallet creation:

starforge wallet create mykey --encrypt
# You will be prompted to set a secure passphrase

Encryption uses:

  • AES-256-GCM for authenticated encryption
  • Argon2 for key derivation from your passphrase
  • Random salt and nonce for each encryption operation

When revealing an encrypted key, you must provide the correct passphrase:

starforge wallet show mykey --reveal
# You will be prompted for the passphrase

Unencrypted keys (without --encrypt) are stored in plaintext and are suitable only for testnet or throwaway accounts. Do not use plaintext keys on mainnet with real funds.


Contract Templates

Template Description
hello-world Basic contract with a hello(to) function. Great starting point.
token Fungible token scaffold with initialize, mint, balance, transfer.
nft Non-fungible token scaffold with mint, owner_of, transfer.
voting Proposal and voting contract with create_proposal, vote, results.

All templates include a working test suite and a README with build/deploy instructions.


Contributing

This project participates in the Stellar Wave Program on Drips. Contributors who resolve issues during an active Wave earn Points that translate to real USDC rewards.

Read the Terms & Rules before contributing.

How to contribute

  1. Fork the repository
  2. Create a branch: git checkout -b feat/your-feature
  3. Make your changes and commit: git commit -m "feat: description"
  4. Push and open a Pull Request against main

Please keep PRs scoped to a single issue and include a clear description of what changed and why.


License

MIT Β© 2025 β€” See LICENSE for details.


Acknowledgements

Built for the Stellar ecosystem. Participates in the Stellar Wave Program via Drips. Powered by the Stellar Horizon API and Soroban.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages