Error while transaction submission in the private network

Error while transaction submission in the private network

Manage alerts

Loading saved threads...

Deb · External communityPost link
External question — Stellar Stack Exchange Author: Deb Original post: https://stellar.stackexchange.com/questions/1618 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. So I am trying to do a transaction in the private network, I have named it standalone, I am using SSL. I started the network using docker, then created a keypair, then in another terminal ran node to use javascript, below is my code: var StellarSdk = require('stellar-sdk'); var server = new StellarSdk.Server('https://localhost:8000/tx?blob=Base64'); var kp = StellarSdk.Keypair.fromRawEd25519Seed(StellarSdk.hash("Standalone Network ; February 2017")) var sourcePublicKey = kp.publicKey(); var receiverPublicKey = "GAI5VFPPZHJXE2O2MNMKAUBBUOMJOT6LUQYO2Q3NJXNAOGHXOYUVZMVW" StellarSdk.Network.useTestNetwork(); server.loadAccount(sourcePublicKey) .then(function(account) { var transaction = new StellarSdk.TransactionBuilder(account) .addOperation(StellarSdk.Operation.payment({ destination: receiverPublicKey, asset: StellarSdk.Asset.native(), amount: '350.1234567', })) .build(); transaction.sign(kp); console.log(transaction.toEnvelope().toXDR('base64')); server.submitTransaction(transaction) .then(function(transactionResult) {console.log(JSON.stringify(transactionResult, null, 2)); console.log('\nSuccess! View the transaction at: '); console.log(transactionResult._links.transaction.href);}) .catch(function(err) { console.log('An error has occured:'); console.log(err); }); }) .catch(function(e) {console.error(e); }); After running the above lines of code, I get a result: Promise { <pending>, domain: Domain { domain: null, _events: { error: [Function: debugDomainError] }, _eventsCount: 1, _maxListeners: undefined, members: [] } } Error: Error: write EPROTO 139644081280832:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:827: at _handleNetworkError (/home/ec2-user/node_modules/stellar-sdk/lib/call_builder.js:273:31) at <anonymous> P.S.: I have modified the Network.js file inside the node_modules folder and added a new passphrase for the standalone network and then modified the useTestNetwork Function to use the standalone network passphrase, not the testnetwork passphrase. Please let me know, what changes do I have to make in order to make this work.
Quote
Report
Johan Stén · External communityPost link
External answer — Stellar Stack Exchange Author: Johan Stén Original post: https://stellar.stackexchange.com/a/1619 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. Your var server = new StellarSdk.Server('https://localhost:8000/tx?blob=Base64'); is wrong, and should point at the server, not a specific endpoint.
Quote
Report

Post Reply

Quoted from Forex.com.bd-Editorial External question — Stellar Stack Exchange Author: Deb Source score (net votes, not local likes): 2 Original post: https://stellar.stackexchange.com/questions/1618 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. So I am trying to do a transaction in the private network, I have named it standalone, I am using SSL. I started the network using docker, then created a keypair, then in another terminal ran node to use javascript, below is my code: var StellarSdk = require('stellar-sdk'); var server = new StellarSdk.Server('https://localhost:8000/tx?blob=Base64'); var kp = StellarSdk.Keypair.fromRawEd25519Seed(StellarSdk.hash("Standalone Network ; February 2017")) var sourcePublicKey = kp.publicKey(); var receiverPublicKey = "GAI5VFPPZHJXE2O2MNMKAUBBUOMJOT6LUQYO2Q3NJXNAOGHXOYUVZMVW" StellarSdk.Network.useTestNetwork(); server.loadAccount(sourcePublicKey) .then(function(account) { var transaction = new StellarSdk.TransactionBuilder(account) .addOperation(StellarSdk.Operation.payment({ destination: receiverPublicKey, asset: StellarSdk.Asset.native(), amount: '350.1234567', })) .build(); transaction.sign(kp); console.log(transaction.toEnvelope().toXDR('base64')); server.submitTransaction(transaction) .then(function(transactionResult) {console.log(JSON.stringify(transactionResult, null, 2)); console.log('\nSuccess! View the transaction at: '); console.log(transactionResult._links.transaction.href);}) .catch(function(err) { console.log('An error has occured:'); console.log(err); }); }) .catch(function(e) {console.error(e); }); After running the above lines of code, I get a result: Promise { <pending>, domain: Domain { domain: null, _events: { error: [Function: debugDomainError] }, _eventsCount: 1, _maxListeners: undefined, members: [] } } Error: Error: write EPROTO 139644081280832:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:827: at _handleNetworkError (/home/ec2-user/node_modules/stellar-sdk/lib/call_builder.js:273:31) at <anonymous> P.S.: I have modified the Network.js file inside the node_modules folder and added a new passphrase for the standalone network and then modified the useTestNetwork Function to use the standalone network passphrase, not the testnetwork passphrase. Please let me know, what changes do I have to make in order to make this work.

Cancel quote

Checking account access…