Connect to the Moonbase TestNet¶
Moonbase Alpha has two endpoints available for users to connect to it: one for HTTPS and one for WSS.
To connect to Moonbase Alpha via HTTPS, simply point your provider to the following RPC DNS:
For the Web3 library, create a local Web3 instance and set the provider to connect to the Moonbeam TestNet:
const Web3 = require('web3'); //Load Web3 library . . . //Create local Web3 instance - set the Moonbeam TestNet as provider const web3 = new Web3('https://rpc.testnet.moonbeam.network');
Any Ethereum wallet should be able to generate a valid address for Moonbeam (for example, MetaMask).
For WebSocket connections, you can use the following RPC DNS: