hungtrinhduy ()
[SIZE=14px][FONT=arial]Dear friends,
We are a company testing on Mijin platform to experiment the promising new economy movement that Mijin could bring to us. Our company is given 4 ip addresses and some accounts to start with.
Account info request works normally. Here is the response:
Making request a transaction with url: http://givenIpAdress:givenPort/trans...epare-announce
with json object in the raw body:
The response is:
113.160.93.26 is our computer public address.
I'm wondering what happened with the request. Seems like something is not right with the param inside json object we included in the raw body.
I've been told that "version": -1744830463, which is hex 0x98000001 indicates test network. So I need to use "version": 1744830465, which is hex 0x68000001 to indicate main network.
So when "version": 1744830465 is setup the same message response is returned.
Any help would be appreciated![/FONT][/SIZE]
We are a company testing on Mijin platform to experiment the promising new economy movement that Mijin could bring to us. Our company is given 4 ip addresses and some accounts to start with.
Account info request works normally. Here is the response:
{ "meta": { "cosignatories": [], "cosignatoryOf": [], "status": "LOCKED", "remoteStatus": "INACTIVE" }, "account": { "address": "MAMIJINSVHBIPKT5XCFHJYGWL7WVRZQ6U7JG7LLN", "harvestedBlocks": 1, "balance": 0, "importance": 0, "vestedBalance": 0, "publicKey": "57b4832d9232ee410e93d595207cffc2b9e9c5002472c 4b0b b3bb10a4ce152e3", "label": null, "multisigInfo": {} } }
Making request a transaction with url: http://givenIpAdress:givenPort/trans...epare-announce
with json object in the raw body:
{ "transaction": { "timeStamp": 1455782672, "amount": 1000, "fee": 30, "recipient": "MANODEGZD6XTSM24BRMOPVWK6IMSVHBOAGVNAXBE", "type": 257, "deadline": 9154726, "message": { "payload": "74657374207472616e73616374696f6e", "type": 1 }, "version": -1744830463, "signer": "b4a167167ad77d2c24939fe99a8867786fe5e863b74c2 498f 1990aedc5baaa36" }, "privateKey": "account-private-key-is-using-here" }
The response is:
{ "timeStamp": 28632050, "error": "Unauthorized", "message": "remote 113.160.93.26 attempted to call local /transaction/prepare-announce", "status": 401 }
113.160.93.26 is our computer public address.
I'm wondering what happened with the request. Seems like something is not right with the param inside json object we included in the raw body.
I've been told that "version": -1744830463, which is hex 0x98000001 indicates test network. So I need to use "version": 1744830465, which is hex 0x68000001 to indicate main network.
So when "version": 1744830465 is setup the same message response is returned.
Any help would be appreciated![/FONT][/SIZE]
Takanobu ()
Hi,
I guess….
You should not use "/transaction/prepare-announce" but "/transaction/announce" , if you want to transfer xem
and , You can get networkid by "/node/info" and you will get "96" . and version is 1610612737
and , unit is wrong. you have to write amount 1000 * 1000000 and fee: 1000 * 1000000
and , deadline is timeStamp + due * 60 , timeStamp is seconds from NEM_EPOC. I think 28……
below is parameter that got success, of course you have to serialize and sign
I guess….
You should not use "/transaction/prepare-announce" but "/transaction/announce" , if you want to transfer xem
and , You can get networkid by "/node/info" and you will get "96" . and version is 1610612737
and , unit is wrong. you have to write amount 1000 * 1000000 and fee: 1000 * 1000000
and , deadline is timeStamp + due * 60 , timeStamp is seconds from NEM_EPOC. I think 28……
below is parameter that got success, of course you have to serialize and sign
- amount: 10000000
- deadline: 28718934
- fee: 3000000
- message:
- payload: ""
- type: 1
- mosaics: null
- recipient: "THISISRECIPIENTADDRESS"
- signer: "SENDERPUBLICKEY"
- timeStamp: 28715334
- type: 257
- version: 1610612737
hungtrinhduy ()
Hi,
Thank you Takanobu-san for your great information.
After digging into the apis documentation and compare to your information now the transaction api makes more sense to me.
By the way, if you are a java developer, you might tell me some kind of java library to create the signature for the message before sending transaction request.
Thanks for your big support.
Thank you Takanobu-san for your great information.
After digging into the apis documentation and compare to your information now the transaction api makes more sense to me.
By the way, if you are a java developer, you might tell me some kind of java library to create the signature for the message before sending transaction request.
Thanks for your big support.
Takanobu ()
sorry, I'm not java developer.
but I can tell you simple js source.
below
https://github.com/mediaprogramer/mijin-SimpleTransfer
in transfer.js , serializeTransferTransaction function is serializing json
and KeyPair.js is signing library ,which needs nacl-fast.js .(from LightWallet)
I think you will transfer on java if you can port these script to java program.
but I can tell you simple js source.
below
https://github.com/mediaprogramer/mijin-SimpleTransfer
in transfer.js , serializeTransferTransaction function is serializing json
and KeyPair.js is signing library ,which needs nacl-fast.js .(from LightWallet)
I think you will transfer on java if you can port these script to java program.
hungtrinhduy ()
@Takanobu-san
Thank you very much
Here is me again. I've tried to port your js code to java.
Only one thing confuses me is this code:
if (entity['message']['type'] === 1 || entity['message']['type'] === 2) {
var temp = hex2ua(entity['message']['payload']);
if (temp.length === 0) {
d[i++] = 0;
e += 4;
} else {
// length of a message object
d[i++] = 8 + temp.length;
// object itself
d[i++] = entity['message']['type'];
d[i++] = temp.length;
e += 12;
for (var j = 0; j<temp.length; ++j) { b[e++] = temp[j]; }
}
}
According to api:
Payload: UTF8 encoded string.
Example 'Hello': 0x48, 0x65, 0x6c, 0x6c, 0x6f
This line of code: d[i++] = 8 + temp.length; also unclear to me cause the api doesn't seem to be explained it well.
Filling the 'Hello' to the entity['message']['payload'] gives me another result other than 0x48, 0x65, 0x6c, 0x6c, 0x6f
https://github.com/NewEconomyMovement/nem-lightwallet/blob/master/lightwallet/services/Transactions.js is same as your code.
Hope you spend some time to get me right.
Thank you very much
Here is me again. I've tried to port your js code to java.
Only one thing confuses me is this code:
if (entity['message']['type'] === 1 || entity['message']['type'] === 2) {
var temp = hex2ua(entity['message']['payload']);
if (temp.length === 0) {
d[i++] = 0;
e += 4;
} else {
// length of a message object
d[i++] = 8 + temp.length;
// object itself
d[i++] = entity['message']['type'];
d[i++] = temp.length;
e += 12;
for (var j = 0; j<temp.length; ++j) { b[e++] = temp[j]; }
}
}
According to api:
Payload: UTF8 encoded string.
Example 'Hello': 0x48, 0x65, 0x6c, 0x6c, 0x6f
This line of code: d[i++] = 8 + temp.length; also unclear to me cause the api doesn't seem to be explained it well.
Filling the 'Hello' to the entity['message']['payload'] gives me another result other than 0x48, 0x65, 0x6c, 0x6c, 0x6f
https://github.com/NewEconomyMovement/nem-lightwallet/blob/master/lightwallet/services/Transactions.js is same as your code.
Hope you spend some time to get me right.
Takanobu ()
sorry , I noticed your comment just now.
As you might guess , my sample program was borrowed by lightwallet script.
then I use same algorism without kowing well…
As you might guess , my sample program was borrowed by lightwallet script.
then I use same algorism without kowing well…