Skip to content

Getting Started with nXCC

Welcome to nXCC! This guide will get you up and running with your first cross-chain worker in just a few steps.

The fastest way to try nXCC is using our all-in-one local setup:

# Clone the repo and start everything
git clone https://github.com/nxcc-bridge/nxcc.git
cd nxcc/node
./run.sh

That’s it! You now have a local nXCC node running at http://localhost:6922.

Create a simple worker that runs in a secure environment:

# Install the CLI
npm install -g @nxcc/cli
# Create a new project with proper structure
nxcc init my-nxcc-app
cd my-nxcc-app
npm install

The CLI creates a complete project structure. Let’s look at the generated worker:

// workers/my-worker.ts (generated by nxcc init)
import { worker } from "@nxcc/sdk";
export default worker({
async launch(eventPayload, { userdata }) {
console.log("Worker launched!", eventPayload, userdata);
},
async fetch(request, { userdata }) {
return {
message: "Hello from nXCC! 🚀",
path: new URL(request.url).pathname,
};
},
});

Build and deploy it:

# Build the TypeScript worker
npm run build
# Deploy to your local node
nxcc worker deploy workers/manifest.template.json --rpc-url http://localhost:6922

Your worker is now running! The CLI automatically creates a launch event when deploying.

  1. Secure Execution: Your JavaScript code runs inside a Trusted Execution Environment (TEE)
  2. No Infrastructure: No need to manage servers, containers, or VMs
  3. Cross-Chain Ready: Your worker can listen to events from 400+ blockchains

Create a worker that reacts to blockchain events:

# Install the CLI for advanced features
npm install -g @nxcc/cli
# Initialize a new project with TypeScript
nxcc init my-event-worker
cd my-event-worker && npm install

Edit workers/my-worker.ts:

import { worker } from "@nxcc/sdk";
export default worker({
async fetch(event, { userdata }) {
console.log("Received blockchain event:", event);
// Your cross-chain logic here
// - Call APIs
// - Send transactions to other chains
// - Access secrets securely
return new Response("Event processed!");
},
});

Build and deploy:

npm run build
nxcc worker deploy workers/manifest.template.json --rpc-url http://localhost:6922

Workers are event-driven. Currently, the CLI automatically adds a launch event, but you can create work orders with blockchain event triggers. Note that events are specified in the work order, not the manifest itself.

For production blockchain integration, you would typically use the work order API to create workers that listen to specific on-chain events.

For production deployments:

docker run -p 6922:6922 ghcr.io/nxcc-bridge/node:latest

Workers: JavaScript/TypeScript code that runs in secure environments and can:

  • React to blockchain events across 400+ chains
  • Handle HTTP requests
  • Access secrets and make API calls
  • Send transactions

Secure by Default: All code runs in Trusted Execution Environments (TEEs) with memory encryption and remote attestation.

Multi-Chain Native: Built-in support for Ethereum, Polygon, Arbitrum, and 400+ other EVM chains.

Follow our progressive tutorial series:

  1. Blockchain Events ← Start here next Build workers that react to on-chain events across multiple blockchains

  2. Identities & Policies
    Add secure credential management and access controls

Ready to build the future of cross-chain applications? Let’s go! 🚀