|
| 1 | +# Stellar Testnet Deployment |
| 2 | + |
| 3 | +This guide documents the minimum path to build, deploy, and smoke-test the Access Layer contracts on Stellar testnet. |
| 4 | + |
| 5 | +It is intentionally lightweight. Use it for contributor validation, review environments, and Wave work before any mainnet discussion. |
| 6 | + |
| 7 | +## Tooling and environment assumptions |
| 8 | + |
| 9 | +Before deploying, make sure the machine running the release checks has: |
| 10 | + |
| 11 | +- Rust stable installed |
| 12 | +- `rustfmt` and `clippy` components installed |
| 13 | +- the `wasm32v1-none` target installed |
| 14 | +- the `stellar` CLI installed and available on `PATH` |
| 15 | +- a funded Stellar testnet identity available in the local CLI config |
| 16 | + |
| 17 | +This repository currently assumes: |
| 18 | + |
| 19 | +- Rust workspace tooling from [`rust-toolchain.toml`](../rust-toolchain.toml) |
| 20 | +- Soroban SDK `22.0.0` from [`Cargo.toml`](../Cargo.toml) |
| 21 | +- a deployable contract crate at [`creator-keys`](../creator-keys) |
| 22 | + |
| 23 | +If your local `stellar` CLI or RPC environment differs, verify the command flags with `stellar --help` before deploying. |
| 24 | + |
| 25 | +## One-time local setup |
| 26 | + |
| 27 | +Install the Rust target used by Soroban contracts: |
| 28 | + |
| 29 | +```bash |
| 30 | +rustup target add wasm32v1-none |
| 31 | +``` |
| 32 | + |
| 33 | +Create a local testnet identity and fund it: |
| 34 | + |
| 35 | +```bash |
| 36 | +stellar keys generate accesslayer-testnet --network testnet --fund |
| 37 | +``` |
| 38 | + |
| 39 | +If you already have an identity, funding it again is usually enough: |
| 40 | + |
| 41 | +```bash |
| 42 | +stellar keys fund accesslayer-testnet --network testnet |
| 43 | +``` |
| 44 | + |
| 45 | +## Build and verify before deployment |
| 46 | + |
| 47 | +Run the normal repository checks first: |
| 48 | + |
| 49 | +```bash |
| 50 | +cargo fmt --all -- --check |
| 51 | +cargo clippy --workspace --all-targets -- -D warnings |
| 52 | +cargo test --workspace |
| 53 | +``` |
| 54 | + |
| 55 | +Build the contract wasm artifact from the repo root: |
| 56 | + |
| 57 | +```bash |
| 58 | +stellar contract build --package creator-keys |
| 59 | +``` |
| 60 | + |
| 61 | +Expected artifact: |
| 62 | + |
| 63 | +```text |
| 64 | +target/wasm32v1-none/release/creator_keys.wasm |
| 65 | +``` |
| 66 | + |
| 67 | +## Deploy to Stellar testnet |
| 68 | + |
| 69 | +Deploy the built wasm and save a local alias for follow-up calls: |
| 70 | + |
| 71 | +```bash |
| 72 | +stellar contract deploy \ |
| 73 | + --network testnet \ |
| 74 | + --source accesslayer-testnet \ |
| 75 | + --alias creator-keys-testnet \ |
| 76 | + --wasm target/wasm32v1-none/release/creator_keys.wasm |
| 77 | +``` |
| 78 | + |
| 79 | +Record the returned contract ID in the pull request or release notes for reviewers. |
| 80 | + |
| 81 | +## Post-deploy smoke test |
| 82 | + |
| 83 | +After deployment, confirm the contract can accept a state-changing call and a read call. |
| 84 | + |
| 85 | +Register a creator profile: |
| 86 | + |
| 87 | +```bash |
| 88 | +CREATOR_ADDRESS="$(stellar keys public-key accesslayer-testnet)" |
| 89 | + |
| 90 | +stellar contract invoke \ |
| 91 | + --network testnet \ |
| 92 | + --source accesslayer-testnet \ |
| 93 | + --id creator-keys-testnet \ |
| 94 | + --send=yes \ |
| 95 | + -- register_creator \ |
| 96 | + --creator "$CREATOR_ADDRESS" \ |
| 97 | + --handle "wave-test" |
| 98 | +``` |
| 99 | + |
| 100 | +Read the stored creator profile back: |
| 101 | + |
| 102 | +```bash |
| 103 | +stellar contract invoke \ |
| 104 | + --network testnet \ |
| 105 | + --source accesslayer-testnet \ |
| 106 | + --id creator-keys-testnet \ |
| 107 | + --send=no \ |
| 108 | + -- get_creator \ |
| 109 | + --creator "$CREATOR_ADDRESS" |
| 110 | +``` |
| 111 | + |
| 112 | +If the second command returns a populated profile with `supply: 0`, the deployment is working at the minimum expected level for this repository. |
| 113 | + |
| 114 | +## Lightweight release checklist |
| 115 | + |
| 116 | +Use this checklist for any contract update that is intended for shared review or a testnet rollout. |
| 117 | + |
| 118 | +- Confirm the branch includes the intended contract changes only. |
| 119 | +- Run `cargo fmt --all -- --check`. |
| 120 | +- Run `cargo clippy --workspace --all-targets -- -D warnings`. |
| 121 | +- Run `cargo test --workspace`. |
| 122 | +- Rebuild the wasm with `stellar contract build --package creator-keys`. |
| 123 | +- Deploy the new wasm to Stellar testnet from a funded identity. |
| 124 | +- Run the register and read smoke tests against the deployed contract. |
| 125 | +- Capture the deployed contract ID and relevant CLI output in the PR description, issue, or release notes. |
| 126 | +- Call out any storage layout, event schema, or authorization changes explicitly for reviewers. |
0 commit comments