Pages:
Author

Topic: [Nxt] API of Nxt - page 14. (Read 37336 times)

legendary
Activity: 2142
Merit: 1010
Newbie
December 27, 2013, 10:56:03 AM
I keep getting {"errorCode":4,"errorDescription":"Incorrect \"timestamp\""}

When trying to use requestType=getAccountTransactionIds

on version 0.4.7e, i tried different timestamps 0, -1, real timestamp

nothing works

What exactly ur request is?
newbie
Activity: 24
Merit: 0
December 27, 2013, 10:52:32 AM
I keep getting {"errorCode":4,"errorDescription":"Incorrect \"timestamp\""}

When trying to use requestType=getAccountTransactionIds

on version 0.4.7e, i tried different timestamps 0, -1, real timestamp

nothing works
legendary
Activity: 2142
Merit: 1010
Newbie
December 27, 2013, 06:27:24 AM
Come-from-Beyond

GET-requests to remote peers does not work in version 0.4.7e.
Answer: "Not allowed".
The problem is - "allowedBotHosts" in web.xml & NRS code.

This temporarily or permanently?
I am developing a mobile client and it all seriously hampered. Sad

Are there any root hosts that accept such requests and will take them in the future?

U should ask community in main Nxt thread for list of hosts who allow access to API calls.
newbie
Activity: 35
Merit: 0
December 27, 2013, 06:25:20 AM
Come-from-Beyond

GET-requests to remote peers does not work in version 0.4.7e.
Answer: "Not allowed".
The problem is - "allowedBotHosts" in web.xml & NRS code.

This temporarily or permanently?
I am developing a mobile client and it all seriously hampered. Sad

Are there any root hosts that accept such requests and will take them in the future?
legendary
Activity: 2142
Merit: 1010
Newbie
December 26, 2013, 02:59:01 PM
How do I get on the right branch?

Delete *.nxt files and launch again.
sr. member
Activity: 295
Merit: 250
"to survive, we must live and fly"
sr. member
Activity: 295
Merit: 250
"to survive, we must live and fly"
December 26, 2013, 02:51:30 PM
legendary
Activity: 2142
Merit: 1010
Newbie
December 26, 2013, 02:50:10 PM
sr. member
Activity: 295
Merit: 250
"to survive, we must live and fly"
hero member
Activity: 597
Merit: 500
December 26, 2013, 07:01:18 AM
hello,
     I just made a statistic about all account's balance using API request. the total number is strange.
I start from the most recent block, and follow the 'previousBlock', go all the way down
until 'previousBlock'=None, and check transactions in each block, remember the 'sender'
and ' receipient'. then use getBalance api to get balance of each,and sumup all accounts's balance.
the number of accounts I got is 4205, which is the same as the output of getState.(when block height=25004)
but the total balance number is 18579288365!

I also find 2 accounts' balance is less than 0:
7577840883495855927 -999997985
15874940801139996458 -999997985
But I checked on http://87.230.14.1/nxt/nxt.cgi?action=10
these 2 accounts are ok.

did I make some mistakes, or is there a bug in the client/API?

hi nwecn,
you ar right, the blockexplorer is under constant attack to the node and also by automated query request.
the resulting database reorganization from this attacks de-sync's the db. therefore i wrote a note on top.
i am working to stop at least the query flooding as soon as possible. when done, it should be synced again.
full member
Activity: 143
Merit: 100
December 26, 2013, 06:44:40 AM
hello,
     I just made a statistic about all account's balance using API request. the total number is strange.
I start from the most recent block, and follow the 'previousBlock', go all the way down
until 'previousBlock'=None, and check transactions in each block, remember the 'sender'
and ' receipient'. then use getBalance api to get balance of each,and sumup all accounts's balance.
the number of accounts I got is 4205, which is the same as the output of getState.(when block height=25004)
but the total balance number is 18579288365!

I also find 2 accounts' balance is less than 0:
7577840883495855927 -999997985
15874940801139996458 -999997985
But I checked on http://87.230.14.1/nxt/nxt.cgi?action=10
these 2 accounts are ok.

did I make some mistakes, or is there a bug in the client/API?
sr. member
Activity: 295
Merit: 250
"to survive, we must live and fly"
December 26, 2013, 06:25:32 AM
great. now how can I tell if an address is a valid NXT address just from the address - no API calls?

Try http://localhost:7874/nxt?requestType=getAccountPublicKey&account=123

Cool. We are good to go, ready to provide exchange services for NXT.
legendary
Activity: 2142
Merit: 1010
Newbie
December 26, 2013, 06:09:01 AM
great. now how can I tell if an address is a valid NXT address just from the address - no API calls?

Try http://localhost:7874/nxt?requestType=getAccountPublicKey&account=123
sr. member
Activity: 295
Merit: 250
"to survive, we must live and fly"
December 26, 2013, 05:44:38 AM
NXT exchange launched!

https://peercover.com/#/simpleGateway

Please help us test!
sr. member
Activity: 295
Merit: 250
"to survive, we must live and fly"
December 26, 2013, 05:29:04 AM
great. now how can I tell if an address is a valid NXT address just from the address - no API calls?
legendary
Activity: 2142
Merit: 1010
Newbie
December 26, 2013, 05:16:53 AM
I have a NXT exchange built for you guys.

I have one missing link: generating NXT accounts from secrets.

I do curve25519hex(shaValue256(secretKey)) but this generates an alphanumerical hex, not a pure numerical account prevalent in NXT.

How do I generate accounts?

http://localhost:7874/nxt?requestType=getAccountId&secretPhrase=MYSECRET

Edit: U could also take first 8 bytes and convert into unsinged long using little-endian notation.
sr. member
Activity: 295
Merit: 250
"to survive, we must live and fly"
December 26, 2013, 05:15:03 AM
I have a NXT exchange built for you guys.

I have one missing link: generating NXT accounts from secrets.

I do curve25519hex(shaValue256(secretKey)) but this generates an alphanumerical hex, not a pure numerical account prevalent in NXT.

How do I generate accounts?
legendary
Activity: 2142
Merit: 1010
Newbie
December 26, 2013, 01:37:50 AM
Also, how do you create an account via API?

James

Account is created by the very 1st transaction.
legendary
Activity: 2142
Merit: 1010
Newbie
December 26, 2013, 01:37:19 AM
Sorry for the newbie question, how do i associate a secret with an account?

Is the account a SHA 256 of a SHA 256 of a secret? 

James

Secret is mapped to account id via Curve25519(SHA256(secret))
legendary
Activity: 1176
Merit: 1134
December 26, 2013, 01:18:12 AM
Also, how do you create an account via API?

James
Pages:
Jump to: