> For the complete documentation index, see [llms.txt](https://docs.xyo.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xyo.network/developers/how-to-request-xl1-testnet-tokens-1/introduction-1.md).

# Run with Node.js

This tutorial walks you through setting up and **running a local blockchain with a single block producer** using the XYO Layer One Protocol. This guide will have you use the command line to create and pre-fund a test wallet, run a block producer, and simulate transactions using locally generated test tokens. *This setup is fully self-contained and requires no access to the external testnet, "Sequence".*

It’s a great starting point for developers looking to:

* Explore how XL1 handles smart contract interactions
* Understand the local development experience before deploying to public infrastructure
* Test without spending real tokens or revealing production credentials

### Prerequisites

Before you begin, make sure you have the following installed:

* **Node.js version 22 or higher**
* **Google Chrome browser**
  * [Download Google Chrome](https://www.google.com/chrome/) if needed
* **Yarn**
* **Basic knowledge of Terminal / Command Line**

### Run the Sample

#### Clone the Sample Repository

{% code title="command" %}

```bash
git clone https://github.com/XYOracleNetwork/xl1-samples-nodejs
cd xl1-samples-nodejs
```

{% endcode %}

#### Install Dependencies

{% code title="command" %}

```bash
yarn install
```

{% endcode %}

#### Start the Sample

{% code title="command" %}

```bash
yarn runner
```

{% endcode %}

This command immediately triggers two important things:

* It launches a local blockchain with a single block producer
* It generates a unique test wallet and outputs a seed phrase (mnemonic)

It will output something that looks like the following:

<figure><img src="https://2772193239-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FksLB8OMIe18LYmW7pYCd%2Fuploads%2FmhKu6foFrNAbQvIBy4Qy%2FScreenshot%202025-07-24%20at%2011.09.15%E2%80%AFAM.png?alt=media&amp;token=76830378-ddbb-4ac3-b4db-6927a83538ab" alt=""><figcaption></figcaption></figure>

The next section will say something like the following:

<figure><img src="https://2772193239-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FksLB8OMIe18LYmW7pYCd%2Fuploads%2FigaQHzmtvBz6lXAAkdL2%2FScreenshot%202025-07-24%20at%2011.09.23%E2%80%AFAM.png?alt=media&amp;token=a602a840-6803-4f8b-840f-81753d3da24d" alt=""><figcaption></figcaption></figure>

This is the genesis block is the first block your block producer is creating. Once it is created, you've created your own fully local and sovereign XYO Layer One Blockchain! This genesis block also gives your producer wallet address the initial block reward for starting the chain, **which becomes the tokens you can spend for transactions.**

{% hint style="info" %}
Any blocks you create will not be on the Testnet "Sequence", but instead on your local blockchain.
{% endhint %}

Once your block producer is ready, your first transaction occurs:

<figure><img src="https://2772193239-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FksLB8OMIe18LYmW7pYCd%2Fuploads%2FHak19eDJGQOCAGwk2RLv%2FScreenshot%202025-07-24%20at%2011.09.28%E2%80%AFAM.png?alt=media&amp;token=6f983109-49ab-4a58-9d75-af8c7c37f41c" alt=""><figcaption></figcaption></figure>

### Complete a Test Transaction

A transaction is created for you, is added to a created block, and is added to your blockchain.

The process goes:

1. The Wallet creates and signs the transaction.
2. The signed transaction is submitted to your local producer, which is already running.
3. The local producer includes the transaction in a newly created block.
4. This block is then added to your new local XYO Layer One Blockchain and viewable via the Explorer.

You may see a few attempts at this stage, like the example below:

<figure><img src="https://2772193239-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FksLB8OMIe18LYmW7pYCd%2Fuploads%2FbpjwevHT4BCXfpQKo6g4%2FScreenshot%202025-07-24%20at%2011.11.47%E2%80%AFAM.png?alt=media&amp;token=6ec48d40-4e8e-4417-9e06-dbd0213de66a" alt=""><figcaption></figcaption></figure>

#### Successful Transaction

Once the transaction is successful, you can view it on Explore using the link provided in the command line.

You’ll be able to:

* View the transaction hash
* See your wallet address as the sender
* Confirm the signature
* Verify the block ID that includes your transaction
* Optionally see reward-related metadata (even if reward = 0)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.xyo.network/developers/how-to-request-xl1-testnet-tokens-1/introduction-1.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
