-
Notifications
You must be signed in to change notification settings - Fork 113
How to obtain tokens from the faucet
Ching-Hua (Vivian) Lin edited this page Jun 24, 2020
·
5 revisions
The faucet is a dApp built on top of valuetransfers
and messagelayer
. It sends IOTA tokens to addresses by listening to faucet messages. A faucet message is a Message containing an address encoded with Base58, and it is retrievable via FindMessageByID
.
After sending faucet messages, you can check your balances with API Retrieve UTXOs/balances.
There are 3 ways to request IOTA tokens by sending faucet messages:
- HTTP API
- client library
- dashboard
The URI format for sending faucet message is tcp://IPADDRESS:PORT/faucet
Parameters | address |
---|---|
Required or OptionalRequired | Required |
Description | Address for which to request tokens, encoded with Base58 |
Type | string |
cURL example:
curl http://localhost:8080 \
-X POST \
-H 'Content-Type: application/json' \
-d '{
"address": "JaMauTaTSVBNc13edCCvBK9fZxZ1KKW5fXegT1B7N9jY"
}'
Follow the instructions in Use the API to set up the API instance.
Example:
// send with the Base58 encoded address string
messageID, err := goshimAPI.SendFaucetRequest("JaMauTaTSVBNc13edCCvBK9fZxZ1KKW5fXegT1B7N9jY")
// send with the address, and encode it with String()
addr := wallet.Seed().Address(0)
messageID, err := goshimAPI.SendFaucetRequest(addr.String())
You can send the faucet message via the faucet tab on dashboard by filling in an address to receive tokens. Then you should be able to check your funds with the link below!