5

Following on the keypair generation thread, I am working on SDKs for different languages and I would like to build, sign and submit transactions so my question is what are the steps to do so?

Let's start with an operation for account creation:

createAccount {address, balance} 

What are the steps to generate the tx envelope that will be sent to the Horizon RPC endpoint? Any Stellar guides I've missed? Pointers highly appreciated.

7

The best thing to do is to look at one of the official libraries and use them as guide. I can give you an high-level overview of the steps required to implement the base library to interact with stellar.

First of all, you need a XDR serializer and deserializer. You probably also want to auto-generate the XDR object classes for you language using a tool like xdrgen. This is not strictly necessary, for my Rust library I wrote everything by hand.

Then you want to familiarize with the XDR definitions in stellar-core, start walking backwards from the Transaction definition.

The first thing to serialize is the public key, since it's used everywhere. From there you can start working on more complex objects (Asset, Operation, etc.) until you have everything needed for transactions.

I recommend using the official libraries to generate test cases, you can call the toXDR('base64') method on almost every javascript object and you will get back the base64-encoded XDR object.

Good luck!

  • 2
    Great! This at least is a starting point. Thanks. – Kuyawa Jan 21 '18 at 16:42

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.