Eclipse Documentation
HomeBridge
  • 🐮Users
    • Getting Started
      • 1. Set Up Your Eclipse Wallet
      • 2. Bridge Assets for Gas and Transactions
      • 3. Explore the Eclipse Ecosystem
      • 4. Engage with the Community on Discord
    • User Resources
    • Unified Restaking Tokens (URTs)
  • 🛠️Developers
    • Getting Started
    • Wallet
      • Mainnet Wallets
      • Testnet & Devnet Wallets
        • Adding Eclipse Wallet to dApp
        • Custom Wallets
    • RPC & Block Explorers
      • Dragon's Mouth gRPC Subscriptions
    • Bridges
      • Eclipse Canonical Bridge
      • Hyperlane
    • Oracles
      • Pyth Network
      • Switchboard
    • NFTs
      • Metaplex
      • Nifty Asset
      • Libreplex (Token-2022)
    • Developer Tooling
      • Faucet
      • Benchmarking
        • Running AMM benchmarking tests
      • Decentralized Identities
        • AllDomains
      • OpenBook Quickstart
      • Multisig
    • Eclipse Bug Bounty Program
    • Eclipse Status Page
    • Frequently Asked Questions
    • Differences Between Eclipse and Solana
    • Eclipse Program Registry Guide
  • 📖Tutorials & Guides
    • Developer Guides
      • Quick Start: "Hello World"
        • Deployment Walkthrough
      • Reading from the blockchain
      • Modifying a Solana dApp to Support Eclipse: "Chomping Glass"
        • Developing on the Solana Virtual Machine (SVM)
        • Multi-chain toggle frontend component
      • Dapp Deployment Tutorial - Eclipse Devnet
        • ⚙️Install Dependencies - Windows
          • Step 1: Install Visual Studio Code (VSC)
          • Step 2: Install Rust and Cargo
          • Step 3: Download Visual Studio C++ Build Tools
          • Step 4: Download Node.js
          • Step 5: Install Git on Windows
          • Step 6: Install the Solana CLI
          • Step 7: Install WSL on Visual Studio Code and Upgrade to WSL2
          • Step 8: Set Up Development Environment in Ubuntu WSL
          • Step 9: Install Anchor on Windows and WSL
        • 🏝️Solana CLI & Solana Keypair
          • Step 1: Set Solana CLI to Use Eclipse Devnet
          • Step 2: Verify Solana CLI Configuration
          • Step 3: Generate a New Solana Keypair
          • Step 4: Claim Devnet ETH for Transaction Fees
          • Optional Step: View Balance on Devnet Explorer
        • 🖥️Creating an Anchor Project in Visual Studio Code
          • Step 1: Initialize Anchor Project
          • Step 2: Update the lib.rs File with Smart Contract Code
          • Step 3: Update the Smart Contract's Cargo.toml File
          • Step 4: Update the Project's Root Cargo.toml File
          • Step 5: Compile Your Program with anchor build
          • Step 6: Deploy Your Project to the Eclipse Devnet
          • Step 7: Verify Program Deployment on the Eclipse Devnet Explorer
        • ✨Building a React App Front-End
          • Step 1: Create a New React Project with TypeScript
          • Step 2: Install Solana Web3.js and Wallet Adapter Dependencies
          • Step 3: Install Additional Dependencies for Enhanced Functionality and Compatibility
          • Step 4: Configure Webpack for Browser Compatibility
          • Step 5: Start the Development Server and Verify Setup
          • Step 6: Implement the UI for Your NFT Minter in App.tsx with Updated Code
      • Eclipse Testnet ETH Transfer Transaction Fee Estimator
        • Program Breakdown
        • Program JSX & CSS
        • Program Execution
      • Pyth: How to Use Real-Time Data in Solana Programs
      • Quick Start: User Guide - Testnet
      • cNFTs on Eclipse
        • Create 1 Million NFTs on Eclipse
        • How to Interact with cNFTs
  • 🧠Eclipse Architecture
    • What is Eclipse Mainnet?
      • Settlement - Ethereum
      • Execution - Solana Virtual Machine (SVM)
      • Data Availability - Celestia
      • Proving - RISC Zero
      • Why Eclipse, Why Ethereum, Why Now
    • Lifecycle of an Eclipse Transaction
  • 📚Additional Resources
    • External Documentation
    • Disclosures
