-
Notifications
You must be signed in to change notification settings - Fork 113
How to obtain tokens from the faucet
The faucet is a dApp built on top of the value- and communication layer. It sends IOTA tokens to addresses by listening to faucet request messages. A faucet message is a Message containing an address encoded in Base58, and it is retrievable via FindMessageByID()
.
After sending a faucet request message, you can check your balances via GetUnspentOutputs()
.
There are 3 ways to send a faucet request message to obtain IOTA tokens:
- Via the Go client library
- Via the HTTP API directly
- Requesting tokens via the GoShimmer web dashboard
- Via the pollen-wallet
Follow the instructions in Use the API to set up the API instance.
Example:
// provide your Base58 encoded destination address
messageID, err := goshimAPI.SendFaucetRequest("JaMauTaTSVBNc13edCCvBK9fZxZ1KKW5fXegT1B7N9jY")
---- or
// get the given address from your wallet instance and
// use String() to get its Base58 representation
addr := wallet.Seed().Address(0)
messageID, err := goshimAPI.SendFaucetRequest(addr.String())
The URI for POSTing faucet request messages is http://<host>:<web-api-port>/faucet
Parameter | Required | Description | Type |
---|---|---|---|
address |
Yes | Destination address to which to send tokens to encoded in Base58 | string |
cURL example:
curl http://localhost:8080 \
-X POST \
-H 'Content-Type: application/json' \
-d '{
"address": "JaMauTaTSVBNc13edCCvBK9fZxZ1KKW5fXegT1B7N9jY"
}'
You can send the faucet request message via the faucet tab on the dashboard by filling in a Base58 encoded address to receive tokens.
You can then use the link provided below to check the funds on your supplied address.
Follow the instructions in pollen-wallet to build and execute the wallet.
You can request funds by pressing the Request Funds
in the wallet.
Note: You need to create a wallet first before requesting funds.
This may take a while to receive funds:
When the faucet request is successful, you can check the received balances: