I am using the Go Ethereum (Geth) library for Android. I want to deploy this multi-signature contract on my own Geth node in Kotlin code, which I'm really struggling with due to there being next to no documentation or examples for Geth on Android. I compiled this contract to .abi and .bin files, with which I generated a Java binding/wrapper using abigen. How can I now deploy this binding in my Kotlin code? As far as I'm aware, the only way to find out what functions and classes my Geth library contains is by inspecting the .aar itself and by using Android Studio's autocompletion hints. In this way, I discovered that the org.ethereum.geth.Geth class has the methods deployContract() (which asks for a TransactOpts; which I also struggle with) and bindContract(). What is the difference between them, and how do I use them?
About TransactOpts: it can be easily made using the Geth.newTransactOpts() method, and after that I can set various fields, such as gasPrice and fromAddress. I tried to set these fields. It seems I can create a TransactOpts with NewKeyedTransactOpts(). However, I can't find this method in the Android Geth version. As one of its field is a Signer, I even created a KeystoreSigner class, which I use to create a Signer instance, which I then put in the TransactOpts. However, when I run it with all fields, I get a hex not valid error. Debugging is a bit difficult, since I can't step into the Geth code lines.
Any suggestions or pointers are greatly appreciated!
from How to deploy an Ethereum contract with Go Ethereum (Geth) for Android in Kotlin?
No comments:
Post a Comment