LibChain Docs Lib Testnet

Get started

Quickstart

Add Lib Testnet to your wallet, get free tLIB, and deploy and call a contract with Foundry, in about five minutes.

You need a browser wallet (Lib Wallet or MetaMask) and, for the contract part, Foundry.

  1. Add the network

    Click the button, or add it by hand with the details on Network details.

  2. Get test tLIB

    Open the faucet in LibChain Hub, paste your address (lib1 or 0x) and request 10 tLIB. It arrives in a few seconds. Lib Wallet users can use the faucet built into the wallet instead.

  3. Check your balance from the command line
    Terminal
    cast balance 0xYourAddress --rpc-url https://rpc-testnet.libchain.tech --ether
  4. Write a contract
    Terminal
    forge init hello-lib && cd hello-lib
    src/Hello.sol
    // SPDX-License-Identifier: MIT
    pragma solidity ^0.8.24;
    
    contract Hello {
        string public greeting = "Hello, LibChain";
    
        event Greeted(address indexed from, string greeting);
    
        function greet(string calldata next) external {
            greeting = next;
            emit Greeted(msg.sender, next);
        }
    }
  5. Deploy it

    Use a test key that only holds tLIB. Never use a key that holds real funds.

    Terminal
    export PRIVATE_KEY=0x...   # a testnet-only key
    forge create src/Hello.sol:Hello \
      --rpc-url https://rpc-testnet.libchain.tech \
      --private-key $PRIVATE_KEY \
      --broadcast

    Foundry prints Deployed to: 0x…. The transaction is final as soon as its block is sealed, usually within two seconds.

  6. Call it
    Terminal
    cast call 0xYourContract "greeting()(string)" --rpc-url https://rpc-testnet.libchain.tech
    
    cast send 0xYourContract "greet(string)" "gm from LibChain" \
      --rpc-url https://rpc-testnet.libchain.tech --private-key $PRIVATE_KEY

    Open https://testnet.libchain.tech/address/0xYourContract to see the contract and its transactions on Lib Explorer.

#Next

Updated 5 November 2026LibChain Docs · Lib Testnet