Skip to content
Merged
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
6 changes: 5 additions & 1 deletion packages/api-validator/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ interface Config {
withdrawalAddress: string;
amount: string;
region?: "us" | "eu";
clientId?: string;
}

function loadConfig(): Config {
Expand All @@ -44,6 +45,7 @@ Optional:
ETH_LINK_WITHDRAWAL_ADDRESS 0x-prefixed Ethereum address
ETH_LINK_AMOUNT ETH amount (default: 32)
ETH_LINK_REGION us | eu
ETH_LINK_CLIENT_ID x-client-id header value (random UUID if omitted)

Usage:
ETH_LINK_BASE_URL=https://provider.example.com ETH_LINK_API_KEY=secret eth-link-api-validator`);
Expand Down Expand Up @@ -71,6 +73,7 @@ Usage:
"0x889edC2eDab5f40e902b864aD4d7AdE8E412F9B1", // mock random address
amount: process.env.ETH_LINK_AMOUNT || "32",
region,
clientId: process.env.ETH_LINK_CLIENT_ID,
};
}

Expand Down Expand Up @@ -309,7 +312,7 @@ async function testCreateValidator(config: Config): Promise<void> {
await runTest("POST /eth-link/validators/create", async () => {
const headers: Record<string, string> = {
...commonHeaders(config.apiKey),
"x-client-id": crypto.randomUUID(),
"x-client-id": config.clientId ?? crypto.randomUUID(),
};

// Validate our own request body
Expand Down Expand Up @@ -505,6 +508,7 @@ async function main(): Promise<void> {
console.log(` ${dim("Amount:")} ${config.amount} ETH`);
console.log(` ${dim("Withdrawal:")} ${config.withdrawalAddress}`);
if (config.region) console.log(` ${dim("Region:")} ${config.region}`);
if (config.clientId) console.log(` ${dim("Client ID:")} ${config.clientId}`);
console.log(bold("─".repeat(60)));
console.log("");

Expand Down
Loading