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 | Limits |
---|---|---|
Blast |
| 80 req/sec |
Dwellir |
| 20 req/sec |
OnFinality |
| 40 req/sec |
Moonbeam Foundation |
| 25 req/sec |
UnitedBloc |
| 32 req/sec |
RadiumBlock |
| 200 req/sec |
Provider | RPC URL | Limits |
---|---|---|
Blast |
| 80 req/sec |
Dwellir |
| 20 req/sec |
OnFinality |
| 40 req/sec |
Moonbeam Foundation |
| 25 req/sec |
UnitedBloc |
| 32 req/sec |
RadiumBlock |
| 200 req/sec |
Relay Chain¶
To connect to the Moonbase Alpha relay chain, you can use the following WS Endpoint:
Provider | RPC URL |
---|---|
OpsLayer |
|
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.JsonRpcProvider(providerURL, {object})
and setting the provider URL to Moonbase Alpha:
const ethers = require('ethers'); // Load Ethers library
const providerURL = 'https://rpc.api.moonbase.moonbeam.network';
// Define provider
const provider = new ethers.JsonRpcProvider(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:
- Ethereum API (Etherscan Equivalent) — Moonscan
- Ethereum API JSON-RPC based — Moonbeam Basic Explorer
- Substrate API — Subscan or Polkadot.js Apps
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.
Configuration¶
Please note the following gas configuration parameters. These values are subject to change in future runtime upgrades.
Variable | Value |
---|---|
Minimum gas price | 0.03125 Gwei |
Target block time | 6 seconds |
Block gas limit | 60,000,000 |
Transaction gas limit | 52,000,000 |
Get Tokens¶
To start building on Moonbase Alpha, you can get DEV tokens from the Moonbase Alpha Faucet. For specific amounts, you can always reach out directly to us via our community channels.
To request DEV tokens from the faucet, you can enter your address on the Moonbase Alpha Faucet website. The faucet dispenses 1.1 DEV tokens every 24 hours.
Note
Moonbase Alpha DEV tokens have no value. Please don't spam the faucet with unnecessary requests.
You can also use the ChainDrop Faucet to request DEV tokens, which dispenses 0.1 DEV tokens per request.
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 xcUNIT or xcKarura for testing XCM related functions. In the below table, you'll find each sample DApp, its associated URL, and GitHub repository.
Quick Links¶
DApp | Description | Repository |
---|---|---|
Moonbase ERC-20 Minter | ERC-20 Faucet | https://github.com/papermoonio/moonbase-mintableERC20 |
Moonbeam Uniswap | Uniswap V2 Fork | https://github.com/papermoonio/moonbeam-uniswap |
MoonLink Dashboard | Chainlink Demo | https://github.com/papermoonio/moonlink-dashboard |
MoonLotto Lottery | TheGraph Demo | Interface, Subgraph |
Moonbeam WalletConnect | WalletConnect Demo | https://github.com/papermoonio/moonbeam-walletconnect-demo |
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.
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 xcUNIT for XCM testing purposes. To perform your first swap, take the following steps:
- Press Select a token
- Connect your MetaMask wallet and ensure you're on the Moonbase Alpha network
- Press Choose a List on the prompt
- Select Moon Menu
- Search for or select your desired asset from the list then continue with the 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.
MoonLink Dashboard¶
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.
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:
- Connect your MetaMask wallet and ensure you're on the Moonbase Alpha network
- Enter the address of the recipient of lotto ticket or check I want to buy a ticket for my address
- Press Submit on MetaMask and confirm the transaction in MetaMask
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:
- Press Connect Wallet
- Scan the QR code using a wallet compatible with WalletConnect
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.
| Created: September 16, 2020