Skip to content
This repository has been archived by the owner on Aug 19, 2020. It is now read-only.

Transaction meet "CommandService Stateless invalid tx" warining message #147

Open
kenkan921 opened this issue Nov 30, 2018 · 0 comments
Open

Comments

@kenkan921
Copy link

Hi, I am new in both android app developing and hyperledger iroha. I am now designing an app with hyperledger iroha. When I was sending transaction request through the app to iroha server, the server-side showed below message:
[2018-11-30 05:46:16.131450474][th:118][warning] CommandService Stateless invalid tx: Signature: [[Wrong signature [073920b66487c3e6196db291cba7815236c24f9629a82a785bf9c852a79befbc13382e2939797b4683d68e88cf0adb2c35908b02ef41c5da67cfac02649b0505;313a07e6384776ed95447710d15e59148473ccfc052a681317a72a69f2a49910] ]] Transaction: [[Transaction should contain at least one command Wrongly formed creator_account_id, passed value: ''. Field should match regex '[a-z_0-9]{1,32}\@([a-zA-Z]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)*[a-zA-Z]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?' bad timestamp: too old, timestamp: 0, now: 1543556776120 Quorum should be within range (0, 128] ]] , hash: 708713afdb215a7fdd1b3246ec662a3d992648dc262ca1d5360be94b6d75313b

The error returned from my app is "Error: java.lang.RuntimeException: Transaction failed " and without any other information.

The code transaction part in my app is simply copied from iroha-android-sample, i.e.

protected  Completable TransferAsset(String[] data){
    return Completable.create(emitter -> {
       long currentTime = System.currentTimeMillis();
       Keypair userKeys = crypto.convertFromExisting(PUB_KEY, PRIV_KEY);
       String username = "admin";

       UnsignedTx sendAssetTx = txBuilder.creatorAccountId(username + "@" + DOMAIN_ID)
               .createdTime(BigInteger.valueOf(currentTime))
               .transferAsset(username + "@" + DOMAIN_ID,
                       data[0] + "@" + DOMAIN_ID, "hkd#test", "initail", data[1])
               .build();

       protoTxHelper = new ModelProtoTransaction(sendAssetTx);
       ByteVector txblob = protoTxHelper.signAndAddSignature(userKeys).finish().blob();
       byte[] bsq = toByteArray(txblob);
       TransactionOuterClass.Transaction protoTx = null;

       try{
           protoTx = TransactionOuterClass.Transaction.parseFrom(bsq);
       }catch (InvalidProtocolBufferException e){
           emitter.onError(e);
       }

        CommandServiceGrpc.CommandServiceBlockingStub stub = CommandServiceGrpc.newBlockingStub(channel)
                .withDeadlineAfter(CONNECTION_TIMEOUT_SECONDS, TimeUnit.SECONDS);

       stub.torii(protoTx);

       if (!isTransactionSuccessful(stub, sendAssetTx)){
           emitter.onError(new RuntimeException("Transaction failed"));
       } else {
           emitter.onComplete();
       }

    });
}

I found same issue was reported by truongnmt but no one answered. Can anyone tell what is this issue and teach me how to solve it?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant