Use ecloud SDK
Use the ecloud SDK to:
- Deploy containerized applications to ecloud TEE
- Manage application lifecycle (start, stop, terminate)
- Build and push Docker images with encryption
- Monitor application status and logs
Getting Startedā
- Install ecloud SDK:
npm install @layr-labs/ecloud-sdk
- Create a TypeScript file (for example,
subscribe.ts) that initializes the SDK client and subscribes to EigenCompute:
import { createECloudClient } from '@layr-labs/ecloud-sdk';
async function main() {
const client = createECloudClient({
privateKey: process.env.PRIVATE_KEY as `0x${string}`,
environment: 'sepolia',
verbose: true,
});
console.log('ā Client created!');
console.log('Your address:', client.billing.address);
// Subscribe
const result = await client.billing.subscribe({
productId: 'compute',
successUrl: 'https://example.com/success', // Where to redirect after payment
cancelUrl: 'https://example.com/cancel', // Where to redirect if cancelled
});
if (result.type === 'checkout_created') {
console.log('\nš Complete your subscription here:');
console.log(result.checkoutUrl);
console.log('\nOpen this URL in your browser to add payment details.');
} else if (result.type === 'already_active') {
console.log('ā Already subscribed! Status:', result.status);
} else if (result.type === 'payment_issue') {
console.log('ā ļø Payment issue. Visit:', result.portalUrl);
}
}
main().catch(console.error);
- Run the script with your private key to generate a checkout URL:
PRIVATE_KEY=0x... npx tsx subscribe.ts