I’m trying to deploy a smartcontract on Rinkbey. I’ve followed the official documentation and some tutorials. I implemented the following code in my android studio but contract.deploy returns nothing. private fun connectWithRinkBey() { // web3j = Web3j.build(InfuraHttpService(rinkBeyUrl)) val web3j = Web3j.build(HttpService("https://rinkeby.infura.io/v3/786cbf2ff21241c583732b7a1741880a")) try { val clientVersion = web3j.web3ClientVersion() .sendAsync().get() if (!clientVersion.hasError()) { Toast.makeText(this, "Connected", Toast.LENGTH_LONG).show() Log.d(TAG,::Listen
I’m trying to deploy a smartcontract on Rinkbey. I’ve followed the official documentation and some tutorials. I implemented the following code in my android studio but contract.deploy
returns nothing.
private fun connectWithRinkBey() { // web3j = Web3j.build(InfuraHttpService(rinkBeyUrl)) val web3j = Web3j.build(HttpService("https://rinkeby.infura.io/v3/786cbf2ff21241c583732b7a1741880a")) try { val clientVersion = web3j.web3ClientVersion() .sendAsync().get() if (!clientVersion.hasError()) { Toast.makeText(this, "Connected", Toast.LENGTH_LONG).show() Log.d(TAG, "deployContract2: Starting") Log.d(TAG, "deployContract2: ${deployContract2()}") Log.d(TAG, "connectWithRinkBey: Ending") } else { Toast.makeText(this, clientVersion.error.message, Toast.LENGTH_LONG).show() } } catch (e: Exception) { Toast.makeText(this, e.message, Toast.LENGTH_LONG).show() } } private fun deployContract2(): String { val transactionManager = RawTransactionManager(web3j, getCredentialsFromPrivateKey()) val contractGasProvider = StaticGasProvider(gasPrice, gasLimit) return Trust_sol_Trust.deploy(web3j, transactionManager, contractGasProvider) .send() .contractAddress }