de_henne has quit [Ping timeout: 264 seconds]
de_henne has joined #stellar-dev
koolhead17 has joined #stellar-dev
koolhead17 has quit [Changing host]
koolhead17 has joined #stellar-dev
sv-logger has quit [Remote host closed the connection]
sv-logger has joined #stellar-dev
pixelbeat_ has quit [Ping timeout: 248 seconds]
[7] has quit [Ping timeout: 240 seconds]
TheSeven has joined #stellar-dev
Vinnie_win has quit []
koolhead17 has quit [Remote host closed the connection]
de_henne has quit [Remote host closed the connection]
de_henne has joined #stellar-dev
sacarlson1 has joined #stellar-dev
sacarlson has quit [Ping timeout: 246 seconds]
pixelbeat_ has joined #stellar-dev
koolhead17 has joined #stellar-dev
koolhead17 has quit [Remote host closed the connection]
<stellar-slack> <naumenkogs> Can someone tell me how to form the hex hash of a single transaction to use submit transaction method of ruby-horizon?
<stellar-slack> <naumenkogs> I've found a link http://stellar.github.io/go-horizon/endpoint/transactions_create/ but there is nothing there
<stellar-slack> <naumenkogs> Neither for ruby-horizon here http://docs.stellarhorizon.apiary.io. I just wanna know if it is possible to perform transactions in the current version of stellar-core
<sacarlson1> naumenkogs I started reading the same docs trying to find the method to do a simple send currency from one address to another and failed to find any
<sacarlson1> I asummed I was looking in the wrong place
sacarlson1 has quit [Quit: Leaving.]
sacarlson has joined #stellar-dev
<stellar-slack> <naumenkogs> @sacarlson1 have you found proper links?
<sacarlson> naumenkogs I was mostly interested in this link http://docs.stellarhorizon.apiary.io/#reference/default/account/all-accounts or refs under them that also included ruby calls
<sacarlson> my app uses ruby but I fail to find the transactions I"m looking for
<sacarlson> naumenkogs I also looked at some of the source in github and found what I needed didn't work in rub
<sacarlson> ruby
<stellar-slack> <naumenkogs> So this request for all accounts works for you? It doesnt work for me but if I manually find my root-account in postgres and use /accounts/accountid I can see the transactions
<sacarlson> well the function that are shown might work but they are not the transactions I'm looking for. but I assume the rest of the transactions are in a similar format for the API
<stellar-slack> <naumenkogs> You are lucky to have /accounts?limit&order work, because it crashes for me
<sacarlson> i have high hope when I find them that I will be able to plug and play my present ruby libs and app that inteface to present live.stellar.org
<sacarlson> well for example I guess this work : curl --include \ 'https://horizon-testnet.stellar.org/ledgers/4'
<sacarlson> I'm not sure what all works and doesn't
<sacarlson> they also have ruby for this
<sacarlson> maybe have to skip the docs that I think are not finshied and look at the code if we knew where to look
<sacarlson> like me I write the docs last after I have some working code
<stellar-slack> <naumenkogs> I dunno. The fact is I'm going to launch my own isolated stellar-core network and I can't get why I cannot provide transactions.
<stellar-slack> <naumenkogs> It could be not yet performed functions for example, dunno.
<sacarlson> the old network is very well documented and was easy to write my code within 2 days. the new horizon I have failed so far
<sacarlson> naumenkogs but I watching your comments you are getting from them that are getting me closer
<sacarlson> I need at least one of the new features of the new stellar-core to satisfy the results I want that include escrow multi-sign in my transactions
<sacarlson> but I need to start from the bottom first to just send stellar native from A account to B account
nelisky has joined #stellar-dev
nelisky has quit [Quit: nelisky]
nelisky has joined #stellar-dev
nelisky has quit [Quit: nelisky]
<stellar-slack> <scott> @naumenkogs: I think perhaps you’ve missed one of the fundamentals for the new stellar network. You don't interact with horizon to create transactions. You create transactions locally with a client (or a client library), sign them with a private key saved locally, and then you submit a transaction envelope that contained both the transaction you want to apply to the ledger and the signatures you created.
<stellar-slack> system and ripple where the API would allow you to submit your secret seed over the network and have the server do the work for you. That model is flawed, security-wise, compared to requiring people to generate transactions and sign them themselves.
<stellar-slack> <scott> Here’s an example of making a payment to a locally running stellar-core with ruby: https://github.com/stellar/ruby-stellar-base/blob/master/examples/mid_level_transaction_post.rb
<stellar-slack> <scott> let me explain a bit about what goes on behind the scenes:
<stellar-slack> <scott> The first thing to understand is XDR’s role in the ecosystem.
<stellar-slack> <scott> Here’s some simple docs: http://stellar.github.io/go-horizon/guide/xdr/
<stellar-slack> <scott> the actual RFC is very short and readable: http://tools.ietf.org/html/rfc4506.html
<stellar-slack> <scott> Okay, so that’s some reading information for later, but lets talk about it some now. XDR is an encoding format for data structures, and we use XDR to encode transactions and related structures for communication between computers
<stellar-slack> <scott> XDR structures are described using a schema, similar to something like protocol buffers or thrift if you are familiar with those technologies. For stellar-core, those schemas can be found here: https://github.com/stellar/stellar-core/tree/master/src/xdr
<stellar-slack> <scott> For example, you can see the definition of the transaction struct here: https://github.com/stellar/stellar-core/blob/master/src/xdr/Stellar-transaction.x#L276
<stellar-slack> <scott> The following snippet creates an in-memory representation of that XDR struct: https://github.com/stellar/ruby-stellar-base/blob/master/examples/mid_level_transaction_post.rb#L23-L28
<stellar-slack> <scott> that’s the first step towards getting the hex that gets submitted to the stellar core you asked about.
<stellar-slack> <scott> So, we’ve got a transaction that is filled out, the next step is to create a signature for that transaction and wrap it in an envelope (which the ruby library performs in one step): `tx.to_envelope(master)`
<stellar-slack> <scott> That method call will return an in-memory form of an XDR `TransactionEnvelope` (defined at https://github.com/stellar/stellar-core/blob/master/src/xdr/Stellar-transaction.x#L304) with the tx and a newly created signature attached.
<stellar-slack> <scott> We’re almost there! We next need to first encode the in-memory representation of the envelope into xdr, which is just a stream of bytes. Then, we encode that byte stream into hex, because transporting a raw byte stream through things like HTTP or JSON is problematic… you often encode the byte stream into something like base64 to allow it ensure the data does not interfere with the protocol it is being co
<stellar-slack> <scott> Hex was chosen for heritage’s sake I believe. Ripple encodes their transaction byte streams to hex for transmittion to the server.
<stellar-slack> <scott> In the ruby code, you can see where the conversion from in-memory to hex occurs, and the transmission of the hex to the server here: https://github.com/stellar/ruby-stellar-base/blob/master/examples/mid_level_transaction_post.rb#L30-L32
<stellar-slack> <scott> `$server.get('tx', blob: hex)` translated to curl would look like: ``` curl http://localhost:39132/tx?blob=AABBCC11 ```
<stellar-slack> <scott> @naumenkogs: does all of that makes sense? I’m happy to dig into areas where you are unclear
<stellar-slack> <naumenkogs> @scott I'll try the things you've explained. One more problem is timezones: it is 18:43 now so I gonna have rest.
<stellar-slack> <scott> totally understand. Feel free when you work on things next to @ message me with your questions.
koolhead17 has joined #stellar-dev
moo-_- has quit [*.net *.split]
moo-_- has joined #stellar-dev
pixelbeat_ has quit [Ping timeout: 240 seconds]
<stellar-slack> <naumenkogs> @scott: For this moment as I understand, for example, https://localhost:3000/ledgers?limit=1&order=asc must work via ruby-horizon? It seems like I got nothing to this request so there is no reason to go on before I fix this one
<stellar-slack> <naumenkogs> Sure I should remove https://
<stellar-slack> <scott> @naumenkogs: The ledger endpoints were never implemented in the ruby version of horizon. You should only be using the ruby horizon version for posting transactions and friendbot. You can see the full set of routes for horizon here: https://github.com/stellar/horizon/blob/master/config/routes.rb
<stellar-slack> <scott> And you can read about that format in routes.rb here: http://guides.rubyonrails.org/routing.html
<stellar-slack> <naumenkogs> Can U explain me the usage of friendbot?
<stellar-slack> <naumenkogs> Btw /friendbot/root_id doesnt work for me too
koolhead17 has quit [Remote host closed the connection]
<stellar-slack> <scott> it’s a coin faucet, to aid in testing. You can make a request to it to get some lumens sent to any address you want. Like https://en.wikipedia.org/wiki/Bitcoin_faucet
<stellar-slack> <scott> /friendbot/root_id is not a valid path. out of curiosity (in an effort to improve our documentation) where did you get it from?
<stellar-slack> <scott> an appropriate path would be, for example: `/friendbot?addr=gs4HpefTt9MNKs7G4SXUTbvuLDkwxx1BnjePnvHMB2wcDVJmpDD`
<stellar-slack> <naumenkogs> I used a thing u posted, yeah. At it doesnt work
<stellar-slack> <naumenkogs> My prev post has a mistake
<stellar-slack> <naumenkogs> Maybe this is because i tried it on root-account?
<stellar-slack> <scott> yeah, the friendbot only creates account
<stellar-slack> <scott> i.e. it can only fund them once
<stellar-slack> <naumenkogs> How can friendbot create an account? I send account addr as an attribute
<stellar-slack> <naumenkogs> Means that account is already created
<stellar-slack> <scott> Not according to stellar-core… an account only exists if it is in the ledger
<stellar-slack> <scott> The `CreateAccount` operation can be performed by any existing account in the system. You specify what address you want to create in the ledger and the initial balance that account will have.
<stellar-slack> <scott> The initial balance is taken from the source account of the transaction
<stellar-slack> <scott> This is similar to most other cryptocurrencies I am familiar with. You create an “account" at a certain address by making a payment to that address from an existing account. The details vary of course, but logically that is how it works.
<stellar-slack> <scott> The differentiation here is between “account” and “address” there are 2^256 possible addresses based upon the cryptographic scheme we use, but only a relatively small number of accounts exist in the ledger at any given moment
<stellar-slack> <naumenkogs> I mean where I can get the parameter addr to post it to friendbot?
<stellar-slack> <scott> There are many ways. Let me first explain how to do it with the `stellar-core` binary
<stellar-slack> <scott> running `stellar-core —genseed` (provided you have stellar-core on your PATH) will output something like:
<stellar-slack> <scott> ``` Secret seed: sfMYLKEuGwBnRhgPmqZe1BKg3HyfwgQNbmGyxtfU2EJF4ZEgxe2 Public: gsg4NvpmewgE5RKScrpRNGMWdeZgtDujEDLoWQD88xM5HgZ362u ```
<stellar-slack> <scott> The “public” portion is an address, and the seed is the corresponding secret associated with that address
<stellar-slack> <scott> You would use that seed to sign a transaction, for example
<stellar-slack> <scott> The client libraries, have helper functions:
<stellar-slack> <naumenkogs> And i I can use public as addr=public for friendbot?
<stellar-slack> <scott> yes
<stellar-slack> <scott> here’s an example of how you would create a keypair in ruby:
<stellar-slack> <scott> ```ruby require 'stellar-base' # create a new, random keypair kp = Stellar::KeyPair.random # returns the secret seed kp.seed # returns the address kp.address ```
koolhead17 has joined #stellar-dev
koolhead17 has quit [Remote host closed the connection]
koolhead17 has joined #stellar-dev
koolhead17 has quit [Remote host closed the connection]
<stellar-slack> <naumenkogs> @scott
<stellar-slack> <naumenkogs> @scott: can you foresee the date of release go-horizon so it could be able to work without ruby?
<stellar-slack> <naumenkogs> It is important for me to start develop something based on stellar-core
<stellar-slack> <scott> I imagine that it will probably be about 4-6 weeks until the ruby version of horizon is completely dead.
<stellar-slack> <scott> Are you familiar with vagrant?
<stellar-slack> <scott> I think we could find the time to work up a vagrantfile that builds and starts stellar-core, horizon, go-horizon all in private network.
<stellar-slack> <naumenkogs> First time hearing vargant
<stellar-slack> <scott> https://www.vagrantup.com/
<stellar-slack> <scott> Basically, It’s a tool to make it easier to spinup a development virtual machine
<stellar-slack> <scott> We could write a recipe that it would use to build a virtual machine that has all of the software running
<stellar-slack> <naumenkogs> You can develop a solution so I can run the whole stellar-core stack via 2 commands?
<stellar-slack> <scott> yes, with some exceptions. You would need to configure your own computer to communicate with the vm, and the process of developing the software (i.e. changing the source code of stellar-core, horizon, or go-horizon) would be more complicated because the VM is isolated from your machine
<stellar-slack> <naumenkogs> Would it be able to connect it to the second VM on the another machine?
<stellar-slack> <scott> you would need to perform custom configuration to do that
<stellar-slack> <naumenkogs> That activity scaries me a bit
<stellar-slack> <scott> out of curiosity, can you share anything about the project you are working on that makes you require running your own network?
<stellar-slack> <scott> If you simple want to build a client application that interacts with the stellar network, I wouldn’t recommend running your own instance of stellar-core, horizon, etc.
<stellar-slack> <naumenkogs> I'm new to the cryptoresearching team, I'm not clear about the goals but they asked me to test new stellar-core and rippled so the new project will be based on it.
<stellar-slack> <scott> ah, I see, cool.
<stellar-slack> <naumenkogs> But the isolated own network is strongly needed
<stellar-slack> <scott> So, If you are interested, the area of vagrant you would want to learn about (to do a multi-machine network) is at http://docs.vagrantup.com/v2/multi-machine/index.html
<stellar-slack> <scott> I highly recommend adding vagrant to your personal toolbelt… it is a fantastic tool
<stellar-slack> <naumenkogs> As I said earlier, I need to launch it on 2 different PCs.
<stellar-slack> <naumenkogs> So my tests would be real tests
<stellar-slack> <naumenkogs> Vargant multi-machine stuff seems to be working on one PC
<stellar-slack> <scott> yes, it is. you would need to setup port forwarding or a bridged network for vagrant VM to communicate away from the host PC. There are details at http://docs.vagrantup.com/v2/getting-started/networking.html
<stellar-slack> <scott> http://docs.vagrantup.com/v2/networking/forwarded_ports.html is actually better, sorry
<stellar-slack> <naumenkogs> Firstly you say you can develop a solution for vargant, later you say I can explore it myself. I dont think it is better for me than manual launching on my own 2 PCs without vargant.
<stellar-slack> <naumenkogs> I mean if I cannot launch it manually how can I do it on VM
<stellar-slack> <scott> sorry, I think you’re misunderstanding me. I believe that I could help setup a vagrantfile that creates a standalone network that doesn’t interact with the outside world, but has the software built and running. It would be your responsibility to modify that file to support your specific networking needs.
<stellar-slack> <naumenkogs> But. If I gonna wait for standalone go-horizon without ruby I need to wait at least for 5 weeks right?
<stellar-slack> <scott> yes
<stellar-slack> <scott> apart from getting outside contributors to help, I’m the only one working on either horizon or go-horizons code, and I’m behind schedule
<stellar-slack> <scott> so I don’t see it happening faster than that
<stellar-slack> <naumenkogs> Sorry for wasting your time then:relieved:
<stellar-slack> <scott> no worries! definitely don’t need to apologize! I’m just trying to be completely honest with you :)
<stellar-slack> <scott> the thing is, if you’re having trouble with it, then others are as well. You’ve helped a lot by informing documentation changes I want to make
<stellar-slack> <naumenkogs> One more question.
<stellar-slack> <naumenkogs> Are you sure that if I launch properly stellar-core, ruby and go horizons in current state I'll get a possibility to test transactions via it? On the isolated network
<stellar-slack> <naumenkogs> I need to report a current state of the whole system and I get too much troubles for now
<stellar-slack> <naumenkogs> And sometimes I'm even not sure if some functions are developed yet
<stellar-slack> <scott> totally understand:
<stellar-slack> <scott> So, there is definitely the possibility of submitting test transactions. We have a pretty extensive suite of tests that operate isolated networks. But, we are not bug free, and I would expect errors when running a multi-node network
<stellar-slack> <scott> I believe the core devs are still working on a couple of issues with the implementation of the consensus protocol. @monsieurnicolas would know more
<stellar-slack> <monsieurnicolas> I am not aware of issues with consensus at this point, wider deployments will tell us more
<stellar-slack> <scott> good to know, thanks
<stellar-slack> <naumenkogs> Would work without ruby-horizon be very different from current things?
<stellar-slack> <naumenkogs> I need to know if there is any reason to start developing something on current version
<stellar-slack> <naumenkogs> Or it will be totally another on standalone go-horizon
<stellar-slack> <scott> go-horizon will completely replace horizon… it should be seamless. Clients will not need to change when ruby horizon is deleted
<stellar-slack> <naumenkogs> I suppose we will have a discussion tomorrow about starting development now or waiting for go-horizon standalone mode
<stellar-slack> <naumenkogs> Do you have a list of functions already provided by go-horizon for current moment? For example, "provide transactions", "create wallets"
<stellar-slack> <scott> not really. we’re presently working on the documentation, which will give a list of all the functions in go-horizon, but until we complete that work the canonical source of all the functions provided by go-horizon is the route configuration in the source: https://github.com/stellar/go-horizon/blob/master/src/github.com/stellar/go-horizon/init_web.go#L71
<stellar-slack> <scott> for example `r.Get("/accounts/:account_id/transactions", &TransactionIndexAction{})` is the route for the “Transactions for account” endpoint that will be in the horizon reference guide
<stellar-slack> <naumenkogs> I got it. Thanks.
<stellar-slack> <scott> np!
evastellar has joined #stellar-dev
pixelbeat_ has joined #stellar-dev
pixelbeat_ has quit [Ping timeout: 255 seconds]
<sacarlson> this ruby example looks to be just what I was looking for <scott> thanks
<sacarlson> just one question so far as to what address would I use on this other than localhost $server = Faraday.new(url: "http://localhost:39132") do |conn|
irisli has joined #stellar-dev
<stellar-slack> <scott> sacarlson: use https://horizon-testnet.stellar.org
<stellar-slack> <scott> sorry, wait. That example is against stellar-core directly, not horizon
<sacarlson> <scott> cool thanks so now I'll just have to find some account numbers
<stellar-slack> <scott> my bad. let me give you an example that posts against https://horizon-testnet.stellar.org, one sec
<sacarlson> ok
<sacarlson> so no need for port number
<stellar-slack> <scott> yeah, the testnet listens on the default ssl port 443
<sacarlson> {"type"=>"not_found", "title"=>"Resource Missing", "status"=>404, "detail"=>"The resource at the url requested was not found. This is 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.", "instance"=>"horizon-testnet-001.prd.stellar001.internal.stellar-ops.com/hCYL7oezXs-064306"}
evastellar has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
<stellar-slack> <scott> yeah, as I mentioned the sample was against core directly, not horizon. I was working up a compatible example: https://gist.github.com/nullstyle/4108c4c70175f9787e24
<stellar-slack> <scott> If you run that, you should see `{"hash"=>"448f305b7e131f9f616de6cc73a88fb059b6ca03af49e0391a4b558ba8077e7a", "result"=>"failed", "error"=>"0000000000000000fffffff800000000”}` as the output
<stellar-slack> <scott> the submission failed because the sequence number is wrong, but it shows that the transaction flows all the way to a stellar-core instance and back out
<sacarlson> <scott> yup that's what I get {"hash"=>"06cfef4d97ab721927bd024dda36b5f7a210314b46a229e57af0277c33cd5347", "result"=>"failed", "error"=>"0000000000000000fffffff800000000"}
<sacarlson> <scott> so now all I need is a valid account number I would assume?
<stellar-slack> <scott> well, for this specific case you need the correct sequence number, which is a separate concept. Are you familiar with them?
<sacarlson> no
<stellar-slack> <scott> okay, let me find someone to explain things (I’m just about the head out of the office)
<stellar-slack> <bartek> @sacarlson: check out this JS lib docs: https://github.com/stellar/js-stellar-lib/tree/master/docs#sequence-numbers
<sacarlson> I should assume it would be possible to just provide account A to account B
<stellar-slack> <bartek> it explains how you should deal with it (it’s for JS but it’s probably the same for ruby)
<stellar-slack> <bartek> basically, you can get the current sequence number of the account just before submitting a transaction
<stellar-slack> <scott> cheers, y’all, I’m taking off for the day. sacarlson, if you have any questions please feel free to @ message me and I can try to answer them tomorrow morning, but I’ll probably be offline for the next 15 hours or so
<sacarlson> <scott> ok thanks again
<stellar-slack> <scott> happy to help!
<sacarlson> <bartek> I'm reading it now
stellar-slack has quit [Remote host closed the connection]
stellar-slack has joined #stellar-dev
nelisky has joined #stellar-dev
nelisky has quit [Quit: nelisky]