Bitcoin Forum
December 12, 2017, 02:21:50 PM *
News: Latest stable version of Bitcoin Core: 0.15.1  [Torrent].
 
   Home   Help Search Donate Login Register  
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 36801 times)
Vega
Hero Member
*****
Offline Offline

Activity: 732



View Profile
January 14, 2014, 01:36:59 AM
 #241

what are the Arbitrary Message API?

http://localhost:7874/nxt?requestType=sendMessage&secretPhrase=123&recipient=0&fee=1&deadline=1440&message=HEX_STRING

1513088510
Hero Member
*
Offline Offline

Posts: 1513088510

View Profile Personal Message (Offline)

Ignore
1513088510
Reply with quote  #2

1513088510
Report to moderator
1513088510
Hero Member
*
Offline Offline

Posts: 1513088510

View Profile Personal Message (Offline)

Ignore
1513088510
Reply with quote  #2

1513088510
Report to moderator
1513088510
Hero Member
*
Offline Offline

Posts: 1513088510

View Profile Personal Message (Offline)

Ignore
1513088510
Reply with quote  #2

1513088510
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1513088510
Hero Member
*
Offline Offline

Posts: 1513088510

View Profile Personal Message (Offline)

Ignore
1513088510
Reply with quote  #2

1513088510
Report to moderator
1513088510
Hero Member
*
Offline Offline

Posts: 1513088510

View Profile Personal Message (Offline)

Ignore
1513088510
Reply with quote  #2

1513088510
Report to moderator
1513088510
Hero Member
*
Offline Offline

Posts: 1513088510

View Profile Personal Message (Offline)

Ignore
1513088510
Reply with quote  #2

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

Activity: 1792

Newbie


View Profile
January 14, 2014, 06:27:11 AM
 #242

We have made a bunch of transactions that have received the transactionbytes. Deadline 7200 minutes, not even near of expiring, yet somehow these transactions are not pushed through even when others are. They receive the same transaction id and transactionbytes every time for days but do not go through. We are wary of resending them before deadline instead of rebroadcasting for the fear of double spending. Any ideas?

Send me one of these transaction bytes, I'll check what is wrong.
rriky92
Sr. Member
****
Offline Offline

Activity: 294



View Profile WWW
January 14, 2014, 01:58:28 PM
 #243

{"errorCode":7,"errorDescription":"Not allowed"}

But i can access the local client from browser
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 1792

Newbie


View Profile
January 14, 2014, 02:07:31 PM
 #244

{"errorCode":7,"errorDescription":"Not allowed"}

But i can access the local client from browser

Put * into allowedBotHosts.
GCInc.
Hero Member
*****
Offline Offline

Activity: 566


View Profile WWW
January 14, 2014, 05:54:38 PM
 #245

Sending you one through PM for txid: 17352005608016332505

Is it safe to use transactionbytes publicly?

We have made a bunch of transactions that have received the transactionbytes. Deadline 7200 minutes, not even near of expiring, yet somehow these transactions are not pushed through even when others are. They receive the same transaction id and transactionbytes every time for days but do not go through. We are wary of resending them before deadline instead of rebroadcasting for the fear of double spending. Any ideas?

Send me one of these transaction bytes, I'll check what is wrong.

marcus03
Full Member
***
Offline Offline

Activity: 224


View Profile
January 14, 2014, 06:02:18 PM
 #246

Sending you one through PM for txid: 17352005608016332505

Is it safe to use transactionbytes publicly?

http://localhost:7874/nxt?requestType=getTransactionBytes&transaction=17352005608016332505

Yes. ;-)
hiksush2
Newbie
*
Offline Offline

Activity: 12


View Profile
January 14, 2014, 06:35:29 PM
 #247

Is there a way to get a list of all the accounts?

Thanks!

Yes, this can be done via blockchain scanning. Smiley

Let me know if u need a special API call for that.

I'd definitely like an API call that would return all accounts.  For blockchain scanning, what is the process to get all accounts?  A quick look at blocks.nxt (12MB) shows only ~300 unique generatorPublicKey's, and transactions.nxt (also 12MB) has about ~3500 unique accounts.  The blockchain explorer says "Accounts: 13919" and lists lots of new accounts being added though.

Get a unique list of the recipients of all transactions of all blocks.

That's what I figured, but a quick check shows only ~7000 unique recipients in transactions.nxt vs. 14,000 accounts in the blockchain explorer:

Code:
$ java -jar jdeserialize-1.2.jar nxt/transactions.nxt | grep -E "recipient: [0-9-]+" | awk '{ print $2 }' | sort | uniq | wc -l
7105
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 1792

Newbie


View Profile
January 14, 2014, 06:41:34 PM
 #248

That's what I figured, but a quick check shows only ~7000 unique recipients in transactions.nxt vs. 14,000 accounts in the blockchain explorer:

Code:
$ java -jar jdeserialize-1.2.jar nxt/transactions.nxt | grep -E "recipient: [0-9-]+" | awk '{ print $2 }' | sort | uniq | wc -l
7105

R recipients with negative value included?
hiksush2
Newbie
*
Offline Offline

Activity: 12


View Profile
January 14, 2014, 09:17:50 PM
 #249

That's what I figured, but a quick check shows only ~7000 unique recipients in transactions.nxt vs. 14,000 accounts in the blockchain explorer:

Code:
$ java -jar jdeserialize-1.2.jar nxt/transactions.nxt | grep -E "recipient: [0-9-]+" | awk '{ print $2 }' | sort | uniq | wc -l
7105

R recipients with negative value included?

Yes, "recipient: [0-9-]+" matches all lines containing "recipient" except for the first one (structure definition).
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 1792

Newbie


View Profile
January 14, 2014, 09:39:46 PM
 #250

Yes, "recipient: [0-9-]+" matches all lines containing "recipient" except for the first one (structure definition).

No idea, looks like it doesn't count recipients with "-" sign.
^[GS]^
Member
**
Offline Offline

Activity: 98


View Profile
January 14, 2014, 11:05:49 PM
 #251

I think it is necessary to use the same mode of representing the amounts in API's.

I personally think the right should be getBalance():

URL: http://localhost:7874/nxt?requestType=getBalance&account=9415965710853847055
RETURN: {"balance":217500,"effectiveBalance":217500,"unconfirmedBalance":217500}

217500 / 100 = 2175.00 NXT   All right!

However when we see a transaction with GetTransaction().

URL: http://localhost:7874/nxt?requestType=getTransaction&transaction=7613663286249813916
RETURN: {"sender":"16999902190493953875","fee":1,"amount":1,"timestamp":3150358,"referencedTransaction":"0","confirmations":12580,"subtype":0,
"block":"2365176096112318374", "senderPublicKey":"66538....77a579","type":0,"deadline":1000,
"signature":"e9619.....937639","recipient":"9415965710853847055"}

It this is wrong! should return:

RETURN: {"sender":"16999902190493953875","fee":100,"amount":100,"timestamp":3150358,"referencedTransaction":"0","confirmations":12580,"subtype":0,
"block":"2365176096112318374", "senderPublicKey":"66538....77a579","type":0,"deadline":1000,
"signature":"e9619.....937639","recipient":"9415965710853847055"}

I hope they correct, and then we could soon be able to use decimals!

This problem occurs also in...

* sendMoney() = URL http://localhost:7874/nxt?requestType=sendMoney&secretPhrase=IWontTellYou&recipient=398532577100249608&amount=1500&fee=1&deadline=900&referencedTransaction=...

* getBlock() = RETURN {"transactions":["14664591317056179258"],"blockSignature":"8e679e....5b5333","payloadLength":189,"numberOfTransactions":1,"version":1,
"timestamp":3196925,"previousBlock":"11012395561676092121","payloadHash":"3a4c.....a1e55b","height":29207,"totalFee":1,
"baseTarget":"490243708","generationSignature":"d5fc85......2e08","totalAmount":0,"generator":"4071545868996394636"}

