是否可以用以太坊交易EthSendTransaction发送任意文本?
是的。文本应该是ASCII编码的,并在交易的数据中以十六进制字符串的形式提供。示例如下: RawTransaction.createTransaction( <nonce>, GAS_PRICE, GAS_LIMIT, "0x<address>", <amount>, "0x<hex encoded text>"); byte[] signedMessage = TransactionEncoder.signMessage(rawTransaction, ALICE); String hexValue = Numeric.toHexString(signedMessage); EthSendTransaction ethSendTransaction = web3j.ethSendRawTransaction(hexValue).send(); String transactionHash = ethSendTransaction.getTransactionHash(); ... 注:请确保你增加了交易的气体限制,以允许存储文本。 下面...