Bitcoin Forum
April 26, 2024, 02:49:54 AM *
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 37217 times)
Snard
Full Member
***
Offline Offline

Activity: 140
Merit: 100


View Profile
November 28, 2013, 08:33:08 PM
 #21

If we wanted to walk through the blocks, what is the genesis block for Nxt?
1714099794
Hero Member
*
Offline Offline

Posts: 1714099794

View Profile Personal Message (Offline)

Ignore
1714099794
Reply with quote  #2

1714099794
Report to moderator
1714099794
Hero Member
*
Offline Offline

Posts: 1714099794

View Profile Personal Message (Offline)

Ignore
1714099794
Reply with quote  #2

1714099794
Report to moderator
1714099794
Hero Member
*
Offline Offline

Posts: 1714099794

View Profile Personal Message (Offline)

Ignore
1714099794
Reply with quote  #2

1714099794
Report to moderator
"The nature of Bitcoin is such that once version 0.1 was released, the core design was set in stone for the rest of its lifetime." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714099794
Hero Member
*
Offline Offline

Posts: 1714099794

View Profile Personal Message (Offline)

Ignore
1714099794
Reply with quote  #2

1714099794
Report to moderator
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

Newbie


View Profile
November 28, 2013, 08:45:44 PM
 #22

If we wanted to walk through the blocks, what is the genesis block for Nxt?

2680262203532249785
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

Newbie


View Profile
November 30, 2013, 10:31:25 AM
 #23

List of error codes:

1 - Incorrect request
2 - Blockchain not up to date
3 - Parameter not specified
4 - Incorrect parameter
5 - Unknown object (block, transaction, etc.)
6 - Not enough funds

This is complete list for version <= 0.2.17
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

Newbie


View Profile
November 30, 2013, 03:57:53 PM
 #24

I have just noticed that getBlock request returns "previousBlock". No longer required to scan the blockchain from Genesis block, descending approach should work better!
GCInc.
Hero Member
*****
Offline Offline

Activity: 566
Merit: 500


View Profile WWW
December 04, 2013, 09:56:48 PM
 #25

What are we doing wrong with the API?

http://111.111.111.111:7876/?request=sendMoney&secretPhrase=masked&recipient=12345678901234567890&amount=12&fee=1&deadline=900

Result is:

{"errorCode":1,"errorDescription":"Incorrect request"}

Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

Newbie


View Profile
December 04, 2013, 10:04:38 PM
 #26

What are we doing wrong with the API?

http://111.111.111.111:7876/?request=sendMoney&secretPhrase=masked&recipient=12345678901234567890&amount=12&fee=1&deadline=900

Result is:

{"errorCode":1,"errorDescription":"Incorrect request"}

Disabled coz I was rewriting networking part. A new version will be released in an hour. Some minor changes in API.

Edit: sendMoney and broadcastTransaction will be disabled though, we need more testing on this requests. A version that supports them is planned to be released within 24 hours.
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

Newbie


View Profile
December 04, 2013, 10:33:56 PM
 #27

Changes in API

URL changed from localhost:7876/?request=XXX to localhost:7874/nxt?requestType=XXX

API can be accessed via HTTPS if port 7875 used.

Added http://localhost:7874/nxt?requestType=getMyInfo request, "host" can be used to set "allowedBotHosts" parameter in web.xml
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

Newbie


View Profile
December 05, 2013, 12:14:52 PM
 #28

sendMoney API request enabled in 0.3.11.
GCInc.
Hero Member
*****
Offline Offline

Activity: 566
Merit: 500


View Profile WWW
December 05, 2013, 08:05:03 PM
 #29

Very good!

But we have to be careful; sendMoney gives valid-looking txid even if the transaction was spitted out and not sent to the blockchain. Any way to fix that?

Happily the client does not show the spitted tx.

{"transaction":"10170673123314889622"}


The client has a malfunction in that it does not show all the sendMoney transactions until much later. It does show some. Additional hazard is that even the blockchain explorer does not show the properly sent & accepted transactions until later. This has the potential to cause some serious mess.

Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

Newbie


View Profile
December 05, 2013, 08:08:24 PM
 #30

But we have to be careful; sendMoney gives valid-looking txid even if the transaction was spitted out and not sent to the blockchain. Any way to fix that?

Use 5 minute deadline and resend a transaction if it's not confirmed. It's impossible to make sure that nodes didn't receive a transaction and if they r going to include it into a block.
nelisky
Legendary
*
Offline Offline

Activity: 1540
Merit: 1001


View Profile
December 07, 2013, 06:31:42 PM
 #31