* assignAlias() = URL http://localhost:7874/nxt?requestType=assignAlias&secretPhrase=hola&alias=hola&uri=&fee=1&deadline=1000

* sendMessage() = URL http://localhost:7874/nxt?requestType=sendMessage&secretPhrase=123&recipient=398532577100249608&fee=1&deadline=1440&message=b8a7a5...h381a3
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 1792

Newbie


View Profile
January 15, 2014, 06:31:55 AM
 #252

Good idea. We can't change existing API calls, but next API will follow ur proposal.
marcus03
Full Member
***
Offline Offline

Activity: 224


View Profile
January 15, 2014, 01:29:23 PM
 #253

There is nothing in the core that prevents me sending NXT or messages from one sender address to the same recipient address.

Is it ok, if I make use of this? Or will this be forbidden in the future?
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 1792

Newbie


View Profile
January 15, 2014, 02:14:03 PM
 #254

There is nothing in the core that prevents me sending NXT or messages from one sender address to the same recipient address.

Is it ok, if I make use of this? Or will this be forbidden in the future?

It's ok.
marcus03
Full Member
***
Offline Offline

Activity: 224


View Profile
January 15, 2014, 02:22:36 PM
 #255

It would be cool if getBalance would accept a timestamp parameter so that you could get an account balance at a certain point in time.
rigel
Legendary
*
Offline Offline

Activity: 1124


Thank God I'm an atheist


View Profile
January 16, 2014, 10:47:30 AM
 #256

When Nxt price will skyrocket we'll have to change the APIs to allow fee expressed in Nxt-cents or transactions will cost too much.

I think it's easier make now such an incompatible change than later when there will be a larger userbase...

It might be useful add more decimals than just 2.
ferment
Full Member
***
Offline Offline

Activity: 168


IDEX - LIVE Real-time DEX


View Profile
January 16, 2014, 01:22:04 PM
 #257

It would be cool if getBalance would accept a timestamp parameter so that you could get an account balance at a certain point in time.

You can do it with getAccountTransactionIds and getAccountBlockIds with a timestamp.

Come-from-Beyond
Legendary
*
Offline Offline

Activity: 1792

Newbie


View Profile
January 16, 2014, 01:29:33 PM
 #258

It would be cool if getBalance would accept a timestamp parameter so that you could get an account balance at a certain point in time.

You can do it with getAccountTransactionIds and getAccountBlockIds with a timestamp.

Also getGuaranteedBalance could be used.
marcus03
Full Member
***
Offline Offline

Activity: 224


View Profile
January 16, 2014, 02:13:22 PM
 #259

It would be cool if getBalance would accept a timestamp parameter so that you could get an account balance at a certain point in time.

You can do it with getAccountTransactionIds and getAccountBlockIds with a timestamp.

Thanks, that'll work. Not handy, but ok.
l8orre
Legendary
*
Offline Offline

Activity: 928


View Profile
January 18, 2014, 11:53:48 AM
 #260

 
NRS question -

maybe someone who knows (probably one of the core edevelopers) can give me a liitle hint here in respect to the blockchain operations:

as I understand the blockchain is an implementain of a Merkle tree, as is with Bitcoin.
Am I right with the assumption that the blockchain of NXT works in a similar manner as the blockchain of Bitcoin (hence the quick appearance of NXT blockchain explorers, etc),
and that the significant difference between NXT and bitcoin lies in the crypto (curve25519, incl PoS & transparent forging) BEHIND the blockchain?

So that if I want to get a grip on the internals of NXT, I could start out by getting a grip on the blockchain operations, which I could do by consulting Bitcoin blockchain documentation?  Grin

Cheers,
l8orre

[ or is there a special thread for this that I may have missed?    Huh posted this to the general thread, but it seems to be getting lost a bit there..]
   
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:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!