Pages:
Author

Topic: [ANN] [NFDv2] - NFD Coin - Thread locked - page 28. (Read 209470 times)

hero member
Activity: 575
Merit: 502
September 18, 2014, 04:57:31 AM
I have looked at the problem in more detail. There is no function to get an asset balance of an account. At least I didn't found one.

I think the API is
http://localhost:8876/nxt?requestType=getAccount&account=AccountID

the response contains the asset,followed balanceQNT.

I am now trying to make a web based asset holder listing.
use the java-script and API to
first get all accounts,
list all the account's asset balance.
and finally i can get the holder and balance list of a specific assets.

How do you get all accounts with the API?
I could write or modify a API call for this, if this is for you more handy.

With the debug trace approach you could  get a snapshot of shareholders for any time. This could be interesting if you like to distribute dividends to shareholders, who hold the coin to a certain time.
full member
Activity: 562
Merit: 100
September 18, 2014, 04:45:34 AM
I have looked at the problem in more detail. There is no function to get an asset balance of an account. At least I didn't found one.

I think the API is
http://localhost:8876/nxt?requestType=getAccount&account=AccountID

the response contains the asset,followed balanceQNT.

I am now trying to make a web based asset holder listing.
use the java-script and API to
first get all accounts,
list all the account's asset balance.
and finally i can get the holder and balance list of a specific assets.
full member
Activity: 189
Merit: 100
The future will be Digital
September 17, 2014, 10:12:10 PM
NFD Network Security Coin is great, thanks the Devs hard works
hero member
Activity: 575
Merit: 502
September 17, 2014, 06:13:43 PM
I have read some documents from NXT
I think i can use these APIs to get asset Holders

1. use getTrades&asset=ASSETID to get all trade happened of one asset
2. check all BidOrder by getTransaction&transaction=BidID to get all buyer IDs
by these i can get all asset holders if they do not transfer their assets
3.  check all the buyer's asset transaction by
getAccountTransactionIds&account=accountID&type=2subtype=1
And repeat step 2-3 untill  followed all the final asset transfer

another way is use
 getAccount&account=ACCOUNTID
if i can have a list of all account in the NFD net.
is there anyway to get all account? which might make things easy



I fear you will miss transferred assets.

The method Account.getAllAccounts() is only used by GetState.java to get status information. You would have to get all transactions to know all accounts.

Sometimes ago I wrote a RichList generator. It was only a fast hack but should be a good starting point to get all shareholders of an asset. It also uses Account.getAllAccounts() and loops through every single account.
http://woll-e.net/~matthias/RichList.java

I think the API should be completely rethought, without breaking old behavior. This should be coordinated with NXT developers.


I have looked at the problem in more detail. There is no function to get an asset balance of an account. At least I didn't found one.

One possibility exist. You could activate debug trace for all accounts.
Code:
nxt.debugTraceAccounts=*

You will get a big nfd-trace.csv with all transactions tab-separated.
Take row 1 2 3 4 6 from file.
Search for "asset balance" in second row.
You get a list with accounts, asset ids and the current asset balance.
Code:
height" "event" "account" "asset" "asset balance"
"86754" "asset balance" "4093015566329367683" "8537833860395844488" "9999494"
"86754" "asset balance" "13510103993148326478" "8537833860395844488" "54"
"86754" "asset balance" "4093015566329367683" "8537833860395844488" "9999493"
"86754" "asset balance" "7680600898101588699" "8537833860395844488" "1"
"86809" "asset balance" "970166099509975653" "8537833860395844488" "56"
"86809" "asset balance" "9286011010206951429" "8537833860395844488" "1"

Account 4093015566329367683 (network bounty account) has 2 entries. The entries have a chronological order. Only the last value of an account have the correct value.
There is also a row with timestamps. That makes it easy to get a list of shareholder for a current time.
legendary
Activity: 924
Merit: 1000
September 17, 2014, 12:03:04 PM
edit2:
Now asset transfer seems to work. Because of a mistake by me, all forgers of the last 214 blocks got an additional asset as bonus. Cheesy

And some people might think we don't care about our forgers. Grin
hero member
Activity: 575
Merit: 502
September 17, 2014, 02:34:55 AM
NFDFeeBot has been shut down. It is replaced by NFD NSC assets.

