adyliu / jeos Goto Github PK
View Code? Open in Web Editor NEWEOS Blockchain Java SDK
Home Page: https://github.com/adyliu/jeos
EOS Blockchain Java SDK
Home Page: https://github.com/adyliu/jeos
EosApi client = EosApiFactory.create("https://geo.eosasia.one");
Account account = client.getAccount("gggggggg");
先是报 NoClassDefFoundError 错误;Stack Overflow说是因为Android minSdkVersion必须是26及其以
上;
解决之后报的是这个:
com.fasterxml.jackson.databind.Module: Provider com.fasterxml.jackson.datatype.jsr310.JSR310Module
could not be instantiated
Unknown action newaccount in contract eosio.token,
大佬,这边执行的时候,出现这个错,
com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type java.lang.Integer
from String "5408789254": Overflow: numeric value (5408789254) out of range of Integer (-2147483648 - 2147483647)
at [Source: (okhttp3.ResponseBody$BomAwareReader); line: 1, column: 34] (through reference chain: io.jafka.jeos.core.response.history.action.Actions["actions"]->java.util.ArrayList[0]->io.jafka.jeos.core.response.history.action.Action["global_action_seq"])
class Action -> private Integer accountActionSeq
Cannot be Integer
The block #18418330 broadcasts the new producers with sepecial data like this:
"new_producers": {
"version": 370,
"producers": [{
"producer_name": "bitfinexeos1",
"block_signing_key": "EOS4tkw7LgtURT3dvG3kQ4D1sg3aAtPDymmoatpuFkQMc7wzZdKxc"
},{
"producer_name": "cochainworld",
"block_signing_key": "EOS5QDSQyh96SmktA28dteEchc1QCVdqKYG4YVDHGGATMYxqy33wi"
},{
"producer_name": "eos42freedom",
"block_signing_key": "EOS4tw7vH62TcVtMgm2tjXzn9hTuHEBbGPUK2eos42ssY7ip4LTzu"
},{
"producer_name": "eosauthority",
"block_signing_key": "EOS7dA4bBiwNqwHwoSY9wSVyXfUgKqdLEMv5hC6tBxVsutKkarpUk"
},{
"producer_name": "eosbeijingbp",
"block_signing_key": "EOS5dGpcEhwB4VEhhXEcqtZs9EQj5HeetuXDnsAGVHMXHAFdMjbdj"
},{
"producer_name": "eosbixinboot",
"block_signing_key": "EOS7QC1XfAtkYeLjbHQjcDWVqUsxuSJ3YRhNyG93VAv2u3uHopGVp"
},{
"producer_name": "eoscanadacom",
"block_signing_key": "EOS5HYV7rWeRxpZMCooe8YHRFQHKK7ncdmmUMTe3wCMaY2EvyVzUx"
},{
"producer_name": "eoscannonchn",
"block_signing_key": "EOS73cTi9V7PNg4ujW5QzoTfRSdhH44MPiUJkUV6m3oGwj7RX7kML"
},{
"producer_name": "eosfishrocks",
"block_signing_key": "EOS4xAhqjLs5fsCzw7QsGYJtRDVo3t2xRFCHd7amGEWwhjSb5DPZT"
},{
"producer_name": "eosflytomars",
"block_signing_key": "EOS6Agpfp38bTyRjJDmB4Qb1EpQSq7wnEAsALXgXE7KFSzKjokkFD"
},{
"producer_name": "eosgenblockp",
"block_signing_key": "EOS6y277mUAuj1Pn3uUiqmDTME2ujhRCVQtw6pCQ8q3uFfwEVjoJ1"
},{
"producer_name": "eoshuobipool",
"block_signing_key": "EOS5XKswW26cR5VQeDGwgNb5aixv1AMcKkdDNrC59KzNSBfnH6TR7"
},{
"producer_name": "eosiosg11111",
"block_signing_key": "EOS7zVBQMhV7dZ5zRQwBgDmmbFCHA6YcmwW6Dq5CePGpqLR1ZsVAc"
},{
"producer_name": "eoslaomaocom",
"block_signing_key": "EOS8QgURqo875qu3a8vgZ58qBeu2cTehe9zAWRfpdCXAQipicu1Fi"
},{
"producer_name": "eosnewyorkio",
"block_signing_key": "EOS6GVX8eUqC1gN1293B3ivCNbifbr1BT6gzTFaQBXzWH9QNKVM4X"
},{
"producer_name": "eospaceioeos",
"block_signing_key": "EOS6yHKg1ve1i4AguSYUNNrzBoBxkjyxrhg8pyZqmFWeFXkf4JX4p"
},{
"producer_name": "eosswedenorg",
"block_signing_key": "EOS7SGSBsWhSob6TEric6u3TGodcc1uXFcqSrquJ3Etuqcbb3VnNY"
},{
"producer_name": "jedaaaaaaaaa",
"block_signing_key": "EOS6nB9Ar5sghWjqk27bszCiA9zxQtXZCaAaEkf2nwUm9iP5MEJTT"
},{
"producer_name": "libertyblock",
"block_signing_key": "EOS7TqVs7LpMzJwikiWkGTG9UGSwcQVhxP2ZKBM7FCbUwcrryNgHP"
},{
"producer_name": "starteosiobp",
"block_signing_key": "EOS4wZZXm994byKANLuwHD6tV3R3Mu3ktc41aSVXCBaGnXJZJ4pwF"
},{
"producer_name": "zbeosbp11111",
"block_signing_key": "EOS7rhgVPWWyfMqjSbNdndtCK8Gkza3xnDbUupsPLMZ6gjfQ4nX81"
}
]
}
Since wallet_plugin and wallet_api_plugin is no longer supported in nodeos, how can we sign
transaction now ?
client.signTransaction
is executed by /v1/wallet/sign_transaction
, How can I sign a transaction without wallet api?
There is an error when calling eosApi.getActions()
please fix it.
Ni hao, you have bad practices in your KeyUtil.
UUID is not recommended for other stuff than userId. It was used back in the day for content management systems in Java. It is definitely not for generating random numbers (read specification)
UUID length is 16 bytes. Plus some bytes are static, not random. For example it also contains version byte. So you loose entropy here.
Next you put UUID string into SHA-256. But you will not get any extra security from converting 16 bytes to 32 bytes here. You also loose entropy level here.
UUID is timebased, low entropy, pseudorandom. High probability of conflict. High probability to be traced back by timestamp. Therefore if you use UUID and create cryptocurrency account, it is easily hackable and you loose all your money.
public static UUID randomUUID() {
SecureRandom ng = Holder.numberGenerator;
byte[] randomBytes = new byte[16];
ng.nextBytes(randomBytes);
randomBytes[6] &= 0x0f; /* clear version */
randomBytes[6] |= 0x40; /* set to version 4 */
randomBytes[8] &= 0x3f; /* clear variant */
randomBytes[8] |= 0x80; /* set to IETF variant */
return new UUID(randomBytes);
}`
I use the offline transfer function,the code as follow:
`static void transferOffline() throws Exception{
// --- get the current state of blockchain
EosApi eosApi = EosApiFactory.create("http://192.168.1.75:8888");
SignArg arg = eosApi.getSignArg(120);
System.out.println(eosApi.getObjectMapper().writeValueAsString(arg));
// --- sign the transation of token tansfer
String privateKey = "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3";//replace the real private key
String from1 = "acca";
String to1 = "accb";
String quantity = "100 SYS";
String memo = "sent by eos sdk";
LocalApi localApi = EosApiFactory.createLocalApi();
PushTransactionRequest req = localApi.transfer(arg, privateKey, from1, to1, quantity, memo);
System.out.println(localApi.getObjectMapper().writeValueAsString(req));
// --- push the signed-transaction to the blockchain
PushedTransaction pts = eosApi.pushTransaction(req);
System.out.println(localApi.getObjectMapper().writeValueAsString(pts));
}`
But it report error as follow:
Exception in thread "main" io.jafka.jeos.exception.EosApiException: Internal Service Error: eosio_assert_message assertion failure at io.jafka.jeos.impl.EosApiServiceGenerator.executeSync(EosApiServiceGenerator.java:61) at io.jafka.jeos.impl.EosApiRestClientImpl.pushTransaction(EosApiRestClientImpl.java:131) at org.web3j.sample.TestEOS.transferOffline(TestEOS.java:129) at org.web3j.sample.TestEOS.main(TestEOS.java:50) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
I can use offline transfer function with another SDK eos4j-1.0.2.jar.I think there are something wrong with
this SDK.Please help!
I get an EOF IO Exception. I have looked around and what I see is the server is closing the connection and the client from jeos is not keeping it open.
I have found one post in github that says to fix this add this to the http client connection.
addHeader("Connection","close")
Problem is I'm not sure in jeos where I have access to the client to add this???
Here's the stack trace:
`Exception in thread "main" io.jafka.jeos.exception.EosApiException: java.io.IOException: unexpected end of stream on Connection{127.0.0.1:8888, proxy=DIRECT hostAddress=/127.0.0.1:8888 cipherSuite=none protocol=http/1.1}
at io.jafka.jeos.impl.EosApiServiceGenerator.executeSync(EosApiServiceGenerator.java:64)
at io.jafka.jeos.impl.EosApiRestClientImpl.abiJsonToBin(EosApiRestClientImpl.java:122)
at Main.main(Main.java:69)
Caused by: java.io.IOException: unexpected end of stream on Connection{127.0.0.1:8888, proxy=DIRECT hostAddress=/127.0.0.1:8888 cipherSuite=none protocol=http/1.1}
at okhttp3.internal.http1.Http1Codec.readResponseHeaders(Http1Codec.java:208)
at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:88)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at io.jafka.jeos.impl.LoggingInterceptor.intercept(LoggingInterceptor.java:32)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
at okhttp3.RealCall.execute(RealCall.java:77)
at retrofit2.OkHttpCall.execute(OkHttpCall.java:180)
at io.jafka.jeos.impl.EosApiServiceGenerator.executeSync(EosApiServiceGenerator.java:56)
... 2 more
Caused by: java.io.EOFException: \n not found: limit=0 content=…
at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:237)
at okhttp3.internal.http1.Http1Codec.readHeaderLine(Http1Codec.java:215)
at okhttp3.internal.http1.Http1Codec.readResponseHeaders(Http1Codec.java:189)
... 22 more
Process finished with exit code 1`
"D:\Program Files\Java\jdk1.8.0_201\bin\java.exe" "-javaagent:D:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.1\lib\idea_rt.jar=59745:D:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.1\bin" -Dfile.encoding=UTF-8 -classpath "D:\Program Files\Java\jdk1.8.0_201\jre\lib\charsets.jar;D:\Program Files\Java\jdk1.8.0_201\jre\lib\deploy.jar;D:\Program Files\Java\jdk1.8.0_201\jre\lib\ext\access-bridge-64.jar;D:\Program Files\Java\jdk1.8.0_201\jre\lib\ext\cldrdata.jar;D:\Program Files\Java\jdk1.8.0_201\jre\lib\ext\dnsns.jar;D:\Program Files\Java\jdk1.8.0_201\jre\lib\ext\jaccess.jar;D:\Program Files\Java\jdk1.8.0_201\jre\lib\ext\jfxrt.jar;D:\Program Files\Java\jdk1.8.0_201\jre\lib\ext\localedata.jar;D:\Program Files\Java\jdk1.8.0_201\jre\lib\ext\nashorn.jar;D:\Program Files\Java\jdk1.8.0_201\jre\lib\ext\sunec.jar;D:\Program Files\Java\jdk1.8.0_201\jre\lib\ext\sunjce_provider.jar;D:\Program Files\Java\jdk1.8.0_201\jre\lib\ext\sunmscapi.jar;D:\Program Files\Java\jdk1.8.0_201\jre\lib\ext\sunpkcs11.jar;D:\Program Files\Java\jdk1.8.0_201\jre\lib\ext\zipfs.jar;D:\Program Files\Java\jdk1.8.0_201\jre\lib\javaws.jar;D:\Program Files\Java\jdk1.8.0_201\jre\lib\jce.jar;D:\Program Files\Java\jdk1.8.0_201\jre\lib\jfr.jar;D:\Program Files\Java\jdk1.8.0_201\jre\lib\jfxswt.jar;D:\Program Files\Java\jdk1.8.0_201\jre\lib\jsse.jar;D:\Program Files\Java\jdk1.8.0_201\jre\lib\management-agent.jar;D:\Program Files\Java\jdk1.8.0_201\jre\lib\plugin.jar;D:\Program Files\Java\jdk1.8.0_201\jre\lib\resources.jar;D:\Program Files\Java\jdk1.8.0_201\jre\lib\rt.jar;D:\project\jeos-master\target\classes;C:\Users\Administrator\.m2\repository\com\squareup\retrofit2\retrofit\2.5.0\retrofit-2.5.0.jar;C:\Users\Administrator\.m2\repository\com\squareup\retrofit2\converter-jackson\2.5.0\converter-jackson-2.5.0.jar;C:\Users\Administrator\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.9.4\jackson-databind-2.9.4.jar;C:\Users\Administrator\.m2\repository\com\squareup\okhttp3\okhttp\3.13.1\okhttp-3.13.1.jar;C:\Users\Administrator\.m2\repository\com\squareup\okio\okio\1.17.2\okio-1.17.2.jar;C:\Users\Administrator\.m2\repository\org\slf4j\slf4j-log4j12\1.7.26\slf4j-log4j12-1.7.26.jar;C:\Users\Administrator\.m2\repository\org\slf4j\slf4j-api\1.7.26\slf4j-api-1.7.26.jar;C:\Users\Administrator\.m2\repository\log4j\log4j\1.2.17\log4j-1.2.17.jar;C:\Users\Administrator\.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.9.8\jackson-datatype-jsr310-2.9.8.jar;C:\Users\Administrator\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.9.0\jackson-annotations-2.9.0.jar;C:\Users\Administrator\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.9.8\jackson-core-2.9.8.jar;C:\Users\Administrator\.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.9.8\jackson-datatype-jdk8-2.9.8.jar" TransferEOS
log4j:WARN No appenders could be found for logger (io.jafka.jeos.impl.LoggingInterceptor).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
{
"head_block_num" : 21329439,
"last_irreversible_block_num" : 21329114,
"ref_block_prefix" : 2721541336,
"head_block_time" : "2019-04-01T07:47:07",
"chain_id" : "e70aaab8997e1dfce58fbfac80cbbb8fecec7b99cf982a9444273cbc64c41473",
"expired_second" : 120
}
{
"compression" : "none",
"transaction" : {
"expiration" : "2019-04-01T07:49:07",
"ref_block_num" : 21329114,
"ref_block_prefix" : 2721541336,
"max_net_usage_words" : 0,
"max_cpu_usage_ms" : 0,
"delay_sec" : 0,
"context_free_actions" : [ ],
"actions" : [ {
"account" : "eosio.token",
"name" : "transfer",
"authorization" : [ {
"actor" : "aqdapserver1",
"permission" : "active"
} ],
"data" : "10aeda57e16a92352004350d51cdb4b30a0000000000000004454f53000000002f73656e7420627920656f732073646b202868747470733a2f2f6769746875622e636f6d2f6164796c69752f6a656f73"
} ],
"transaction_extensions" : [ ],
"context_free_data" : [ ]
},
"signatures" : [ "SIG_K1_KZrRJF6LSGxaMTEwjyA6TnJPwc3M9NzzKuCAi627W6Yg7stujj6ymoqyZwzffUTRuXQzrJNjfJhR5x5T5GergzezsfoGFw" ]
}
Exception in thread "main" io.jafka.jeos.exception.EosApiException: java.net.SocketTimeoutException: timeout
at io.jafka.jeos.impl.EosApiServiceGenerator.executeSync(EosApiServiceGenerator.java:64)
at io.jafka.jeos.impl.EosApiRestClientImpl.pushTransaction(EosApiRestClientImpl.java:131)
at TransferEOS.main(TransferEOS.java:112)
Caused by: java.net.SocketTimeoutException: timeout
at okio.Okio$4.newTimeoutException(Okio.java:232)
at okio.AsyncTimeout.exit(AsyncTimeout.java:286)
at okio.AsyncTimeout$2.read(AsyncTimeout.java:241)
at okio.RealBufferedSource.read(RealBufferedSource.java:51)
at okhttp3.internal.http1.Http1Codec$AbstractSource.read(Http1Codec.java:374)
at okhttp3.internal.http1.Http1Codec$FixedLengthSource.read(Http1Codec.java:418)
at okio.Buffer.writeAll(Buffer.java:1143)
at okio.RealBufferedSource.readString(RealBufferedSource.java:203)
at okhttp3.ResponseBody.string(ResponseBody.java:182)
at io.jafka.jeos.impl.LoggingInterceptor.intercept(LoggingInterceptor.java:38)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:264)
at okhttp3.RealCall.execute(RealCall.java:93)
at retrofit2.OkHttpCall.execute(OkHttpCall.java:186)
at io.jafka.jeos.impl.EosApiServiceGenerator.executeSync(EosApiServiceGenerator.java:56)
... 2 more
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:171)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at okio.Okio$2.read(Okio.java:140)
at okio.AsyncTimeout$2.read(AsyncTimeout.java:237)
... 15 more
Process finished with exit code 1
What should I do? Is this a bug?
我在本地建立了一条私有链,用你的SDK的例子,查询余额操作正常,但是在发送交易的时候,报错:
我的程序是:
`public class TestEOS {
public static String url_wallet = "http://192.168.1.75:18888";
public static String url_chain = "http://192.168.1.75:8888";//"http://jungle.cryptolions.io:18888"
public static EosApi client;
public static void main(String[] args) throws Exception{
BasicConfigurator.configure();
client = EosApiFactory.create(url_wallet, url_chain, url_chain);
ChainInfo info = client.getChainInfo();
//System.out.println("chain info:"+info);
// getBalance("acctoken","acca");
transfer("acctoken","acca","accb","100.0000 SYS");
TimeUnit.MINUTES.sleep(50000);
}
static void getBalance(String token,String account){
List<String> ret = client.getCurrencyBalance(token,account,"SYS");
System.out.println("account balance:"+ret);
}
static void transfer(String token,String from,String to,String money) throws Exception {
ObjectMapper mapper = EosApiServiceGenerator.getMapper();
// ① pack transfer data
TransferArg transferArg = new TransferArg(from, to, money, "我是**人");
AbiJsonToBin data = client.abiJsonToBin(token, "transfer", transferArg);
System.out.println("bin= " + data.getBinargs());
// ② get the latest block info
Block block = client.getBlock(client.getChainInfo().getHeadBlockId());
System.out.println("blockNum=" + block.getBlockNum());
// ③ create the authorization
List<TransactionAuthorization> authorizations = Arrays.asList(new TransactionAuthorization(from, "active"));
// ④ build the all actions
List<TransactionAction> actions = Arrays.asList(//
new TransactionAction(token, "transfer", authorizations, data.getBinargs())//
);
// ⑤ build the packed transaction
PackedTransaction packedTransaction = new PackedTransaction();
packedTransaction.setRefBlockPrefix(block.getRefBlockPrefix());
packedTransaction.setRefBlockNum(block.getBlockNum());
// expired after 3 minutes
String expiration = ZonedDateTime.now(ZoneId.of("GMT")).plusMinutes(3).truncatedTo(ChronoUnit.SECONDS).format(DateTimeFormatter.ISO_LOCAL_DATE_TIME);
packedTransaction.setExpiration(LocalDateTime.parse(expiration));
packedTransaction.setRegion("0");
packedTransaction.setMaxNetUsageWords(0);
packedTransaction.setMaxCpuUsageMs(0);
packedTransaction.setActions(actions);
// ⑥ unlock the creator's wallet
try {
client.unlockWallet("default", "PW5JECR3XedNovw8w8cPmYBe52eH51buki4rVVHUwunWFeJNco4Vd");
} catch (EosApiException ex) {
System.err.println(ex.getMessage());
}
// ⑦ sign the transaction
SignedPackedTransaction signedPackedTransaction = client.signTransaction(packedTransaction, //
Arrays.asList("EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"), //
"38dc6e87bb9f6b33a21dd56b9f2c24813d83c71009077279c8d746fbd0eaf09d");
System.out.println("signedPackedTransaction=" + mapper.writeValueAsString(signedPackedTransaction));
System.out.println("\n--------------------------------\n");
// ⑧ push the signed transaction
PushedTransaction pushedTransaction = client.pushTransaction("none", signedPackedTransaction);
System.out.println("pushedTransaction=" + mapper.writeValueAsString(pushedTransaction));
}
}报的错误是:
Exception in thread "main" io.jafka.jeos.exception.EosApiException: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of io.jafka.jeos.core.common.transaction.TransactionAuthorization
(no Creators, like default construct, exist): cannot deserialize from Object value (no delegate- or property-based Creator)
at [Source: (okhttp3.ResponseBody$BomAwareReader); line: 1, column: 242] (through reference chain: io.jafka.jeos.core.common.transaction.SignedPackedTransaction["actions"]->java.util.ArrayList[0]->io.jafka.jeos.core.common.transaction.TransactionAction["authorization"]->java.util.ArrayList[0])
at io.jafka.jeos.impl.EosApiServiceGenerator.executeSync(EosApiServiceGenerator.java:64)
at io.jafka.jeos.impl.EosApiRestClientImpl.signTransaction(EosApiRestClientImpl.java:210)
at org.web3j.sample.TestEOS.transfer(TestEOS.java:95)
at org.web3j.sample.TestEOS.main(TestEOS.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of io.jafka.jeos.core.common.transaction.TransactionAuthorization
(no Creators, like default construct, exist): cannot deserialize from Object value (no delegate- or property-based Creator)
at [Source: (okhttp3.ResponseBody$BomAwareReader); line: 1, column: 242] (through reference chain: io.jafka.jeos.core.common.transaction.SignedPackedTransaction["actions"]->java.util.ArrayList[0]->io.jafka.jeos.core.common.transaction.TransactionAction["authorization"]->java.util.ArrayList[0])
at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:67)
at com.fasterxml.jackson.databind.DeserializationContext.reportBadDefinition(DeserializationContext.java:1452)
at com.fasterxml.jackson.databind.DeserializationContext.handleMissingInstantiator(DeserializationContext.java:1028)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1297)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:326)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:159)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:286)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27)
at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:127)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:286)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27)
at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:127)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151)
at com.fasterxml.jackson.databind.ObjectReader._bindAndClose(ObjectReader.java:1611)
at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1203)
at retrofit2.converter.jackson.JacksonResponseBodyConverter.convert(JacksonResponseBodyConverter.java:32)16:23:48.399 [main] INFO io.jafka.jeos.impl.LoggingInterceptor - OkHttp-6-3--<head http://192.168.1.75:18888/v1/wallet/sign_transaction 9ms Connection: close`
我在本地执行json-rpc命令:
curl http://192.168.1.75:18888/v1/wallet/sign_transaction -d ' [ { "expiration" : "2018-12-07T06:46:48", "ref_block_num" : 56141, "ref_block_prefix" : 3654011199, "max_net_usage_words" : 0, "max_cpu_usage_ms" : 0, "context_free_actions" : [ ], "actions" : [ { "account" : "acctoken", "name" : "transfer", "authorization" : [ { "actor" : "acca", "permission" : "active" } ], "data" : "0000000000601032000000000070103240420f000000000004535953000000000fe68891e698afe4b8ade59bbde4baba" } ], "transaction_extensions" : [ ], "context_free_data" : [ ], "region" : "0" }, [ "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV" ], "38dc6e87bb9f6b33a21dd56b9f2c24813d83c71009077279c8d746fbd0eaf09d" ] '
是由结果的:
{"expiration":"2018-12-07T06:46:48","ref_block_num":56141,"ref_block_prefix":3654011199,"max_net_usage_words":0,"max_cpu_usage_ms":0,"delay_sec":0,"context_free_actions":[],"actions":[{"account":"acctoken","name":"transfer","authorization":[{"actor":"acca","permission":"active"}],"data":"0000000000601032000000000070103240420f000000000004535953000000000fe68891e698afe4b8ade59bbde4baba"}],"transaction_extensions":[],"signatures":["SIG_K1_JyNeuGBhirhUC7nLcZTxPiUKxBmTTD3dRRDbyDEpMMuTq6qTawuaG1jsGs4hKQRBYTGJzQwWyyLdwwJ7U8CevJtMdX389A"],"context_free_data":[]}
求大神帮忙看一下是什么原因。
请问如何在pushTransaction 获取交易hash呢?
目前都是在PushedTransaction之后,通过返回的PushedTransaction获取transactionId, 有办法在向网络广播之前拿到么?
现KeyUtil能signHash, 能否提供相应验证方法,入参是 publicKey 和signature
how can fix it
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.