Skip to content

Get Started with Moonbase Alpha

Network Endpoints

Moonbase Alpha has two types of endpoints available for users to connect to: one for HTTPS and one for WSS.

If you're looking for your own endpoints suitable for production use, you can check out the Endpoint Providers section of our documentation. Otherwise, to get started quickly you can use one of the following public HTTPS or WSS endpoints.

Provider RPC URL
Blast
https://moonbase-alpha.public.blastapi.io
OnFinality
https://moonbeam-alpha.api.onfinality.io/public
PureStake
https://rpc.api.moonbase.moonbeam.network
Provider RPC URL
Blast
wss://moonbase-alpha.public.blastapi.io
OnFinality
wss://moonbeam-alpha.api.onfinality.io/public-ws
PureStake
wss://wss.api.moonbase.moonbeam.network

Relay Chain

To connect to the Moonbase Alpha relay chain, you can use the following WS Endpoint:

Provider RPC URL
PureStake
wss://frag-moonbase-relay-rpc-ws.g.moonbase.moonbeam.network

Quick Start

For the web3.js library, you can create a local Web3 instance and set the provider to connect to Moonbase Alpha (both HTTP and WS are supported):

const Web3 = require('web3'); //Load Web3 library
.
.
.
//Create local Web3 instance - set Moonbase Alpha as provider
const web3 = new Web3('https://rpc.api.moonbase.moonbeam.network'); 
For the ethers.js library, define the provider by using ethers.providers.StaticJsonRpcProvider(providerURL, {object}) and setting the provider URL to Moonbase Alpha:

const ethers = require('ethers');

const providerURL = 'https://rpc.api.moonbase.moonbeam.network';
// Define Provider
const provider = new ethers.providers.StaticJsonRpcProvider(providerURL, {
    chainId: 1287,
    name: 'moonbase-alphanet'
});

Any Ethereum wallet should be able to generate a valid address for Moonbeam (for example, MetaMask).

Chain ID

Moonbase Alpha TestNet chain ID is: 1287, which is 0x507 in hex.

Block Explorers

For Moonbase Alpha, you can use any of the following block explorers:

For more information on each of the available block explorers, please head to the Block Explorers section of the documentation.

Connect MetaMask

If you already have MetaMask installed, you can easily connect MetaMask to the Moonbase Alpha TestNet:

Note

MetaMask will popup asking for permission to add Moonbase Alpha as a custom network. Once you approve permissions, MetaMask will switch your current network to Moonbase Alpha.

If you do not have MetaMask installed, or would like to follow a tutorial to get started, please check out the Interacting with Moonbeam using MetaMask guide.

Get Tokens

To start building on Moonbase Alpha, you can get DEV tokens from our faucet, named Mission Control, in our Discord Channel. For specific amounts, you can always reach out directly to us via our community channels.

Discord - Mission Control

To request tokens automatically, we've created a Discord bot (named Mission Control 😎) that will automatically send a maximum of 1 DEV token every 24 hours (per Discord user) when you enter your address. You can check it out on our Discord channel.

Under the category Miscellaneous, you will find our #Moonbase-Faucet channel.

Moonbase faucet channel on Discord

To check your balance, enter the following message, replacing <enter-address-here-> with your H160 address:

!balance <enter-address-here->

To get DEV tokens, enter the following message, replacing <enter-address-here-> with your H160 address:

!faucet send <enter-address-here->

Mission Control will send you 1 DEV token and display your current account balance. Remember that Mission Control is limited to dispense once every 24 hours per Discord user.

Faucet send command example

Note

Moonbase Alpha DEV tokens have no value. Please don't spam the faucet with unnecessary requests.

Demo DApps

There are a variety of DApps deployed to Moonbase Alpha enabling you to experiment with various apps and integrations. You can also acquire a variety of test tokens through the Moonbase ERC20 Minter or Moonbeam Uniswap DApps. For example, Moonbeam Uniswap can help you acquire cross chain assets such as xcUNITs or xcKarura for testing XCM related functions. In the below table, you'll find each sample DApp, its associated URL, and GitHub repository.

DApp Description Repository
Moonbase ERC-20 Minter ERC-20 Faucet https://github.com/PureStake/moonbase-mintableERC20
Moonbeam Uniswap Uniswap V2 Fork https://github.com/PureStake/moonbeam-uniswap
MoonLink Dashboard Chainlink Demo https://github.com/PureStake/moonlink-dashboard
MoonLotto Lottery TheGraph Demo Interface, Subgraph
Moonbeam WalletConnect WalletConnect Demo https://github.com/PureStake/moonbeam-walletconnect-demo
Moonbase ChainBridge ChainBridge Demo https://github.com/PureStake/chainbridge-ui
MoonGas Gas Price Tracker https://github.com/albertov19/moonbeam-gas-station

