This guide covers common issues and their solutions when working with the Invoice Liquidity Network SDK, CLI, and smart contracts.
Symptom: NetworkError: Network request failed or ECONNREFUSED
Solutions:
-
Verify the RPC URL in your configuration:
iln config
-
Test connectivity manually:
curl -s https://soroban-testnet.stellar.org/health
-
Check if you're using the correct network endpoint:
- Testnet:
https://soroban-testnet.stellar.org - Mainnet:
https://soroban-mainnet.stellar.org
- Testnet:
-
If behind a firewall, ensure port 443 is open.
Symptom: TimeoutError: simulateTransaction timed out after 15000ms
Solutions:
-
Increase timeout in your SDK configuration:
const sdk = new ILNSdk({ rpcUrl: "...", contractId: "...", networkPassphrase: "...", timeouts: { readMs: 20_000, writeMs: 60_000, simulationMs: 30_000, }, });
-
Check network stability and latency to the RPC server.
-
Try again during off-peak hours if the network is congested.
Symptom: ENOTFOUND or getaddrinfo errors
Solutions:
-
Verify DNS resolution:
nslookup soroban-testnet.stellar.org
-
Check your DNS configuration or try alternative DNS servers.
-
Ensure you have internet connectivity.
Symptom: SimulationError: Transaction simulation failed
Solutions:
-
Check account balance:
iln list --address <your-address>
-
Verify contract state:
iln status --id <invoice-id>
-
Ensure all parameters are valid (amounts, addresses, dates).
-
Use
forceSubmitto bypass simulation if you're confident the transaction will succeed:const builder = new ILNTransactionBuilder(rpcClient); const { transaction } = await builder.forceSubmit(operations, config);
Symptom: InsufficientBalanceError: Insufficient balance to complete the transaction
Solutions:
-
Check your XLM balance:
iln list --address <your-address>
-
Fund your account on testnet:
iln dev seed --scenario new-user
-
Ensure you have enough XLM for transaction fees (typically 0.0001 XLM per operation).
Symptom: InvalidDiscountRateError: Invalid discount rate provided
Solutions:
-
Check the protocol configuration for allowed discount rates:
iln config
-
Ensure the discount rate is within bounds (typically 0-10000 basis points).
-
Use basis points (e.g., 500 = 5%).
Symptom: TokenMismatchError: Token mismatch in transaction
Solutions:
-
Verify the token contract ID matches the one configured in the protocol.
-
Check that the token is listed:
iln config
-
Ensure you're using the correct token for the invoice.
Symptom: TransactionFailedError: Transaction did not succeed. Final status: EXPIRED
Solutions:
-
Increase the transaction timeout:
const txBuilder = new TransactionBuilder(account, { fee: "100", networkPassphrase: "...", }).setTimeout(60); // 60 seconds instead of default 30
-
Resubmit the transaction promptly.
-
Check network congestion.
Symptom: TransactionFailedError: transaction fee exceeds configured maximum
Solutions:
-
Check simulation results to see the required fee:
const { simulation } = await builder.buildTransaction(operations, config); console.log("Required fee:", simulation.minResourceFee);
-
Increase
maxFeein your transaction configuration. -
Reduce the number of operations in batch transactions.
Symptom: WalletNotConnectedError: A transaction signer is required
Solutions:
-
Ensure a signer is configured:
const sdk = new ILNSdk({ signer: createKeypairSigner(secretKey), // ... });
-
For browser apps, use Freighter:
import { createFreighterSigner } from "@iln/sdk"; const signer = createFreighterSigner();
-
Check that Freighter extension is installed and unlocked.
Symptom: ValidationError: submitInvoice must be signed by the freelancer address
Solutions:
-
Verify the signer address matches the expected role:
const address = await signer.getPublicKey(); console.log("Signer address:", address);
-
Use the correct account for the operation:
submitInvoice: Must be signed by the freelancerfundInvoice: Must be signed by the fundermarkPaid: Must be signed by the payer
Symptom: Freighter is not installed or not accessible
Solutions:
-
Install the Freighter browser extension from freighter.app.
-
Ensure the extension is enabled in your browser.
-
Unlock the extension and select the correct network.
Symptom: Transactions fail with signature verification errors
Solutions:
-
Verify you're using the correct network passphrase:
- Testnet:
Test SDF Network ; September 2015 - Mainnet:
Public Global Stellar Network ; September 2015
- Testnet:
-
Check your configuration:
iln config
-
Ensure all components (SDK, CLI, contracts) use the same network.
Symptom: Account not found or 404 errors
Solutions:
-
Ensure the account exists on the network:
iln list --address <address>
-
Fund the account on testnet:
iln dev seed
-
Verify you're querying the correct network.
Symptom: Contract not found or simulation errors
Solutions:
-
Check the contract ID in your configuration.
-
Deploy the contract locally:
iln dev start
-
Verify the contract exists on the network.
Symptom: docker: command not found or Docker connection errors
Solutions:
-
Install Docker Desktop from docker.com.
-
Start Docker Desktop.
-
Verify Docker is running:
docker ps
Symptom: iln dev start fails
Solutions:
-
Check Docker is running:
docker info
-
Reset the environment:
iln dev reset
-
Check logs:
docker logs stellar
-
Ensure ports 8000, 8080 are not in use:
lsof -i :8000
Symptom: iln dev start fails during contract deployment
Solutions:
-
Ensure the Stellar CLI is installed:
stellar version
-
Check the contract WASM files exist in the
contracts/directory. -
Try deploying manually:
stellar contract deploy --wasm contracts/invoice.wasm --network standalone
Symptom: iln dev seed fails
Solutions:
-
Ensure you have testnet XLM in your funding account.
-
Check network connectivity to Friendbot:
curl https://friendbot.stellar.org/?addr=<address>
-
Verify token contract IDs are correct for testnet.
Symptom: tsc or build fails
Solutions:
-
Install dependencies:
pnpm install
-
Check TypeScript version:
npx tsc --version
-
Verify
tsconfig.jsonis correct. -
Clear build artifacts:
rm -rf dist/ node_modules/.cache pnpm install
Solutions:
-
Use a dedicated RPC endpoint instead of public ones.
-
Implement request caching for read operations.
-
Use batch operations for multiple transactions:
const batch = await sdk.batch([ sdk.buildSubmitInvoiceOperation(params1), sdk.buildSubmitInvoiceOperation(params2), ]);
-
Monitor response times:
console.time("rpc-call"); await sdk.getInvoice(invoiceId); console.timeEnd("rpc-call");
Solutions:
-
Use event filters to reduce processed events.
-
Implement proper cleanup:
const unsubscribe = sdk.subscribeToInvoice(id, callback); // Later: unsubscribe();
-
Limit event history size:
const emitter = sdk.createEventEmitter({ maxHistorySize: 50 });
If you encounter issues not covered here:
-
Check the GitHub Issues for similar problems.
-
Review the SDK API Reference.
-
Join the community Discord for real-time support.
-
File a new issue with:
- Error message and stack trace
- SDK and CLI versions
- Network (testnet/mainnet)
- Steps to reproduce