Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,28 @@ deno task verify-otel
open http://localhost:16686
```

### Run testnet E2E

Runs the same E2E flow against the live testnet provider and verifies traces in Grafana Cloud.

```bash
cd testnet

# Run E2E against testnet
OTEL_DENO=true OTEL_SERVICE_NAME=moonlight-e2e \
OTEL_EXPORTER_OTLP_ENDPOINT=https://otlp-gateway-prod-ca-east-0.grafana.net/otlp \
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf \
OTEL_EXPORTER_OTLP_HEADERS="Authorization=Basic <base64 of stackId:token>" \
deno run --allow-all main.ts

# Verify traces arrived in Grafana Cloud Tempo
TEMPO_URL=https://tempo-prod-13-prod-ca-east-0.grafana.net/tempo \
TEMPO_AUTH="Basic <base64 of tempoInstanceId:token>" \
deno run --allow-all verify-otel.ts
```

The verify script uses trace-by-ID lookups (deterministic) for all SDK and provider request-path checks, and a targeted TraceQL search for background service spans only.

## E2E in CI

See [e2e/README.md](e2e/README.md) for the Docker compose setup that runs E2E tests in CI without any host dependencies.
Expand Down
2 changes: 2 additions & 0 deletions testnet/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
e2e-trace-ids.json
49 changes: 49 additions & 0 deletions testnet/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { NetworkConfig, type ContractId } from "@colibri/core";
import type { StellarNetworkId } from "@moonlight/moonlight-sdk";

export interface Config {
networkPassphrase: string;
rpcUrl: string;
horizonUrl: string;
friendbotUrl: string;
providerUrl: string;
channelContractId: ContractId;
channelAuthId: ContractId;
channelAssetContractId: ContractId;
networkConfig: NetworkConfig;
networkId: StellarNetworkId;
}

export function loadConfig(): Config {
const networkPassphrase = "Test SDF Network ; September 2015";
const rpcUrl = Deno.env.get("STELLAR_RPC_URL") ??
"https://soroban-testnet.stellar.org";
const horizonUrl = Deno.env.get("HORIZON_URL") ??
"https://horizon-testnet.stellar.org";
const friendbotUrl = Deno.env.get("FRIENDBOT_URL") ??
"https://friendbot.stellar.org";
const providerUrl = Deno.env.get("PROVIDER_URL") ??
"https://moonlight-beta-privacy-provider-a.fly.dev";

const channelContractId = (Deno.env.get("CHANNEL_CONTRACT_ID") ??
"CDMZSHMT2AIL2UG7XBOHZKXM6FY3MUP75HAXUUSAHLGRQ2VWPGYKPM5T") as ContractId;
const channelAuthId = (Deno.env.get("CHANNEL_AUTH_ID") ??
"CAF7DFHTPSYIW5543WBXJODZCDI5WF5SSHBXGMPKFOYPFRDVWFDNBGX7") as ContractId;
const channelAssetContractId = (Deno.env.get("CHANNEL_ASSET_CONTRACT_ID") ??
"CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC") as ContractId;

const networkConfig = NetworkConfig.TestNet({ allowHttp: false });

return {
networkPassphrase,
rpcUrl,
horizonUrl,
friendbotUrl,
providerUrl,
channelContractId,
channelAuthId,
channelAssetContractId,
networkConfig,
networkId: networkPassphrase as StellarNetworkId,
};
}
13 changes: 13 additions & 0 deletions testnet/deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"nodeModulesDir": "auto",
"tasks": {
"e2e": "OTEL_DENO=true OTEL_SERVICE_NAME=moonlight-e2e OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf deno run --allow-all main.ts",
"verify-otel": "deno run --allow-all verify-otel.ts"
},
"imports": {
"@colibri/core": "jsr:@colibri/core@^0.16.1",
"@moonlight/moonlight-sdk": "jsr:@moonlight/moonlight-sdk@^0.7.0",
"@opentelemetry/api": "npm:@opentelemetry/api@^1.9.0",
"stellar-sdk": "npm:@stellar/stellar-sdk@14.2.0"
}
}
Loading
Loading