10

For testing purposes, how do you fund an account with the minimum required balance on the testnet?

11

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. – Boris D. Teoharov Oct 15 '18 at 10:26
5

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.

Stellar Friendbot Link

3

there are many ways to do it

  1. here you can fund account directly with 10000 test xlm

  2. https://horizon-testnet.stellar.org/friendbot?addr=GAL4LACKK5PJ54XCJ2BR3RI6WKCTMDBFIC6LX4TB7PE2NLHE7Z6FW6Z6

copy and replace your public key and hit the url in browser 10000 xlm will be issued to your public key

  1. 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);
  }
});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.