memtrip / eos-jvm

EOS libraries for the JVM, designed primarily for Android development.
http://www.memtrip.com
Apache License 2.0
37 stars 19 forks source link

Implementing push, same as `cleos push action` #2

Open kination opened 6 years ago

kination commented 6 years ago

Hello I'm currenlty following the EOS tutorial, and trying to send event from android application same as cleos push action ... . I just looked on eos-chain-action, but couldn't found detail implementation about this.

Could you give me a guide about this? Or I'm also looking on eosreach project, so it is okay to let me know the file name that includes push handling if it has been implemented here.

Thanks.

samkirton commented 6 years ago

Hi mate, This class uses the nodeos api to push the transactions: https://github.com/memtrip/eos-jvm/blob/master/eos-chain-actions/src/main/kotlin/com/memtrip/eos/chain/actions/transaction/ChainTransaction.kt

The annotation preprocessor from the eos-abi-writer module is used to generate boiler plate code for the packed transaction and abi bytes. I would recommend looking at the eos-chain-action integration tests and building your actions in a similar way, the ChainTransaction abstract class handles the signature signing and packs the transaction bytes for you.

Integration tests: https://github.com/memtrip/eos-jvm/tree/master/eos-chain-actions/src/test/kotlin/com/memtrip/eos/chain/actions/transaction

samkirton commented 6 years ago

I will write a step by step guide also, but I hope the above helps for now

kination commented 6 years ago

@samkirton thanks! I'll look on it.

marinrusu1997 commented 5 years ago

@samkirton Can you please post here a little example of how to send transaction to a custom contract with some descriptions? I can't figure out how to do it, even after taking a look at library and your app