> For the complete documentation index, see [llms.txt](https://docs.eclipse.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eclipse.xyz/developers/tutorials-and-guides/developer-guides/reading-from-the-blockchain.md).

# Reading from the blockchain

Eclipse Token Dashboard demonstrates essential functionality like connecting wallets, checking balances, and sending tokens - all with a clean, approachable codebase.

## App Preview

Here's what the application looks like when running:

#### Balance View

<figure><img src="https://github.com/Eclipse-Laboratories-Inc/Beginner-Example-App/raw/main/screenshots/balance-view.png" alt=""><figcaption></figcaption></figure>

#### Transfer View

<figure><img src="https://github.com/Eclipse-Laboratories-Inc/Beginner-Example-App/raw/main/screenshots/transfer-view.png" alt=""><figcaption></figcaption></figure>

#### Gas Fee Comparison

<figure><img src="https://github.com/Eclipse-Laboratories-Inc/Beginner-Example-App/raw/main/screenshots/gas-fee-comparison.png" alt=""><figcaption></figcaption></figure>

## Learning Goals

This example project covers:

* Connecting crypto wallets to your dApp
* Displaying token balances
* Transferring tokens between addresses
* Comparing gas fees across networks
* Handling transaction receipts and errors

No previous blockchain experience needed - just basic React knowledge!

## Tech Stack

Built with beginner-friendly tools:

* Next.js
* Solana wallet adapters (compatible with Eclipse)
* shadcn/ui components
* Tailwind CSS

## Getting Started

### Prerequisites

* Node.js 18+
* pnpm (or npm/yarn if you prefer)

### Setup Steps

1. Clone this repo

   ```bash
   git clone https://github.com/Eclipse-Laboratories-Inc/Beginner-Example-App.git
   cd Beginner-Example-App
   ```
2. Install dependencies

   ```bash
   pnpm install
   ```
3. Set up your environment\
   Create a `.env.local` file:

   ```
   # Testnet is easier to start with
   NEXT_PUBLIC_SOLANA_RPC_URL=https://testnet.dev2.eclipsenetwork.xyz

   # For mainnet later (just uncomment)
   # NEXT_PUBLIC_SOLANA_RPC_URL=https://mainnet.eclipsenetwork.xyz
   ```
4. Start the dev server

   ```bash
   pnpm dev
   ```
5. Open <http://localhost:3000> in your browser

### Important! Wallet Setup

Before testing the app:

* Make sure your wallet is set to the Eclipse testnet
* For testnet, use this RPC URL: <https://testnet.dev2.eclipsenetwork.xyz>
* If you switch to mainnet later, update your wallet settings accordingly

### Code Highlights

Some key aspects of the implementation:

#### Wallet Connection

```tsx
// Simple wallet connection with just one line
const { publicKey, sendTransaction, connected, disconnect } = useWallet()
```

#### Sending Tokens

```tsx
// Basic transaction creation and sending
const transferTokens = async () => {
  const transaction = new Transaction().add(
    SystemProgram.transfer({
      fromPubkey: publicKey,
      toPubkey: recipientPubkey,
      lamports,
    })
  );
  
  const signature = await sendTransaction(transaction, connection);
}
```

## Source Code

[Link to Github](https://github.com/Eclipse-Laboratories-Inc/Beginner-Example-App)

### License

This project is MIT licensed - feel free to use it as a starting point for your own applications!


---

# 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.eclipse.xyz/developers/tutorials-and-guides/developer-guides/reading-from-the-blockchain.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.
