-
Notifications
You must be signed in to change notification settings - Fork 1
Receiver files
Receiver.h accesses a synchronized list of receivers.
For example, say the devcoin client requests the height 9000 receivers, the height step is 4000 and only the root receiver_0.csv saved. Receiver.h will first look for the receiver_2.csv file. Since it's not there it will step down and look for receiver_1.csv. Still not there so it looks for and finds receiver_0.csv. It then downloads receiver_1.csv by looking at the peers in receiver_0.csv and saves in the data directory. It then downloads receiver_2.csv by looking at the peers in receiver_1.csv and saves in the data directory. Once it has receiver_2.csv, it parses it to get the list of receivers and uses height modulo list length to return the receivers for height 9000.
Receiver also looks ahead, after it is a random portion between 0.75 and roughly 0.95 of the way to the next step so that there is no mass downloading when the block height switches from x999 to x000. To resist ddos attacks and to work even when some web sites are down, it picks the page which the majority of peers have available. The step size of 4000 gives an update roughly each month.
The generation share is 90% of the block, which is 90% * 50,000 devcoins = 45,000 devcoins. It is disbursed to the devcoin addresses in the receiver file, in round robin order. In each generation round, for a given block height, the index of the line of addresses is the block height above the start of the round, modulo the number of addresses. The code snippet for that follows below.
vector<string> getCoinAddressStrings(const string& dataDirectory, const string& fileName, int height, int step)
{
..
int remainder = height - step * (height / step);
int modulo = remainder % (int)coinLists.size();
vector<string> originalList = coinLists[modulo];
for (vector<string>::iterator tokenIterator = originalList.begin(); tokenIterator != originalList.end(); tokenIterator++)
{
if (*tokenIterator != string("="))
oldToken = tokenIterator->substr();
coinList.push_back(oldToken);
}
return coinList;
}
Then in CreateBlock, the share per address is calculated by dividing the generation share by the number of coin addresses in the line of addresses. A subtransaction to create share per address coin value is then added for each coin address to the generation transaction. The transactions from generation can be seen by looking at a Devcoin Block Explorer.
To view your own disbursements, the easiest way is to download the devcoin-qt client. In that client you'll see payments from generation.
If you can not install that on your system, then you can look for disbursements in a devcoin block explorer. For example, to find the payouts to the devcoin address 17vec4jQGCzMEsTnivizHPaowE715tu2CB in the round 16 receiver file. Counting from zero in the receiver file, the address is at line 22. Round 16 starts on block 16 * 4,000 = 64,000. You'll see the generation share in block 64,022 in a block explorer. In Icoin's block explorer, you can go the 64,022 block, and see the payment for 45,000 devcoins in the generation row of that block. Since there are 47 receiver lines in round 16, another payment to that address will be in block 64,069. Other payments to that address will be in block 64,116, block 64,163, etc.. Round 16 lasts until block 67,999.
To generate a file, download the github accounting repository. Then generate the devtome earnings file, then the marketing earnings file (which requires devtome earnings), then the receiver file (which requires devtome earnings and marketing earnings).
To generate files for round 23, starting with the devtome earnings, in that folder open a terminal and type:
python devtome.py -round 23
Generating the marketing file requires the devtome earnings file, the command is:
python marketing.py -round 23
Generating the receiver file requires the locations in the account_location.csv file, which currently has:
Bitcoin Share List,bitcoinshare.html
Bounty,bounty_xx.csv
Devcoin Share List,devcoinshare.html
Devtome Earnings,devtome_earnings_xx.csv
Marketing Earnings,marketing_earnings_xx.csv
For example, in round 23 those files are the list of bitcoin developers, round 23 bounty file, list of non bitcoin developers, round 23 devtome earnings file, and round 23 marketing earnings file.
Once all those files are in the folder, the command to finally make the receiver file is:
python account.py -round 23
This will create the receiver_23.csv file and the account_23.csv file. The receiver file is then uploaded by all the file administrators to their respective sites. The account_23.csv file is to help people keep track of where the coins are going, it is not necessary for devcoin to function.
A script to download the bounty, earnings, peer and share files and make the receiver and account files follows below:
rm -f bitcoinshare.html
wget https://raw.githubusercontent.com/devcoin/accounting/master/bitcoinshare.html
rm -f devcoinshare.html
wget https://raw.githubusercontent.com/devcoin/accounting/master/devcoinshare.html
rm -f peer.csv
wget https://raw.githubusercontent.com/devcoin/accounting/master/peer.csv
rm -f bounty_${round}.csv
wget https://raw.githubusercontent.com/devcoin/accounting/master/bounty_${round}.csv
rm -f devtome_earnings_${round}.csv
wget https://raw.githubusercontent.com/devcoin/accounting/master/devtome_earnings_${round}.csv
rm -f marketing_earnings_${round}.csv
wget https://raw.githubusercontent.com/devcoin/accounting/master/marketing_earnings_${round}.csv
rm -f account.py
wget https://raw.githubusercontent.com/devcoin/accounting/master/account.py
rm -f account_location.csv
wget https://raw.githubusercontent.com/devcoin/accounting/master/account_location.csv
rm -f almoner.py
wget https://raw.githubusercontent.com/devcoin/accounting/master/almoner.py
# Then in that folder open a terminal and type:
python account.py -round round