ı create public key with stellar sdk with node js;

StellarSdk.Networks.TESTNET; const server = new StellarSdk.Server('',{allowHttp:true}); //const server = new StellarSdk.Server('https://horizon-testnet.stellar.org');

var pair=StellarSdk.Keypair.random();

console.log("Public:"+pair.publicKey()+"\n"); console.log("Private:"+pair.secret()+"\n"); console.log("Encode:"+encodeURIComponent(pair.publicKey())+"\n") CreateAccountFunc(pair.publicKey());

async function CreateAccountFunc(pubkey) { try { const response = await fetch( https://friendbot.stellar.org?addr=${encodeURIComponent(pubkey)} ); const responseJSON = await response.json(); console.log("SUCCESS! yeni hesap oluştu \n", responseJSON); const account=await server.loadAccount(pubkey); console.log("aaaaa "+JSON.stringify(account));

But when ı send request:

My response:

{ "type": "https://stellar.org/horizon-errors/not_found", "title": "Resource Missing", "status": 404, "detail": "The resource at the url requested was not found. This usually occurs for one of two reasons: The url requested is not valid, or no data in our database could be found with the parameters provided." }

what can I do help me please.

Your Answer

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

Browse other questions tagged or ask your own question.