A plugin for OpenZeppelin Relayer that simplifies submitting Stellar Soroban transactions by handling fees, sequence numbers, and retries.
- Node.js >= 18
- pnpm >= 10
- OpenZeppelin Relayer
LaunchTube can be added to any OpenZeppelin Relayer in two ways:
# From the root of your Relayer repository
cd plugins
pnpm add @openzeppelin/relayer-plugin-launchtube
# Clone and build the plugin
git clone https://github.com/openzeppelin/relayer-plugin-launchtube.git
cd relayer-plugin-launchtube
pnpm install
pnpm build
Now reference the local build from your Relayer’s plugins/package.json
:
Install dependencies:
pnpm install
Inside the Relayer create a directory for the plugin and expose its handler:
mkdir -p plugins/launchtube
plugins/launchtube/index.ts
export { handler } from '@openzeppelin/relayer-plugin-launchtube';
Copy the bundled example and tweak it to your needs:
cp node_modules/@openzeppelin/relayer-plugin-launchtube/config.example.json plugins/launchtube/config.json
Edit plugins/launchtube/config.json
(see Configuration section).
Your Relayer should now contain:
relayer/
└─ plugins/
├─ package.json # lists the dependency
└─ launchtube/
├─ index.ts
└─ config.json
LaunchTube is now ready to serve Soroban transactions 🚀
# Install dependencies
pnpm install
# Build the plugin
pnpm build
# Run tests
pnpm test
# Lint and format
pnpm lint
pnpm format
Launchtube accepts Soroban operations and handles all the complexity of getting them on-chain:
- Automatic fee bumping using a dedicated fund account
- Sequence number management with a pool of sequence accounts
- Transaction simulation and rebuilding
- Retry logic and error handling
Create config.json
in the plugin directory:
{
"fundRelayerId": "launchtube-fund",
"sequenceRelayerIds": ["launchtube-seq-001", "launchtube-seq-002"],
"maxFee": 1000000,
"network": "testnet",
"rpcUrl": "https://soroban-testnet.stellar.org"
}
Configuration Options:
fundRelayerId
: Relayer ID for the account that pays feessequenceRelayerIds
: Array of relayer IDs for sequence accountsmaxFee
: Maximum fee in stroops (1 XLM = 10,000,000 stroops)network
: Either "testnet" or "mainnet"rpcUrl
: Stellar Soroban RPC endpoint
Submit a complete, signed transaction:
curl -X POST http://localhost:8080/api/v1/plugins/launchtube/call \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"params": {
"xdr": "AAAAAgAAAAA...",
"sim": false
}
}'
Submit just the Soroban function and auth entries:
curl -X POST http://localhost:8080/api/v1/plugins/launchtube/call \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"params": {
"func": "AAAABAAAAAEAAAAGc3ltYm9s...",
"auth": ["AAAACAAAAAEAAAA..."],
"sim": true
}
}'
xdr
(string): Complete transaction envelope XDRfunc
(string): Soroban host function XDRauth
(array): Array of Soroban authorization entry XDRssim
(boolean): Whether to simulate the transaction before submission
Note: Provide either xdr
OR func
+auth
, not both.
{
"transactionId": "tx_123456",
"status": "submitted",
"hash": "1234567890abcdef..."
}
- Request Validation: Validates input parameters and extracts Soroban data
- Sequence Account Pool: Acquires an available sequence account
- Auth Checking: Validates authorization entries
- Simulation (if enabled): Simulates transaction and rebuilds with proper resources
- Fee Bumping: Fund account wraps transaction with fee bump
- Submission: Sends to Stellar network
MIT License