Powered by GitBook
On this page
  • Prerequisites
  • Install Dependencies
  • Getting Sepolia ETH Tokens
  • Deposit Sepolia ETH to Eclipse Testnet
  • Wallet Setup
  • Create a Deposit
  • Deploying the Smart Contract​
  • Integration Assistance
Edit on GitHub
  1. Tutorials & Guides
  2. Developer Guides
  3. Quick Start: "Hello World"

Testnet

Last updated 6 months ago

This guide walks you through deploying a simple smart contract to Eclipse Testnet.

Prerequisites

You'll have to do a few things before you can deploy your smart contract to Eclipse Testnet.

Install Dependencies

Install Rust, and its package manager Cargo.

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

You can check if the installation was successful by running the following commands:

rustc --version
cargo --version

ii. We'll also have to install Node.js and npm using, which will be used later in this guide.

Visit the official and download the installation binary for your system. Versions recommended are 14.0 and above. If you have trouble with this, you might consider using Homebrew or some other package manager.

Note that npm is bundled with the Node.js installation, so you don't have to install it separately.

iii. Now let's install the Solana CLI. This allows you to interact with Solana clusters (Eclipse Testnet in this case).

sudo sh -c "$(curl -sSfL https://release.anza.xyz/v1.18.22/install)"

iv. Instead of setting your Solana CLI to a local cluster, set it to Eclipse Testnet with the following command:

solana config set --url https://testnet.dev2.eclipsenetwork.xyz

v. If this is your first time using the Solana CLI, you will need to generate a new keypair:

solana-keygen new

This will generate a new key pair and save it to your local machine. You will need this key pair to sign transactions to deploy your smart contract to Eclipse Testnet.

Getting Sepolia ETH Tokens

You will need an Ethereum wallet such as Metamask to claim and bridge Sepolia ETH. As a user, you can use Sepolia ETH to explore the Eclipse testnet and dApps deployed on the network.

Sepolia ETH is not meant to be traded, and is only used to test applications.

Sepolia ETH can be claimed from a number of faucets: Alchemy, QuickNode, Chainlink and Infura.

  1. Select 'Ethereum Sepolia' and click 'Continue'

  2. Visit the Alchemy Sepolia faucet and log in with your Alchemy account.

  3. Enter your wallet address in the provided box and click "Get tokens".

Deposit Sepolia ETH to Eclipse Testnet

Once you've acquired Sepolia ETH, this script allows you to deposit Sepolia ETH to the Eclipse test network.

Wallet Setup

Getting Your Ethereum Private Key

Getting Your Eclipse Public Address

Copy the previously generated "Solana" address using the Solana CLI:

solana-keygen new --no-outfile or solana-keygen new --outfile my-wallet.json.

The public key in the output should resemble something like this following: 6g8wB6cJbodeYaEb5aD9QYqhdxiS8igfcHpz36oHY7p8

Create a Deposit

You'll need to install the dependencies with yarn.

Finally, execute the script:

  1. cd eclipse-deposit

  2. npm install

  3. Change name of "example-private-key.txt" to "private-key.txt" and paste your Metamask wallet's private key in the file.

  4. Run the CLI tool with the necessary options:

node bin/cli.js -k <path_to_private_key> -d <solana_destination_address> -a <amount_in_ether> --mainnet|--sepolia 

For example:

Sepolia Testnet Deposit:

node bin/cli.js -k private-key.txt -d 6g8wB6cJbodeYaEb5aD9QYqhdxiS8igfcHpz36oHY7p8 -a 0.004 --sepolia
  • The -k, --key-file option specifies the path to the Ethereum private key file.

  • The -d, --destination option specifies the Solana destination address on the rollup (base58 encoded).

  • The -a, --amount option specifies the amount of Ether to deposit.

  • Use --mainnet or --sepolia to select the network. The tool will use different contract addresses depending on the network.

  • The -r, --rpc-url option is optional and allows overriding the default JSON RPC URL.

A successful command example:

Output
Transaction hash: 0x15041e2f67e821f8a76671aa282f3b7994d81b2c0b3434d67880ef88c9884186