Note

These DApps are intended for demonstration purposes only and may be incomplete or unsuitable for production deployments.

Moonbase ERC20 Minter

The Moonbase ERC-20 Minter enables you to mint a variety of ERC-20 test tokens corresponding to the 8 planets of the solar system, and Pluto. To mint tokens, first press Connect MetaMask in the upper right hand corner. Then scroll to the Mint Tokens section and the choose desired ERC-20 contract. Press Submit Tx and confirm the transaction in MetaMask. Each mint will grant you 100 tokens, and you can mint tokens for each contract once per hour.

ERC20 Minter

Moonbeam Uniswap

Moonbeam Uniswap is a fork of Uniswap-V2 deployed to Moonbase Alpha. Notably, Moonbeam Uniswap allows developers to easily make a swap to acquire cross chain assets such as xcKarura or xcUNITs for XCM testing purposes. To perform your first swap, take the following steps:

  1. Press Select a token
  2. Connect your MetaMask wallet and ensure you're on the Moonbase Alpha network
  3. Press Choose a List on the prompt
  4. Select Moon Menu
  5. Search for or select your desired asset from the list then continue with the swap

Moonbeam Swap

Note

If you see only a partial list of assets under Moon Menu, your browser may have cached an older version of Moon Menu. Clearing the cache and re-adding Moon Menu will resolve this.

The MoonLink Dashboard showcases Chainlink price feeds in action. For more information, including a full listing of all Chainlink price feeds across all Moonbeam networks and a step-by-step guide of how to fetch price feed data, head to the Oracles section of the Moonbeam Docs Site. You can also check out the repository for the MoonLink Dashboard.

MoonLink Dashboard

MoonLotto Lottery

MoonLotto is a simple lottery game on Moonbase Alpha derived from The Graph's Example Subgraph. Purchasing a ticket costs 1 DEV and a winner is chosen each half hour if there are at least 10 participants. MoonLotto.sol holds the contract logic for the lottery. To participate, take the following steps:

  1. Connect your MetaMask wallet and ensure you're on the Moonbase Alpha network
  2. Enter the address of the recipient of lotto ticket or check I want to buy a ticket for my address
  3. Press Submit on MetaMask and confirm the transaction in MetaMask

MoonLotto Lottery

Moonbeam WalletConnect

Moonbeam WalletConnect shows how easy it is to integrate WalletConnect into your DApps and unlock support for a great variety of crypto wallets. Be sure to check out the demo app repository to see exactly how the WalletConnect integration works. To get started, you can take the following steps:

  1. Press Connect Wallet
  2. Scan the QR code using a wallet compatible with WalletConnect

Moonbeam WalletConnect

Moonbase ChainBridge

Moonbase ChainBridge enables you to bridge ERC-20 tokens from Moonbase Alpha to Ethereum's Rinkeby and Kovan testnets and vice versa. Be sure to check out the step-by-step guide on using ChainBridge's Ethereum Moonbeam Bridge for more information on using ChainBridge's ERC-20, ERC-721, and Generic Handlers. You can also check out the Moonbase ChainBridge repository. To initiate a bridge transfer, connect your MetaMask wallet and ensure you're on the Moonbase Alpha network, and take the following steps:

  1. Click Mint ERC20S
  2. Specify a destination network (although the minted tokens will be the same regardless of destination)
  3. Select ERC20S from the Token dropdown
  4. Press Mint Tokens and confirm the transaction in MetaMask
  5. Return to the Transfer tab
  6. Select the destination network
  7. Select ERC20S from the Token dropdown
  8. Specify the amount to bridge
  9. Enter a destination address or check I want to send funds to my address
  10. Press Start Transfer and Confirm the transaction in MetaMask. The DApp will update you on the status of the bridge transfer

Moonbase ChainBridge

MoonGas

MoonGas is a convenient dashboard for viewing the minimum, maximum, and average gas price of transactions in the prior block across all Moonbeam networks. Note, these statistics can fluctuate widely by block and occasionally include outlier values. You can check out the repository for MoonGas.

You'll notice that the minimum gas price for Moonbeam is 100 Gwei, while the minimum for Moonriver and Moonbase Alpha is only 1 Gwei. This difference stems from the 100 to 1 re-denomination of GLMR and thus the 100 Gwei minimum on Moonbeam corresponds to a 1 Gwei minimum on Moonriver and Moonbeam.

MoonGas