NFD NSC Asset Announce
Asset name: NSC
Issuer account: NFD-BM65-Z57M-LGNK-5HCMK
Asset Id:  8537833860395844488

Asset description:
NFD Network Security Coin (NFD NSC) is an asset designed to reward forgers who help secure NFD's network. NFD NSC is distributed weekly to every block generator. Each forger gets 1 NFD NSC for every forged block that has at least 1440 confirmations. You can sell your NFD NSC using the asset exchange, where NFD devs will place buy walls between 10 and 25 NFD. The higher the price, the more incentive to let run a forging NFD node. Everyone will be able to influence the price by buying and selling NFD NSC assets alongside the devs. If you want to help out the network, you can donate by buying NFD NSC at what you consider a fair price for the forgers. Rewarding of forged blocks will start with block height 85000. Please see also NFD thread https://bitcointalksearch.org/topic/ann-nfdv2-nfd-coin-thread-locked-603932

The NSCAssetTransfer tool will run daily or weekly.
An asset transfer has always an attached message. The content of the message is a semicolon separated list of blockids which were forged by receiver account.



first transfer was successful:

2014-09-17 09:27:17 INFO: In total 17 assets transferred to 9 different accounts.

The source code of asset transfer tool is available in nfdcoin git repository at bitbucket:
NSCAssetTransfer on bitbucket


edit:
Only 5 assets got finaly transferred. I will look at this issue tonight.

edit2:
Now asset transfer seems to work. Because of a mistake by me, all forgers of the last 214 blocks got an additional asset as bonus. Cheesy
newbie
Activity: 30
Merit: 0
September 16, 2014, 08:22:43 PM
NFDFeeBot has been shut down. It is replaced by NFD NSC assets.

NFD NSC Asset Announce
Asset name: NSC
Issuer account: NFD-BM65-Z57M-LGNK-5HCMK
Asset Id:  8537833860395844488

Asset description:
NFD Network Security Coin (NFD NSC) is an asset designed to reward forgers who help secure NFD's network. NFD NSC is distributed weekly to every block generator. Each forger gets 1 NFD NSC for every forged block that has at least 1440 confirmations. You can sell your NFD NSC using the asset exchange, where NFD devs will place buy walls between 10 and 25 NFD. The higher the price, the more incentive to let run a forging NFD node. Everyone will be able to influence the price by buying and selling NFD NSC assets alongside the devs. If you want to help out the network, you can donate by buying NFD NSC at what you consider a fair price for the forgers. Rewarding of forged blocks will start with block height 85000. Please see also NFD thread https://bitcointalksearch.org/topic/ann-nfdv2-nfd-coin-thread-locked-603932

The NSCAssetTransfer tool will run daily or weekly.
An asset transfer has always an attached message. The content of the message is a semicolon separated list of blockids which were forged by receiver account.



Very good, thanks a lot for  your hard work.
hero member
Activity: 575
Merit: 502
September 16, 2014, 07:36:51 PM
NFDFeeBot has been shut down. It is replaced by NFD NSC assets.

NFD NSC Asset Announce
Asset name: NSC
Issuer account: NFD-BM65-Z57M-LGNK-5HCMK
Asset Id:  8537833860395844488

Asset description:
NFD Network Security Coin (NFD NSC) is an asset designed to reward forgers who help secure NFD's network. NFD NSC is distributed weekly to every block generator. Each forger gets 1 NFD NSC for every forged block that has at least 1440 confirmations. You can sell your NFD NSC using the asset exchange, where NFD devs will place buy walls between 10 and 25 NFD. The higher the price, the more incentive to let run a forging NFD node. Everyone will be able to influence the price by buying and selling NFD NSC assets alongside the devs. If you want to help out the network, you can donate by buying NFD NSC at what you consider a fair price for the forgers. Rewarding of forged blocks will start with block height 85000. Please see also NFD thread https://bitcointalksearch.org/topic/ann-nfdv2-nfd-coin-thread-locked-603932

The NSCAssetTransfer tool will run daily or weekly.
An asset transfer has always an attached message. The content of the message is a semicolon separated list of blockids which were forged by receiver account.

