# Zero to Hero: Getting Started on Mantle Testnet

By [Mantle Network](https://paragraph.com/@0xmantle) · 2023-02-02

---

Introducing Mantle
------------------

Mantle is an Ethereum Layer-2 (L2) scaling solution that allows for faster and cheaper transactions on the Ethereum network. If you haven’t heard, we recently [launched our Testnet](https://twitter.com/0xMantle/status/1612706669066334209?s=20&t=JmOk66chEZ2EmEYHgMZOqA)! That means you can now connect your dApp to Mantle in just a few steps. In this tutorial we’ll walk through:

1.  Adding Mantle Testnet to MetaMask
    
2.  Acquiring $BIT from the Testnet Faucet
    
3.  Bridging your tokens to Mantle
    
4.  Connecting directly to a Mantle RPC Endpoint
    
5.  Using the Mantle SDK to fetch L1 gas price
    

Just remember, if you have any questions or need support at any point in your journey, send a message in the [Mantle Developer Telegram](https://t.me/mantledevs) or our [Discord](https://discord.com/invite/0xMantle) channel. We’ll be right there with you!

_This tutorial assumes you are already familiar with wallets, Goerli ETH, and adding custom tokens and networks. If you are stuck on any step, or looking for a more in-depth guide, check our Complete Onboarding Guide_ [_here_](https://mirror.xyz/0xmantle.eth/qIDSO3AsFnXmwVLSYfODZWOpK_0K01UdvR3ZxUCtCjw)_._

Add Mantle Testnet to MetaMask
------------------------------

First, you will need to have [MetaMask](https://metamask.io/) installed on your browser.

1\. Once MetaMask is set up, click on your account icon in the top-right corner. 

2\. This will open a menu. Click “Settings” near the bottom.

![](https://storage.googleapis.com/papyrus_images/f03e46b5094fa29abc460c3a1db78d7ef17d33f12d2947d4ad983e29d89b91aa.png)

3\. From there, click on the "Networks" tab.

4\. You will see a button labeled "Add a network".

![](https://storage.googleapis.com/papyrus_images/f934f7dfcbda6b0e1b7debc69b9af0861d23ea7cdc7ba67c3c536415ceae8911.png)

5\. Click on the button “Add a network manually”, which will allow you to enter the following information.

![](https://storage.googleapis.com/papyrus_images/ceaab78a7f12f2b1508953d9ca6087a1b08404b58f3e510a8b8552c6c8b55e5b.png)

**Network Name:** `Mantle Testnet`  
**New RPC URL:** `https://rpc.testnet.mantle.xyz`  
**Chain ID:** `5001`  
**Currency Symbol:** `BIT`  
**Block Explorer URL:** `https://explorer.testnet.mantle.xyz`

![](https://storage.googleapis.com/papyrus_images/1beaa9f5bb8df1a9198b64407b15ab8b3359e059be8d7e3e2aa1f49ee25ba304.png)

You can now click "Save" and Mantle Network will now appear in your list of networks in MetaMask.

![](https://storage.googleapis.com/papyrus_images/618a963100408f817f3713122e6a7efa353e61d2e6bce8889585f1e3dcdaec95.png)

Now that we have our Mantle Testnet configured with MetaMask, we can move on to acquiring $BIT tokens and also gETH that will be needed for gas in various steps.

Acquiring Test $BIT
-------------------

The [Mantle Testnet Faucet](https://faucet.testnet.mantle.xyz/) allows developers to receive testnet $BIT to experiment with the network and deploy their own dApps.

1.  Using the faucet will require a small amount of Goerli ETH ($gETH) to cover the gas fee for minting $BIT. If you need Goerli ETH, you can use either the [Paradigm](https://faucet.paradigm.xyz/) or [Alchemy](https://goerlifaucet.com/) faucets.
    
2.  Visit [https://faucet.testnet.mantle.xyz](https://faucet.testnet.mantle.xyz/), verify your humanity, and enter your Ethereum address. You can mint up to 1,000 $BIT.
    
3.  If you’re having trouble with the faucet, or need more $BIT, let us know in our [developer Telegram](https://t.me/mantledevs) group. We can also send $BIT directly into your Mantle testnet account.
    
4.  You should see $BIT in your wallet shortly! If not, make sure you’ve imported the Goerli testnet $BIT token contract to MetaMask: `0x5a94dc6cc85fda49d8e9a8b85dde8629025c42be`
    

Bridging to Mantle
------------------

You are now ready to bridge your funds over to Mantle. In case you’re wondering, your very same wallet address is waiting for you on the other side.

1.  Visit [https://bridge.testnet.mantle.xyz](https://bridge.testnet.mantle.xyz/) and connect your wallet to Goerli.
    
2.  $BIT is the native token on Mantle, so let’s start by bridging some $BIT. Input your desired amount and click deposit.
    
3.  Confirm the transactions (both on the bridge and in MetaMask).
    

Congratulations, your tokens are on their way to Mantle Testnet! You can confirm their arrival in two ways:

1.  In MetaMask, add Mantle Testnet using [ChainList](https://chainlist.org/?testnets=true&search=Mantle). You should see your $BIT amount displayed as the native balance.
    
    1.  [Click here](https://github.com/mantlenetworkio/mantle-token-lists/blob/main/mantle.tokenlist.json) to see a list of ERC20 tokens supported by the bridge.
        
    2.  If you’ve bridged $gETH you will need to import Mantle’s WETH contract to see it under your asset list: `0xdEAddEaDdeadDEadDEADDEAddEADDEAddead1111`
        
2.  Your tokens may still be on their way, in which case you can enter your address on the [Mantle Block Explorer](https://explorer.testnet.mantle.xyz/) and click “Tokens” to view all tokens in your wallet.
    

Connecting to the RPC Node
--------------------------

Connecting to a node allows dApps to read block data and send transactions to facilitate their business logic. This isn’t limited to initiating token transfers and checking their status, but also other operations where a public record is maintained on-chain for anyone to access and verify. This role is performed by [Sequencers](https://docs.mantle.xyz/for-validators/network-roles#sequencers) on Mantle.

Mantle’s node API supports the JSON-RPC implementation of Ethereum. All the endpoints can be accessed by sending HTTP requests, or establishing a WebSocket connection. More on that [here](https://docs.mantle.xyz/tools-and-sdk/mantle-node-api).

For simplicity, let’s look at the rollup\_gasPrices endpoint, which is one of the most commonly invoked since checking the current gas price is essential to sending valid transactions. The simplest way to use it would be to send HTTP requests to a node. Here’s a sample request that uses the command line tool Curl to fetch the current gas price on L1 and L2.

**Request**

![](https://storage.googleapis.com/papyrus_images/19054e9517b5aa2a3507fc7903002cf049e96c1a4e1e49d6d4f2887db57e66bb.png)

**Response**

![](https://storage.googleapis.com/papyrus_images/3b9fddb386c333b31effb3d597ed41e9a3f6eae5145ee4bb21a58a2042431eb7.png)

Notice how the gas price on L1 is orders of magnitude higher than that on L2! Head over to the [tech docs](https://docs.mantle.xyz/tools-and-sdk/mantle-node-api) to find more reference on other API endpoints. Our [GitHub](https://github.com/mantlenetworkio/mantle) is also a good place to get started.

Using the SDK
-------------

The Mantle SDK is an easy way to integrate the features of Mantle to your dApp. It is a TypeScript library of useful methods and tools that make block data handling and chain interactions more convenient. For instance, tasks such as generating Merkle proofs by passing state data, generating Merkle-Patricia trie proofs for wallet accounts or storage slots, etc.

Let’s look at the **getL1GasPrice** method that fetches the current L1 gas price from a node provider.

1\. Once you’ve created and initialized a project directory, you can install the SDK package using the following command.

![](https://storage.googleapis.com/papyrus_images/421beae11d2c5bc91dde4bc34bfd8500c6d6a8c4fdebfa486dac169e7d40e633.png)

2\. Next, create a test JS script and initialize an ethers and an SDK object. Then call the **getL1GasPrice** method with the SDK object passing an L2 node provider address as parameter. We’ll call the Mantle Testnet RPC, but the same works for a locally deployed node as well.

![](https://storage.googleapis.com/papyrus_images/c18dcb628c19ce34448b5398f14dc9586fe1e70259ff25879f04bb178ff57f7d.png)

3\. Finally, run the script using the node .js command to see the result. The gas price is in _wei_. Feel free to explore the [SDK docs](https://sdk.mantle.xyz/) that contain descriptions for all available SDK methods. Looking for more examples? You can refer to this [compilation of tutorials](https://mantlenetworkio.github.io/mantle-tutorial/) that use the SDK to demonstrate flows such as bridging assets between Ethereum and Mantle, and more. What’s Next? You’re now one step closer to connecting your dApp to Mantle! If you’re building a dApp (or thinking about it!), fill out [this form](https://airtable.com/shruUIyhG4xDKBftH) to let us know what you’re working on and how we can support you. It will also make sure you hear about our future grants and developer success programs. Once you’ve deployed on Mantle, let us know on our [Developer Telegram](https://t.me/mantledevs) so we can celebrate alongside you! Until next time 👋 **_The End_**

---

*Originally published on [Mantle Network](https://paragraph.com/@0xmantle/zero-to-hero-getting-started-on-mantle-testnet)*
