Getting XRP for Development Use | Introduction to JavaScript
Testnet allows you to obtain XRP, the native token, for development purposes.
There are two main methods.
Obtain by specifying an address
The following site allows you to acquire XRP by specifying an address.
If you want to send to the account address you created earlier by code, you can use the tool at bithomb.com.
If you want to get XRP while creating an address, go on and create an account below.
If you want to get it by code
While it is better to use a tool for efficiency and convenience, you can also get XRP using code.
Installing node-fetch
The fetch API is built into the browser, but in a Node.js environment, you need to install the node-fetch module.
Create Script
Run script
-
Run script by executing the following command on the command line.
-
If successful, you will see the following in the console.