Hi,
I decided to move here to let some space on BTT ;D
I’m writing an automated way to co-sign transactions in NodeJs. I already managed to pull the unconfirmed transactions every minutes to look for new multisig transactions. Now I’m trying to sign a transaction using MultisigSignatureRequest, found here.
The view I use:var transac = {wallet: "KrakenLabs", password: "*****", account: "NCSRY3X454ZCT4OQQJZBBCPKFMEMXKXMR4M6Y62N", multisigAddress: "NBLSBMKVSFZ257RTPO2UYCX7GXT7G2IK7S6LJD2E", innerHash: hashM, (innerHash from unconfirmed transaction, match with the one in the NCC when I want to manually sign) hoursDue: 2, fee: 6000000};
I had 2 kind of error during my tests"timeStamp": 11669335, "error": "Internal Server Error", "message": null, "status": 500
and another one with a java string warning, I wasn’t able to reproduce it yet.
I’m using a local NCC connected to a remote NIS.
[EDIT] Now I’m sure the problem come from innerHash, if I add properties one by one: wallet, password, account, multisigAddress, it ask me for innerHash:{"timeStamp": 11678060, "error": "Bad Request", "message": "expected value for property innerHash, but none was found", "status": 400}
When I set it => Internal Server Error
Tried other hashes I got from the pull but still same error.
Sounds like something is wrong with the innerHash you're providing.
how are you calculating it ? Can you give examples ?
To get the innerHash I am parsing the json returned by /account/transactions/unconfirmed
obj = JSON.parse(d);test = obj.transactions[0].innerHash.data;
console.log(test); //shows 6aedeb9ebaff4b7d6b74e69cedb3a8a14a3e7d81de7c77e1a20fddc55bdbc296};
Even If I set innerHash directly with this one:
http://i.imgur.com/uu1mPUf.png?1
(so exactly the same I got from parsing)var transac = {wallet: "KrakenLabs", password: "***", account: "NCSRY3X454ZCT4OQQJZBBCPKFMEMXKXMR4M6Y62N", multisigAddress: "NBLSBMKVSFZ257RTPO2UYCX7GXT7G2IK7S6LJD2E", innerHash: "6aedeb9ebaff4b7d6b74e69cedb3a8a14a3e7d81de7c77e1a20fddc55bdbc296"};
console.log(transac);
var toPrettyJson2 = function(transac) {
var e = JSON.stringify(transac,null,4);
console.log(e);};
nem.nccPost("/wallet/account/signature/send",transac, function(err) {
console.log(err); },toPrettyJson2);
Now I got:{"timeStamp": 11723113, "error": "Internal Server Error", "message": "java.lang.String cannot be cast to net.minidev.json.JSONObject", "status": 500}
After some tries “message”: “java.lang.String cannot be cast to net.minidev.json.JSONObject” return null, with same parameters
YEAH !! I just did it ! I set the innerHash property incorrectly, it wasinnerHash: { data: "09d7edf53f794676002321902a9dfe5e1414d0d4d810772c5f69d758e24ee318"; }
First automated co signature done ! ;D
good one
This is great.
@quantum
Right now Kod owns nemfaucet.com. It will expire in a few weeks. We were wondering if you would like to use this address or not. I noticed you already have your own address so it's entirely up to you.
We'd need to talk to the entire team but another possibility is we could maybe get you nem.io/faucet too.