Now that we've set up our environment, we can deploy our smart contract to Eclipse Testnet. Let's make sure that everything is installed properly by running a local Solana cluster.

solana-test-validator

In case the validator fails to start, restart your computer and run the following command:

sudo $(command -v solana-sys-tuner) --user $(whoami) > sys-tuner.log 2>&1 &

We don't need that local Solana cluster but we're using it to check that everything is installed properly. Next, we'll clone the Solana Hello World repository and install the dependencies.

git clone https://github.com/solana-labs/example-helloworld
cd example-helloworld
npm install

Next,

  1. Locate and open the 'Cargo.toml' file at src/program-rust/Cargo.toml. Might see a few outdated dependencies, marked with a red ❌ thanks to the extension.

  2. Update the dependencies according to the latest versions shown right next to the current ones.

We build the smart contract:

npm run build:program-rust

Finally, we can deploy the smart contract to Eclipse Testnet:

solana program deploy dist/program/helloworld.so

Expected output

Program Id: Butt9GJQQPXX6ih65e1Z11R4QyQ8YfAEHit7VmkrLs8v

It might prompt with

// It might prompt with

Error: Account 9BEnr8WzpJ9kaEJQyG65iE6357hcXG8EpDEGgbLi2AZ1 has insufficient funds for spend (0.00331058 SOL) + fee (0.0000026 SOL)
Nothing to worry about, just ask Anmol to send you some Eclipse testnet funds or do it yourself (hint: the command is somewhere up there 👀 )!

Nothing to worry about, just ask Anmol to send you some Eclipse testnet funds or do it yourself (hint: the command is somewhere up there 👀 )!

We can run the JavaScript client and confirm whether the smart contract was deployed successfully:

npm run start

The output should be something like this:

Let's say hello to a Solana account...
Connection to cluster established: http://127.0.0.1:8899 { 'feature-set': 2045430982, 'solana-core': '1.7.8' }
Using account AiT1QgeYaK86Lf9kudqKthQPCWwpG8vFA1bAAioBoF4X containing 0.00141872 SOL to pay for fees
Using program Dro9uk45fxMcKWGb1eWALujbTssh6DW8mb4x8x3Eq5h6
Creating account 8MBmHtJvxpKdYhdw6yPpedp6X6y2U9dCpdYaZJdmwV3A to say hello to
Saying hello to 8MBmHtJvxpKdYhdw6yPpedp6X6y2U9dCpdYaZJdmwV3A
8MBmHtJvxpKdYhdw6yPpedp6X6y2U9dCpdYaZJdmwV3A has been greeted 1 times
Success

Not seeing the expected output?

  • Make sure you've run all the commands in the previous steps.

  • Inspect the program logs by running solana logs to see why the program failed.

An example of what you might find is given below.

Signature: 4pya5iyvNfAZj9sVWHzByrxdKB84uA5sCxLceBwr9UyuETX2QwnKg56MgBKWSM4breVRzHmpb1EZQXFPPmJnEtsJ
Status: Error processing Instruction 0: Program failed to complete
Log Messages:
  Program G5bbS1ipWzqQhekkiCLn6u7Y1jJdnGK85ceSYLx2kKbA invoke [1]
  Program log: Hello World Rust program entrypoint
  Program G5bbS1ipWzqQhekkiCLn6u7Y1jJdnGK85ceSYLx2kKbA consumed 200000 of 200000 compute units
  Program failed to complete: exceeded maximum number of instructions allowed (200000) at instruction #334
  Program G5bbS1ipWzqQhekkiCLn6u7Y1jJdnGK85ceSYLx2kKbA failed: Program failed to complete

Integration Assistance

Here are instructions on how to claim Sepolia ETH on .

Once you have , copy your Ethereum wallet address and your private private key for later use by navigating to "Account details" and clicking "Show private key".

Obtain and set up the deposit.js script:

You can check the transaction hash on .

You can verify your testnet account balance using the .

Deploying the Smart Contract

install "" extension

Do you need additional assistance integrating something special like a wallet, bridge, or something else? Feel free to reach out via .

📖
Node.js download page
Chainlink Sepolia ETH faucet
Sepolia ETH
https://github.com/Eclipse-Laboratories-Inc/testnet-deposit
Sepolia testnet
Eclipse Explorer
​
Even Better TOML
Discord