peterpanda
|
|
September 16, 2014, 03:58:15 PM |
|
The things followed will be chosen one workable and simple flow and write some script to make things more automatic
|
|
|
|
MaWo (OP)
|
|
September 16, 2014, 04:37:22 PM Last edit: September 16, 2014, 04:49:34 PM by MaWo |
|
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.javaI think the API should be completely rethought, without breaking old behavior. This should be coordinated with NXT developers.
|
|
|
|
capoeira
Legendary
Offline
Activity: 2413
Merit: 1003
|
|
September 16, 2014, 08:28:27 PM |
|
wat ? No more 2 satoshis sell wall ? 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
|
|
|
|
MaWo (OP)
|
|
September 17, 2014, 12:36:51 AM |
|
NFDFeeBot has been shut down. It is replaced by NFD NSC assets. NFD NSC Asset AnnounceAsset 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://bitcointalk.org/index.php?topic=603932The 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.
|
|
|
|
armcoin
Newbie
Offline
Activity: 30
Merit: 0
|
|
September 17, 2014, 01:22:43 AM |
|
NFDFeeBot has been shut down. It is replaced by NFD NSC assets. NFD NSC Asset AnnounceAsset 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://bitcointalk.org/index.php?topic=603932The 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.
|
|
|
|
MaWo (OP)
|
|
September 17, 2014, 07:34:55 AM Last edit: September 18, 2014, 07:24:17 AM by MaWo |
|
NFDFeeBot has been shut down. It is replaced by NFD NSC assets. NFD NSC Asset AnnounceAsset 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://bitcointalk.org/index.php?topic=603932The 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 bitbucketedit: 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.
|
|
|
|
Nxtblg
Legendary
Offline
Activity: 924
Merit: 1000
|
|
September 17, 2014, 05: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. And some people might think we don't care about our forgers.
|
|
|
|
MaWo (OP)
|
|
September 17, 2014, 11:13:43 PM Last edit: September 18, 2014, 12:02:48 AM by MaWo |
|
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.javaI 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. 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. 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.
|
|
|
|
jackychan
Full Member
Offline
Activity: 189
Merit: 100
The future will be Digital
|
|
September 18, 2014, 03:12:10 AM |
|
NFD Network Security Coin is great, thanks the Devs hard works
|
|
|
|
peterpanda
|
|
September 18, 2014, 09: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=AccountIDthe 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.
|
|
|
|
MaWo (OP)
|
|
September 18, 2014, 09: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=AccountIDthe 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.
|
|
|
|
peterpanda
|
|
September 18, 2014, 10:10:55 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=AccountIDthe 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. I have never do a java code, so i do not know how to access the nxt.debugtrace. I have writing some html and java-script things, so what i am much familiar with the api provided. I can search all blocks, and search all transaction, then i can get all accounts that at least have one transaction. this is what i planed to do, it might be slow as the blocks becomes bigger. the other problem is use this methods, i can only find the asset distribution situation when the search happened. however this is tolerable if i just want to distribute dividend
|
|
|
|
MaWo (OP)
|
|
September 18, 2014, 10:40:13 AM Last edit: September 18, 2014, 11:04:32 AM by MaWo |
|
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=AccountIDthe 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. I have never do a java code, so i do not know how to access the nxt.debugtrace. I have writing some html and java-script things, so what i am much familiar with the api provided. I can search all blocks, and search all transaction, then i can get all accounts that at least have one transaction. this is what i planed to do, it might be slow as the blocks becomes bigger. the other problem is use this methods, i can only find the asset distribution situation when the search happened. however this is tolerable if i just want to distribute dividend Recently there was a commit on bitbucket. Somebody added a new API call getAllAccounts. Testnet: http://woll-e.net:9876/nxt?requestType=getAllAccounts
|
|
|
|
peterpanda
|
|
September 18, 2014, 11:05:49 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=AccountIDthe 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. I have never do a java code, so i do not know how to access the nxt.debugtrace. I have writing some html and java-script things, so what i am much familiar with the api provided. I can search all blocks, and search all transaction, then i can get all accounts that at least have one transaction. this is what i planed to do, it might be slow as the blocks becomes bigger. the other problem is use this methods, i can only find the asset distribution situation when the search happened. however this is tolerable if i just want to distribute dividend Recently there was a commit on bitbucket. Somebody added a new API call getAllAccounts. Testnet: http://woll-e.net:9876/nxt?requestType=getAllAccountsOh, Thank you, will these API been added on next release?
|
|
|
|
MaWo (OP)
|
|
September 18, 2014, 11:11:29 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=AccountIDthe 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. I have never do a java code, so i do not know how to access the nxt.debugtrace. I have writing some html and java-script things, so what i am much familiar with the api provided. I can search all blocks, and search all transaction, then i can get all accounts that at least have one transaction. this is what i planed to do, it might be slow as the blocks becomes bigger. the other problem is use this methods, i can only find the asset distribution situation when the search happened. however this is tolerable if i just want to distribute dividend Recently there was a commit on bitbucket. Somebody added a new API call getAllAccounts. Testnet: http://woll-e.net:9876/nxt?requestType=getAllAccountsOh, Thank you, will these API been added on next release? Yes it will.
|
|
|
|
l8orre
Legendary
Offline
Activity: 1181
Merit: 1018
|
|
September 18, 2014, 12:28:43 PM |
|
Is this NFD specific or is it also in NXT?
|
|
|
|
MaWo (OP)
|
|
September 18, 2014, 12:32:10 PM |
|
Is this NFD specific or is it also in NXT? It's NFD specific.
|
|
|
|
l8orre
Legendary
Offline
Activity: 1181
Merit: 1018
|
|
September 18, 2014, 02:34:07 PM |
|
ah good - I had only just seen it and was afraid I had missed something on the NXT api side!
|
|
|
|
MaWo (OP)
|
|
September 18, 2014, 04:15:40 PM |
|
Still needs someone other API calls?
|
|
|
|
Continental
Newbie
Offline
Activity: 24
Merit: 0
|
|
September 18, 2014, 05:56:13 PM |
|
NFD Network Security Coin is great, thanks the Devs hard works
What is NFD Network Security Coin?
|
|
|
|
|