Connecting to the Testnet | Introduction to JavaScript
A testnet evnironment is provided in XRPL.
The testnet allows developers to develop products having the mainnet in mind. The main reason for using a testnet is that the mainnet requires the developer to bear a certain amount of XRP
as fees and account reserves.
The following is one of the commonly used testnet environment.
wss://s.altnet.rippletest.net:51233
There are several other testnet environments that do exist, please refer to here.
Create Script
-
Create a new file named
connect.js
in your project directory -
Paste the following code into
connect.js
.The script simply connects to XRP Ledger’s Testnet, displays to the console that the connection was successful, and then closes the connection.
Run Script
-
Run script by executing the following command in the command line.
-
If successful, you will see the following in the console.