API method request: a way to get a list of transactions pending inclusion in blocks (a la bitcoind getmemorypool).
nelisky
Legendary
*
Offline Offline

Activity: 1540
Merit: 1001


View Profile
December 07, 2013, 07:00:08 PM
 #32

API method request:

- create unsigned transaction, to be signed elsewhere (similar to sendmoney without passphrase and returning the raw unsigned transaction?)
- sign transaction, accepting a raw unsigned transaction, returning a raw signed transaction
- broadcast transactions, accepting a raw signed transaction
omo
Full Member
***
Offline Offline

Activity: 147
Merit: 100


View Profile
December 08, 2013, 03:34:38 AM
 #33

How would I have an account unlocked automatically when Nxt starts (or soon after)?

I have Nxt running in a server and wish to unlock the account after reboot because I was told that the account needs to be unlocked to generate POS.

Thanks!

Try to use this dirty hack:

http://localhost:7875/?user=0.7657349163200706&request=unlockAccount&secretPhrase=MySecret

Value of "user" must be any random number. This is the way the client unlocks accounts. Ignore a response.

Is there a way to check if an account is unlocked?
if I use wget to send the unlock request, how long will it stay unlocked?

BTC:1Fu4TNpVPToxxhSXBNSvE9fz6X3dbYgB8q
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

Newbie


View Profile
December 08, 2013, 07:12:16 AM
 #34

Is there a way to check if an account is unlocked?

No.


if I use wget to send the unlock request, how long will it stay unlocked?

Until u send "lock" request.
nelisky
Legendary
*
Offline Offline

Activity: 1540
Merit: 1001


View Profile
December 08, 2013, 08:31:25 PM
 #35

Is there already a way to retrieve the last block without knowing its id?
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

Newbie


View Profile
December 08, 2013, 08:46:37 PM
 #36

Is there already a way to retrieve the last block without knowing its id?

http://localhost:7874/nxt?requestType=getState

Look at "lastBlock" value.
omo
Full Member
***
Offline Offline

Activity: 147
Merit: 100


View Profile
December 09, 2013, 12:55:14 AM
 #37

Is there a way to check if an account is unlocked?

No.


if I use wget to send the unlock request, how long will it stay unlocked?

Until u send "lock" request.

so, how does the network know if an account is online?
I understand that starting a nxt client and opening my account in a web browser(online) will have a chance to earn the transaction fees.
Am I confused about UNLOCK and ONLINE?
If I unlock my account and quit the browser(without locking my account), do I have the chance to get trasaction fees?
If I stop the nxt client further, do I have the chance to get transaction fees?

BTC:1Fu4TNpVPToxxhSXBNSvE9fz6X3dbYgB8q
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

Newbie


View Profile
December 09, 2013, 07:23:13 AM
 #38

so, how does the network know if an account is online?
I understand that starting a nxt client and opening my account in a web browser(online) will have a chance to earn the transaction fees.
Am I confused about UNLOCK and ONLINE?
If I unlock my account and quit the browser(without locking my account), do I have the chance to get trasaction fees?
If I stop the nxt client further, do I have the chance to get transaction fees?

Network doesn't know if an account online. U unlock an account to let the soft know ur private key.
U can close browser without locking and u will be mining until u restart the client software.
omo
Full Member
***
Offline Offline

Activity: 147
Merit: 100


View Profile
December 10, 2013, 03:14:06 AM
 #39

Is there some changes about the UNLOCK request in 0.3.16 client?
I use a python script to unlock constantly,
when I restart the client, I got an error:
{u'responses': [{u'message': u'java.lang.NullPointerException', u'response': u'showMessage'}]}

I have to clean the whole nxt directory and restart th client to make the unlock script work again
I was using 0.3.14 and no such problem.

I like 0.3.16 that the numberOfAccounts shows the online accounts, right?

BTC:1Fu4TNpVPToxxhSXBNSvE9fz6X3dbYgB8q
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

Newbie


View Profile
December 10, 2013, 07:12:01 AM
 #40

Is there some changes about the UNLOCK request in 0.3.16 client?
I use a python script to unlock constantly,
when I restart the client, I got an error:
{u'responses': [{u'message': u'java.lang.NullPointerException', u'response': u'showMessage'}]}

I have to clean the whole nxt directory and restart th client to make the unlock script work again
I was using 0.3.14 and no such problem.

I like 0.3.16 that the numberOfAccounts shows the online accounts, right?

java.lang.NullPointerException is caused by corrupted files.

numberOfAccounts is number of all accounts.
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!