Bitcoin Forum
May 10, 2024, 11:32:01 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 3 4 5 6 [7] 8 9 10 11 12 13 14 15 16 17 18 19 20 »  All
  Print  
Author Topic: [Nxt] API of Nxt  (Read 37224 times)
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

Newbie


View Profile
December 26, 2013, 10:16:53 AM
 #121

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.
It is a common myth that Bitcoin is ruled by a majority of miners. This is not true. Bitcoin miners "vote" on the ordering of transactions, but that's all they do. They can't vote to change the network rules.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715383921
Hero Member
*
Offline Offline

Posts: 1715383921

View Profile Personal Message (Offline)

Ignore
1715383921
Reply with quote  #2

1715383921
Report to moderator
datz
Sr. Member
****
Offline Offline

Activity: 295
Merit: 250


"to survive, we must live and fly"


View Profile
December 26, 2013, 10:29:04 AM
 #122

great. now how can I tell if an address is a valid NXT address just from the address - no API calls?
datz
Sr. Member
****
Offline Offline

Activity: 295
Merit: 250


"to survive, we must live and fly"


View Profile
December 26, 2013, 10:44:38 AM
 #123

NXT exchange launched!

https://peercover.com/#/simpleGateway

Please help us test!
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

Newbie


View Profile
December 26, 2013, 11:09:01 AM
 #124

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
datz
Sr. Member
****
Offline Offline

Activity: 295
Merit: 250


"to survive, we must live and fly"


View Profile
December 26, 2013, 11:25:32 AM
 #125

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.
newcn
Full Member
***
Offline Offline

Activity: 143
Merit: 100


View Profile
December 26, 2013, 11:44:40 AM
 #126

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?

BTC:1NzzfeHCgN8fF6mSG1UeBFCVd2cxKbGyHk
NXT:13187911577562526278
nexern
Hero Member
*****
Offline Offline

Activity: 597
Merit: 500



View Profile
December 26, 2013, 12:01:18 PM
 #127

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.
datz
Sr. Member
****
Offline Offline

Activity: 295
Merit: 250


"to survive, we must live and fly"


View Profile
December 26, 2013, 07:48:37 PM
 #128

For:

http://localhost:7874/nxt?requestType=getAccountTransactionIds&account=14862723975094572194&timestamp=0

I get {"errorCode":5,"errorDescription":"Unknown account"}

Why?

http://87.230.14.1/nxt/nxt.cgi?action=3000&acc=14862723975094572194

Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

Newbie


View Profile
December 26, 2013, 07:50:10 PM
 #129


U r on a wrong branch. I see {"transactionIds":["15609747835883025669"]}
datz
Sr. Member
****
Offline Offline

Activity: 295
Merit: 250


"to survive, we must live and fly"


View Profile
December 26, 2013, 07:51:30 PM
 #130


How do I get on the right branch?
datz
Sr. Member
****
Offline Offline

Activity: 295
Merit: 250


"to survive, we must live and fly"


View Profile
December 26, 2013, 07:53:41 PM
 #131

I setup from: http://nxtcrypto.wikia.com/wiki/How-To:InstallNRSLinux
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

Newbie


View Profile
December 26, 2013, 07:59:01 PM
 #132

How do I get on the right branch?

Delete *.nxt files and launch again.
lr127
Newbie
*
Offline Offline

Activity: 35
Merit: 0


View Profile
December 27, 2013, 11:25:20 AM
 #133

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?
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

Newbie


View Profile
December 27, 2013, 11:27:24 AM
 #134

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.
Lubliana
Newbie
*
Offline Offline

Activity: 24
Merit: 0


View Profile
December 27, 2013, 03:52:32 PM
 #135

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
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

Newbie


View Profile
December 27, 2013, 03:56:03 PM
 #136

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?
Lubliana
Newbie
*
Offline Offline

Activity: 24
Merit: 0


View Profile
December 27, 2013, 04:22:28 PM
 #137

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?

For example:

http://localhost:7874/nxt?requestType=getAccountTransactionIds&account=6483973064837388393&timestamp=0

This works for me in an earlier version, but not in 0.4.7e

Did you change anything?


Thanks
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

Newbie


View Profile
December 27, 2013, 04:41:30 PM
 #138

Did you change anything?

No.

And it works:
Code:
{"transactionIds":["16327828505285932473","7776315672991437607","7478358102654400317","9038949217488707578","5107797978721572291","3056041568658981150","13938595992812911398","5860553720038071526","14088864536744330557","98233104059687517","3708542302478143606","11723261810965383682","8480031398450915391","4637952893059799971","4278983739975323329","11578788549066895383","17355434458110030026","15327384437462965022","11518685970067256485","6225568623338018976","5358668617356551382","7334304928632209196","11321968978650279956","14554751727556954823","96427141454859614"]}

Rename *.bak files to *.nxt, maybe ur copy of blockchain is inconsistent.
ferment
Full Member
***
Offline Offline

Activity: 168
Merit: 100


IDEX - LIVE Real-time DEX


View Profile
December 27, 2013, 07:00:13 PM
 #139


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.

These are open for User and Bot.

node1.nxtbase.com; node11.nxtbase.com; node21.nxtbase.com; node31.nxtbase.com; node41.nxtbase.com; node51.nxtbase.com; node61.nxtbase.com; node71.nxtbase.com; node81.nxtbase.com; node91.nxtbase.com;

Lubliana
Newbie
*
Offline Offline

Activity: 24
Merit: 0


View Profile
December 27, 2013, 09:29:55 PM
 #140

Did you change anything?

No.

And it works:
Code:
{"transactionIds":["16327828505285932473","7776315672991437607","7478358102654400317","9038949217488707578","5107797978721572291","3056041568658981150","13938595992812911398","5860553720038071526","14088864536744330557","98233104059687517","3708542302478143606","11723261810965383682","8480031398450915391","4637952893059799971","4278983739975323329","11578788549066895383","17355434458110030026","15327384437462965022","11518685970067256485","6225568623338018976","5358668617356551382","7334304928632209196","11321968978650279956","14554751727556954823","96427141454859614"]}

Rename *.bak files to *.nxt, maybe ur copy of blockchain is inconsistent.

You were right, the blockchain was corrupt.

Version 0.4.7e is really stable, good job
Pages: « 1 2 3 4 5 6 [7] 8 9 10 11 12 13 14 15 16 17 18 19 20 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!