legendary
Activity: 2413
Merit: 1003
September 16, 2014, 03:28:27 PM
wat ? No more 2 satoshis sell wall ?

 Cheesy

3 sats hahah....a mirical...now this will start to move

this has already happened many times! Nobody should sell under 10-15 satoshis!


well, 2 or 3 guys here sold a lot at 2 and bought a lot at 1 sats.....those who sold to them gave thier coins for free
hero member
Activity: 575
Merit: 502
September 16, 2014, 11:37:22 AM
I have read some documents from NXT
I think i can use these APIs to get asset Holders

1. use getTrades&asset=ASSETID to get all trade happened of one asset
2. check all BidOrder by getTransaction&transaction=BidID to get all buyer IDs
by these i can get all asset holders if they do not transfer their assets
3.  check all the buyer's asset transaction by
getAccountTransactionIds&account=accountID&type=2subtype=1
And repeat step 2-3 untill  followed all the final asset transfer

another way is use
 getAccount&account=ACCOUNTID
if i can have a list of all account in the NFD net.
is there anyway to get all account? which might make things easy



I fear you will miss transferred assets.

The method Account.getAllAccounts() is only used by GetState.java to get status information. You would have to get all transactions to know all accounts.

Sometimes ago I wrote a RichList generator. It was only a fast hack but should be a good starting point to get all shareholders of an asset. It also uses Account.getAllAccounts() and loops through every single account.
http://woll-e.net/~matthias/RichList.java

I think the API should be completely rethought, without breaking old behavior. This should be coordinated with NXT developers.
full member
Activity: 562
Merit: 100
September 16, 2014, 10:58:15 AM
The things followed will be chosen one workable and simple flow
and write some script to make things more automatic Smiley
full member
Activity: 562
Merit: 100
September 16, 2014, 10:54:23 AM
I have tried there APIs on NFD, each single API work fine on NFD.
 Smiley
full member
Activity: 562
Merit: 100
September 16, 2014, 10:53:36 AM
I have read some documents from NXT
I think i can use these APIs to get asset Holders

1. use getTrades&asset=ASSETID to get all trade happened of one asset
2. check all BidOrder by getTransaction&transaction=BidID to get all buyer IDs
by these i can get all asset holders if they do not transfer their assets
3.  check all the buyer's asset transaction by
getAccountTransactionIds&account=accountID&type=2subtype=1
And repeat step 2-3 untill  followed all the final asset transfer

another way is use
 getAccount&account=ACCOUNTID
if i can have a list of all account in the NFD net.
is there anyway to get all account? which might make things easy

legendary
Activity: 924
Merit: 1000
September 16, 2014, 08:34:47 AM
wat ? No more 2 satoshis sell wall ?

 Cheesy

3 sats hahah....a mirical...now this will start to move

Tell me about it! As for moving, I certainly hope so. Smiley
hero member
Activity: 840
Merit: 501
September 16, 2014, 06:31:22 AM
wat ? No more 2 satoshis sell wall ?

 Cheesy

3 sats hahah....a mirical...now this will start to move

this has already happened many times! Nobody should sell under 10-15 satoshis!
legendary
Activity: 2413
Merit: 1003
September 16, 2014, 06:01:58 AM
wat ? No more 2 satoshis sell wall ?

 Cheesy

3 sats hahah....a mirical...now this will start to move
legendary
Activity: 1526
Merit: 1012
September 16, 2014, 05:01:44 AM
wat ? No more 2 satoshis sell wall ?

 Cheesy
hero member
Activity: 575
Merit: 502
September 16, 2014, 03:08:54 AM
https://nxtblocks.info/
I think this  one is still working? Smiley

Oh yes, this is working!
full member
Activity: 562
Merit: 100
September 15, 2014, 11:06:07 AM
https://nxtblocks.info/
I think this  one is still working? Smiley
legendary
Activity: 952
Merit: 1000
Yeah! I hate ShroomsKit!
September 15, 2014, 10:55:01 AM
...
EDIT: He could also mean nxtblocks.info or http://nxtexplorer.com/

Both have no shareholder function.

Not to misunderstand me, I think we and NXT really need this function.
I will add it to my discovery TODO list.

The truth is on your side. I though you mean the asset list in general with all the stats.
Pages:
Jump to: