Skip to content

Connect to Moonbase Alpha

Introduction

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

The Moonbase Alpha RPC and WSS endpoints hosted by PureStake are for development purposes only and are not meant to be used in production applications. The following are alternative endpoint providers:

HTTPS DNS

To connect to Moonbase Alpha via HTTPS, simply point your provider to the following RPC DNS:

https://rpc.testnet.moonbeam.network
https://moonbeam-alpha.api.onfinality.io/public

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.testnet.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.testnet.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).

WSS DNS

For WebSocket connections, you can use the following DNS:

wss://wss.testnet.moonbeam.network
wss://moonbeam-alpha.api.onfinality.io/public-ws
wss://moonbase.moonbeam.elara.patract.io

Chain ID

For the Moonbase Alpha TestNet the chain ID is: 1287.

Relay Chain

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

wss://wss-relay.testnet.moonbeam.network

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, 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, 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 5 DEV tokens 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 AlphaNet bot channel.

Discord1

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 5 DEV tokens and display your current account balance. Remember that Mission Control is limited to dispense once every 24 hours per Discord user.

Discord2

Manual Procedure

For token requests of more than the limited account allowed by our Discord bot, contact a moderator directly via our Discord channel. We are happy to provide the tokens needed to test your applications.