For testing purposes, how do you fund an account with the minimum required balance on the testnet?
3 Answers
The friendbot takes care of funding accounts on the testnet
. All you have to do is to send him your public key address.
You can do it manually via curl
curl "https://horizon-testnet.stellar.org/friendbot?addr=<your-public-key>"
or just look at one of the code examples in the official doc
-
It does not work though. It currently gives an
op_underfunded
error code. Oct 15, 2018 at 10:26
Even though you can generate keypairs(The seed and the public key) for an account...it will have 0 lumens to start with.
For funding purposes, you can use the friendbot. It will add 10000 Test lumens which can be used for testing purposes on the test network.
there are many ways to do it
here you can fund account directly with 10000 test xlm
copy and replace your public key and hit the url in browser 10000 xlm will be issued to your public key
- do this programmitically pair.publickey is the public key of account to be funded.
var request = require('request'); request.get({ url: 'https://horizon-testnet.stellar.org/friendbot', qs: { addr: pair.publicKey() }, json: true }, function (error, response, body) { if (error || response.statusCode !== 200) { console.error('ERROR!', error || body); } else { console.log('SUCCESS! You have a new account :)\n', body); } });