de_henne_ has joined #stellar-dev
de_henne has quit [Ping timeout: 264 seconds]
de_henne_ has quit [Remote host closed the connection]
de_henne has joined #stellar-dev
TheSeven has quit [Disconnected by services]
[7] has joined #stellar-dev
<stellar-slack> <jed> lab: what does your history scanning tool do?
nivah has joined #stellar-dev
pixelbeat has quit [Ping timeout: 256 seconds]
pixelbeat has joined #stellar-dev
<stellar-slack> <lab> jed, it generates a sequence of 0x40*n -1 and check whether the files are in history/transactions/results/ folders
<stellar-slack> <lab> notice, it doesn't check the contents nor buckets folder.
<stellar-slack> <sacarlson> ok I suck at java script so sue me ha ha
<stellar-slack> <sacarlson> at least I have basic control of the multi-sign-websocket from the browser now. as before I used ruby websocket clients. I guess I'll need to learn a bit more about using the js. libs and also port some of my basic message signing and verify tools into js
<stellar-slack> <buhrmi> i think sucking at javascript is not breaking any laws
<stellar-slack> <sacarlson> I was just hoping someone else would figure it out long before me
<stellar-slack> <raymens> How do you, as Stellar, manage/upgrade/run your core and horizon services?
koshii has quit [Ping timeout: 265 seconds]
koshii has joined #stellar-dev
<stellar-slack> <sacarlson> ok not that it maters but what is the difference in features bettween stellar-sdk.js and stellar-sdk.min.js besides being about 1/3 the size?
<stellar-slack> <sacarlson> I guess at full version only 1.7mb it's small enuf already
<stellar-slack> <dzham> @sacarlson: they’re the same thing. .min.js is just whitespace optimized/obfuscated
<stellar-slack> <sacarlson> so you use the min.js then?
<stellar-slack> <dzham> yeah
<stellar-slack> <dzham> only use the other one for reading
<stellar-slack> <sacarlson> as I just started to read the docs I'm seeing things I didn't know existed. looks cool
<stellar-slack> <sacarlson> oh ic
<stellar-slack> <sacarlson> of my first error after I installed stellar-sdk I put the native_payment.js example in the dir that has the dir js-stellar-sdk when I run node native_payment.js the Error: Cannot find module 'js-stellar-sdk'
<stellar-slack> <sacarlson> I must be running from the wrong base dir
<stellar-slack> <sacarlson> I assumed it was the file in the dist
<stellar-slack> <sacarlson> but I also tried making a symbolic link to that in the dir I was running from
<stellar-slack> <dzham> just run `npm install stellar-sdk`
<stellar-slack> <sacarlson> already did that
<stellar-slack> <sacarlson> it creates the dir with the modules
<stellar-slack> <dzham> you’re doing `require ‘stellar-sdk’`in your .js file?
<stellar-slack> <sacarlson> I think so
<stellar-slack> <sacarlson> I just copied the sample that I thought was already setup with that
<stellar-slack> <dzham> oh, wait.. where did you put native_payment.js? in node_modules?
<stellar-slack> <sacarlson> var StellarSdk = require('js-stellar-sdk')
<stellar-slack> <sacarlson> so that's not name correctly in the example?
<stellar-slack> <dzham> the folder you have native_payments.js in should have a node_modules folder
<stellar-slack> <dzham> Ah! no, it’s called stellar-sdk only
<stellar-slack> <sacarlson> oh so none of the example work out of the box then
<stellar-slack> <sacarlson> ok that fix the missing file part
<stellar-slack> <sacarlson> { type: 'https://stellar.org/horizon-errors/not_found', title: 'Resource Missing', status: 404,
<stellar-slack> <sacarlson> this might be what you get when the account is bad?
<stellar-slack> <sacarlson> if this is the source account in this file server.loadAccount("GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ") were does it get the seed for this account?
<stellar-slack> <sacarlson> best I find a create account example in js maybe that might work
<stellar-slack> <sacarlson> (function (exports, require, module, __filename, __dirname) { let StellarLib = ^^^^^^^^^^ SyntaxError: Unexpected identifier
<stellar-slack> <sacarlson> I'm not sure there are any working example in here
<stellar-slack> <sacarlson> I'm not sure there are any working examples. this one has at least 2 errors I can see and I can't even read js
<stellar-slack> <sacarlson> ReferenceError: server is not defined
<stellar-slack> <dzham> loadAccount uses the address to check with Horizon what the sequence number is, that’s all… no seed needed (yet)
<stellar-slack> <sacarlson> it helps when I start from at least one working example, from there I can move on
<stellar-slack> <sacarlson> well that was a payment transaction so at some point it will need a seed
<stellar-slack> <dzham> ``` /* global require, console, Buffer */ (function () { 'use strict'; var stellar = require('stellar-sdk'); var server = new stellar.Server({ hostname: 'http://horizon-testnet.stellar.org|horizon-testnet.stellar.org', port: 443, secure: true }); stellar.Network.useTestNet(); var seed = 'SBADPREUF6NNS3LXLLSRN6YJZT3VQRKFQLWUAA2YKPCCA4FJSWZRLWJW'; var key = stellar.Keypair.fromSeed(seed); funct
<stellar-slack> server.loadAccount(key.address()) .then(function (account) { var transaction = new stellar.TransactionBuilder(account) .addOperation(stellar.Operation.setOptions({ signer: { address: 'GDXWWC643RSHGPUEGTIGYBLUMWON3WZXXURDEWJC7DSGKK74ME3YQSAZ', weight: 1 } })) .addOperation(stellar.Operation.setOptions({ signer: { address: 'GBSJBNTNW57LDIRCUE7A6KFNFQ437PVOBBUCANVDYHWONWOTIAR3TRK
<stellar-slack> .addOperation(stellar.Operation.setOptions({ signer: { address: 'GBZJW4L54EOKYPRA5M2APJJKBY2GRMJQCCXWFEI4QMQBQIH7AB53ZMXW', weight: 1 } })) .addOperation(stellar.Operation.setOptions({ masterWeight: 0, lowThreshold: 2, medThreshold: 2, highThreshold: 2 })) .addSigner(key) .build(); return server.submitTransaction(transaction); }) .then(console.log) .catch(c
<stellar-slack> createContractAccount(key); })(); ```
<stellar-slack> <dzham> @sacarlson: ^^that should work, that’s what I use to set up my multi-sig contract accounts...
<stellar-slack> <sacarlson> well that looks like it might work but I prefer starting from simple. but I'll add that to my example files I'm collecting
<stellar-slack> <dzham> just change the operation to a payment, and you’re set
<stellar-slack> <sacarlson> well for the most basic example I guess I'll makes two accounts and and send native from one to the other. for others to get the idea
<stellar-slack> <sacarlson> then I'm going to replace this line return server.submitTransaction(transaction); to send it to mss-server instead as another simple example
<stellar-slack> <dzham> ``` var tx = new stellar.TransactionBuilder(account) .addOperation(stellar.Operation.payment({ destination: msg.destination, amount: msg.amount, asset: stellar.Asset.native() })) .addSigner(signer) .build(); ```
<stellar-slack> <dzham> ^^^ for a payment
<stellar-slack> <sacarlson> that can't be complete
<stellar-slack> <dzham> it’s not.. but replace the transaction in the first example with this
<stellar-slack> <raymens> Shouldn't the mention at https://github.com/stellar/docker-stellar-core#single-node-configurations me removed now?
<stellar-slack> <sacarlson> we aren't far now with your added transaction [ReferenceError: msg is not defined]
<stellar-slack> <dzham> oh, yeah, you’d have to change amount and destination
<stellar-slack> <sacarlson> yes I can see that
<stellar-slack> <sacarlson> for this it will just be hard coded to test
pixelbeat has quit [Ping timeout: 244 seconds]
<stellar-slack> <sacarlson> boy I'm going to stick with ruby ha ha. with error they don't give line numbers
<stellar-slack> <sacarlson> undefined
<stellar-slack> <sacarlson> what might be undefined now?
pixelbeat has joined #stellar-dev
nivah has quit [Ping timeout: 260 seconds]
koshii has quit [Ping timeout: 272 seconds]
koshii has joined #stellar-dev
de_henne_ has joined #stellar-dev
de_henne has quit [*.net *.split]
pixelbeat has quit [Ping timeout: 250 seconds]
pixelbeat has joined #stellar-dev
pixelbeat has quit [Ping timeout: 244 seconds]
pixelbeat has joined #stellar-dev
stellar-slack has quit [Remote host closed the connection]
stellar-slack has joined #stellar-dev
<stellar-slack> <scott> FYI: if anyone is building horizon themselves, we’re about to remove go 1.4 support (https://github.com/stellar/horizon/pull/160) so that we can surface database connection metrics.
DomKM has joined #stellar-dev
<stellar-slack> <scott> Is anyone here GAB2KFKTAQWHWZAUHC6AEGX5MPVIOLMGZT4BLB6O7LCA43VBYPOJIYTQ? Could you please stop spamming horizon-testnet, if so? I’d prefer to leave rate limiting off for the time being but won’t really have a choice if it doesn’t stop
[7] has quit [Ping timeout: 240 seconds]
TheSeven has joined #stellar-dev
<stellar-slack> <sacarlson> darn and I missed the activity, seems my stellar-core wasn't running at the time
<stellar-slack> <sacarlson> my last window of running only showed 27 transactions
<stellar-slack> <sacarlson> but I do see there are over 400k accounts on the ledger
<stellar-slack> <scott> oh, this person isn’t spamming the core network, they’re just loading https://horizon-testnet.stellar.org/accounts/GAB2KFKTAQWHWZAUHC6AEGX5MPVIOLMGZT4BLB6O7LCA43VBYPOJIYTQ over and over again
<stellar-slack> <scott> It’s not really hurting anything.. it’s just making the logs annoying to watch
<stellar-slack> <sacarlson> and thanks @bartek you read my mind as I couldn't figure out how to change base fee in the js-stellar-sdk I see you now have that fixed so I don't need this line var transaction = new stellar.TransactionBuilder(account,{fee:100})
<stellar-slack> <sacarlson> how would I translate this line to what's used in js-stellar-sdk from ruby b64 = tx.to_envelope(funder).to_xdr(:base64), I want the base64 string
<stellar-slack> <sacarlson> when I view it with this console.log(transaction) it's broken into what's seen in the structure
<stellar-slack> <sacarlson> never mind I found it: console.log(transaction.toEnvelope().toXDR().toString("base64"))