Coder Social home page Coder Social logo

token转账 about web3j-sample HOT 12 CLOSED

ethjava avatar ethjava commented on May 26, 2024
token转账

from web3j-sample.

Comments (12)

TOTOROYang avatar TOTOROYang commented on May 26, 2024

没见过这个错误,你的节点正常么 能通过curl命令去jsonrpc访问不。

from web3j-sample.

yfhuang521 avatar yfhuang521 commented on May 26, 2024

Admin admin= Admin.build(new HttpService("https://mainnet.infura.io/you api-key"));
我是通过这种方式生成的admin,转账的话是不是只能连接本地的eth服务?
@TOTOROYang

from web3j-sample.

TOTOROYang avatar TOTOROYang commented on May 26, 2024

这些公共节点只能进行本地签名再交易,不提供解锁交易的,因为不安全。签名交易具体看我ColdWallet

from web3j-sample.

pzhangleo avatar pzhangleo commented on May 26, 2024

hi, 冷钱包实现中,from地址没有用到么

from web3j-sample.

yfhuang521 avatar yfhuang521 commented on May 26, 2024

调用ColdWallet的testTokenTransaction()方法转账,生成了交易但一直是Pending状态,是费用设置有问题吗?
_20180524103911
@TOTOROYang

from web3j-sample.

yfhuang521 avatar yfhuang521 commented on May 26, 2024

问题解决了,谢谢!
一般设置成15Gwei就可以成功.
@TOTOROYang

from web3j-sample.

yfhuang521 avatar yfhuang521 commented on May 26, 2024

@TOTOROYang
你好,还想请教个问题,通过交易的hash值获取交易详情Transaction对象后,怎么判断这个交易是成功还是失败呢?

from web3j-sample.

yfhuang521 avatar yfhuang521 commented on May 26, 2024

EthGetTransactionReceipt send = web3j.ethGetTransactionReceipt(txHash).send();
Optional receiptO = send.getTransactionReceipt();
System.out.println(receiptO.isPresent());
if (receiptO.isPresent()) {
TransactionReceipt receipt = receiptO.get();
System.out.println(receipt.getStatus());
}

from web3j-sample.

TOTOROYang avatar TOTOROYang commented on May 26, 2024

@pzhangleo 在参数中没有用到。地址包含在私钥签名后的信息 s r v 中,可以解码得到。

from web3j-sample.

TOTOROYang avatar TOTOROYang commented on May 26, 2024

@yfhuang521 在公链中TransactionReceipt 对象里面有status参数可以判断成不成功。0x1成功0x0失败。
私链中可能没有status字段,因为创世块的设置不同。

from web3j-sample.

yfhuang521 avatar yfhuang521 commented on May 26, 2024

@TOTOROYang
好的,谢谢!

from web3j-sample.

pzhangleo avatar pzhangleo commented on May 26, 2024

多谢解答

from web3j-sample.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.