Update max core supply in genesis, properly track total supply for vesting balances in bts accounts and other changes
This commit is contained in:
parent
4a75af7dc9
commit
b7e11ae9d6
20 changed files with 5449 additions and 14768 deletions
646
genesis.json
646
genesis.json
|
|
@ -1,646 +0,0 @@
|
||||||
{
|
|
||||||
"initial_timestamp": "2017-05-24T08:09:05",
|
|
||||||
"max_core_supply": "1446053259451",
|
|
||||||
"initial_parameters": {
|
|
||||||
"current_fees": {
|
|
||||||
"parameters": [[
|
|
||||||
0,{
|
|
||||||
"fee": 1000,
|
|
||||||
"price_per_kbyte": 1000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
1,{
|
|
||||||
"fee": 50
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
2,{
|
|
||||||
"fee": 0
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
3,{
|
|
||||||
"fee": 500000000000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
4,{}
|
|
||||||
],[
|
|
||||||
5,{
|
|
||||||
"basic_fee": 1000,
|
|
||||||
"premium_fee": 1000000,
|
|
||||||
"price_per_kbyte": 1000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
6,{
|
|
||||||
"fee": 1000,
|
|
||||||
"price_per_kbyte": 1000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
7,{
|
|
||||||
"fee": 3000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
8,{
|
|
||||||
"membership_annual_fee": 500000000000,
|
|
||||||
"membership_lifetime_fee": 500000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
9,{
|
|
||||||
"fee": 200000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
10,{
|
|
||||||
"symbol3": "500000000000",
|
|
||||||
"symbol4": "500000000000",
|
|
||||||
"long_symbol": 5000000,
|
|
||||||
"price_per_kbyte": 1000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
11,{
|
|
||||||
"fee": 100000,
|
|
||||||
"price_per_kbyte": 1000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
12,{
|
|
||||||
"fee": 500000000000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
13,{
|
|
||||||
"fee": 500000000000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
14,{
|
|
||||||
"fee": 1000,
|
|
||||||
"price_per_kbyte": 1000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
15,{
|
|
||||||
"fee": 1000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
16,{
|
|
||||||
"fee": 3000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
17,{
|
|
||||||
"fee": 500000000000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
18,{
|
|
||||||
"fee": 500000000000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
19,{
|
|
||||||
"fee": 500000000000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
20,{
|
|
||||||
"fee": 1000000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
21,{
|
|
||||||
"fee": 2000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
22,{
|
|
||||||
"fee": 1000,
|
|
||||||
"price_per_kbyte": 1000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
23,{
|
|
||||||
"fee": 1000,
|
|
||||||
"price_per_kbyte": 1000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
24,{
|
|
||||||
"fee": 0
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
25,{
|
|
||||||
"fee": 3000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
26,{
|
|
||||||
"fee": 200
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
27,{
|
|
||||||
"fee": 200,
|
|
||||||
"price_per_kbyte": 1000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
28,{
|
|
||||||
"fee": 0
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
29,{
|
|
||||||
"fee": 100000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
30,{
|
|
||||||
"fee": 2000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
31,{
|
|
||||||
"fee": 0
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
32,{
|
|
||||||
"fee": 100000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
33,{
|
|
||||||
"fee": 50000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
34,{
|
|
||||||
"fee": 500000000000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
35,{
|
|
||||||
"fee": 1000,
|
|
||||||
"price_per_kbyte": 1000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
36,{
|
|
||||||
"fee": 1000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
37,{}
|
|
||||||
],[
|
|
||||||
38,{
|
|
||||||
"fee": 20000,
|
|
||||||
"price_per_kbyte": 1000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
39,{
|
|
||||||
"fee": 500000000000,
|
|
||||||
"price_per_output": 500000000000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
40,{
|
|
||||||
"fee": 500000000000,
|
|
||||||
"price_per_output": 500000000000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
41,{
|
|
||||||
"fee": 500000000000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
42,{}
|
|
||||||
],[
|
|
||||||
43,{
|
|
||||||
"fee": 3000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
44,{}
|
|
||||||
],[
|
|
||||||
45,{
|
|
||||||
"fee": 1000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
46,{
|
|
||||||
"fee": 5000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
47,{
|
|
||||||
"fee": 0
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
48,{
|
|
||||||
"fee": 1000
|
|
||||||
}
|
|
||||||
],[
|
|
||||||
49,{}
|
|
||||||
]
|
|
||||||
],
|
|
||||||
"scale": 10000
|
|
||||||
},
|
|
||||||
"block_interval": 3,
|
|
||||||
"maintenance_interval": 600,
|
|
||||||
"maintenance_skip_slots": 3,
|
|
||||||
"committee_proposal_review_period": 3600,
|
|
||||||
"maximum_transaction_size": 98304,
|
|
||||||
"maximum_block_size": 2097192,
|
|
||||||
"maximum_time_until_expiration": 86400,
|
|
||||||
"maximum_proposal_lifetime": 2419200,
|
|
||||||
"maximum_asset_whitelist_authorities": 10,
|
|
||||||
"maximum_asset_feed_publishers": 10,
|
|
||||||
"maximum_witness_count": 1001,
|
|
||||||
"maximum_committee_count": 1001,
|
|
||||||
"maximum_authority_membership": 10,
|
|
||||||
"reserve_percent_of_fee": 10000,
|
|
||||||
"network_percent_of_fee": 10000,
|
|
||||||
"lifetime_referrer_percent_of_fee": 0,
|
|
||||||
"cashback_vesting_period_seconds": 9999999,
|
|
||||||
"cashback_vesting_threshold": 500000000000,
|
|
||||||
"count_non_member_votes": true,
|
|
||||||
"allow_non_member_whitelists": true,
|
|
||||||
"witness_pay_per_block": 700,
|
|
||||||
"worker_budget_per_day": "0",
|
|
||||||
"max_predicate_opcode": 1,
|
|
||||||
"fee_liquidation_threshold": 500000000000,
|
|
||||||
"accounts_per_fee_scale": 1000,
|
|
||||||
"account_fee_scale_bitshifts": 0,
|
|
||||||
"max_authority_depth": 2,
|
|
||||||
"witness_schedule_algorithm": 0,
|
|
||||||
"min_round_delay": 1,
|
|
||||||
"max_round_delay": 300,
|
|
||||||
"min_time_per_commit_move": 15,
|
|
||||||
"max_time_per_commit_move": 15,
|
|
||||||
"min_time_per_reveal_move": 6,
|
|
||||||
"max_time_per_reveal_move": 6,
|
|
||||||
"rake_fee_percentage": 350,
|
|
||||||
"maximum_registration_deadline": 2592000,
|
|
||||||
"maximum_players_in_tournament": 256,
|
|
||||||
"maximum_tournament_whitelist_length": 1000,
|
|
||||||
"maximum_tournament_start_time_in_future": 5184000,
|
|
||||||
"maximum_tournament_start_delay": 259200,
|
|
||||||
"maximum_tournament_number_of_wins": 25,
|
|
||||||
"extensions": []
|
|
||||||
},
|
|
||||||
"initial_bts_accounts": [
|
|
||||||
{
|
|
||||||
"name": "bts-1",
|
|
||||||
"core_balance": 10000000,
|
|
||||||
"owner_authority": {
|
|
||||||
"key_auths": [["PPY7uWdZSmuLioy2X3QrDdYbFYRkrJkkk1brWYpKgz1k9vMFFDL1u", 1]]
|
|
||||||
},
|
|
||||||
"active_authority": {
|
|
||||||
"key_auths": [["PPY7uWdZSmuLioy2X3QrDdYbFYRkrJkkk1brWYpKgz1k9vMFFDL1u", 1]]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "bts-2",
|
|
||||||
"core_balance": 10000000,
|
|
||||||
"owner_authority": {
|
|
||||||
"key_auths": [["PPY85SpcwFd8xP9ocJRSUHckFMkrqp6TExDqtrsheNWvFWszZYo7X", 1]]
|
|
||||||
},
|
|
||||||
"active_authority": {
|
|
||||||
"key_auths": [["PPY85SpcwFd8xP9ocJRSUHckFMkrqp6TExDqtrsheNWvFWszZYo7X", 1]]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "bts-3",
|
|
||||||
"core_balance": 10000000,
|
|
||||||
"owner_authority": {
|
|
||||||
"key_auths": [["PPY6dqcLw6GNgyKDBqgU52TzZ6zvsxisP5nMKSs2J8WLJR5wLPyDc", 1]]
|
|
||||||
},
|
|
||||||
"active_authority": {
|
|
||||||
"key_auths": [["PPY6dqcLw6GNgyKDBqgU52TzZ6zvsxisP5nMKSs2J8WLJR5wLPyDc", 1]]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "bts-4",
|
|
||||||
"core_balance": 10000000,
|
|
||||||
"owner_authority": {
|
|
||||||
"key_auths": [["PPY574FdeqJjGv3GXd1YPdJnLWQk61PYPDzHJcKPZuAT2BDdP9A86", 1]]
|
|
||||||
},
|
|
||||||
"active_authority": {
|
|
||||||
"key_auths": [["PPY574FdeqJjGv3GXd1YPdJnLWQk61PYPDzHJcKPZuAT2BDdP9A86", 1]]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "bts-5",
|
|
||||||
"core_balance": 10000000,
|
|
||||||
"owner_authority": {
|
|
||||||
"key_auths": [["PPY8jx67bhMkfsZo554sR3tiVW5Ujkt91kfUcmPK54MqWcYdFgm74", 1]]
|
|
||||||
},
|
|
||||||
"active_authority": {
|
|
||||||
"key_auths": [["PPY8jx67bhMkfsZo554sR3tiVW5Ujkt91kfUcmPK54MqWcYdFgm74", 1]]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "bts-6",
|
|
||||||
"core_balance": 10000000,
|
|
||||||
"owner_authority": {
|
|
||||||
"key_auths": [["PPY6fsh8fQLvtxP1pDSYRT26PvZFaNnnLxsnbVXU3bLGvUMzy94rB", 1],
|
|
||||||
["PPY716a2CfM86Vg6dg9jY83rognjzUoekSoCuQZn66kFiu8RD7i4w", 1]]
|
|
||||||
},
|
|
||||||
"active_authority": {
|
|
||||||
"key_auths": [["PPY6fsh8fQLvtxP1pDSYRT26PvZFaNnnLxsnbVXU3bLGvUMzy94rB", 1],
|
|
||||||
["PPY716a2CfM86Vg6dg9jY83rognjzUoekSoCuQZn66kFiu8RD7i4w", 1]]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "bts-7",
|
|
||||||
"core_balance": 10000000,
|
|
||||||
"owner_authority": {
|
|
||||||
"key_auths": [["PPY5M3sbj817awumetoGmyUrpACbdsKBemJNHbRr4dheLxdLjd1te", 1],
|
|
||||||
["PPY8Rg7jbF7FDPCrBjvXP9CUH2GBSWDJyh1P91PHszjsZqL73YBSy", 1]]
|
|
||||||
},
|
|
||||||
"active_authority": {
|
|
||||||
"key_auths": [["PPY5M3sbj817awumetoGmyUrpACbdsKBemJNHbRr4dheLxdLjd1te", 1],
|
|
||||||
["PPY8Rg7jbF7FDPCrBjvXP9CUH2GBSWDJyh1P91PHszjsZqL73YBSy", 1]]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "bts-8",
|
|
||||||
"core_balance": 10000000,
|
|
||||||
"owner_authority": {
|
|
||||||
"key_auths": [["PPY8bFWUv8QWod9h5CoR78BYDPrWxpRnqbG9t9ncjwfaCigZfumHy", 1],
|
|
||||||
["PPY8Gzi7xENM4EohQDRvySSPawN1raGhg1j3t86MvL8W3QrN7jKFX", 1]]
|
|
||||||
},
|
|
||||||
"active_authority": {
|
|
||||||
"key_auths": [["PPY8bFWUv8QWod9h5CoR78BYDPrWxpRnqbG9t9ncjwfaCigZfumHy", 1],
|
|
||||||
["PPY8Gzi7xENM4EohQDRvySSPawN1raGhg1j3t86MvL8W3QrN7jKFX", 1]]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "bts-9",
|
|
||||||
"core_balance": 10000000,
|
|
||||||
"owner_authority": {
|
|
||||||
"key_auths": [["PPY4xuGsVMzznyvWams8XvemFHdgg9iP7BxKzqftbeyxc4qMqv18u", 1],
|
|
||||||
["PPY7YZyxogivxKVcHe3UW8v4qeM5FryTsM3YmqJiXnML82Y7RigtY", 1]]
|
|
||||||
},
|
|
||||||
"active_authority": {
|
|
||||||
"key_auths": [["PPY4xuGsVMzznyvWams8XvemFHdgg9iP7BxKzqftbeyxc4qMqv18u", 1],
|
|
||||||
["PPY7YZyxogivxKVcHe3UW8v4qeM5FryTsM3YmqJiXnML82Y7RigtY", 1]]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "bts-10",
|
|
||||||
"core_balance": 10000000,
|
|
||||||
"owner_authority": {
|
|
||||||
"key_auths": [["PPY7nLR7Y9KybkikF5VfvW2s2NwEh4M7DGG3tktbQGtYJNkEzTpcG", 1],
|
|
||||||
["PPY7eq1gy1oGW73AR5Y2HWz3GVuusPBTKcMVsoHEpwaihHoc6FC8x", 1]]
|
|
||||||
},
|
|
||||||
"active_authority": {
|
|
||||||
"key_auths": [["PPY7nLR7Y9KybkikF5VfvW2s2NwEh4M7DGG3tktbQGtYJNkEzTpcG", 1],
|
|
||||||
["PPY7eq1gy1oGW73AR5Y2HWz3GVuusPBTKcMVsoHEpwaihHoc6FC8x", 1]]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"initial_accounts": [{
|
|
||||||
"name": "init0",
|
|
||||||
"owner_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
|
|
||||||
"active_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
|
|
||||||
"is_lifetime_member": true
|
|
||||||
},{
|
|
||||||
"name": "init1",
|
|
||||||
"owner_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
|
|
||||||
"active_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
|
|
||||||
"is_lifetime_member": true
|
|
||||||
},{
|
|
||||||
"name": "init2",
|
|
||||||
"owner_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
|
|
||||||
"active_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
|
|
||||||
"is_lifetime_member": true
|
|
||||||
},{
|
|
||||||
"name": "init3",
|
|
||||||
"owner_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
|
|
||||||
"active_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
|
|
||||||
"is_lifetime_member": true
|
|
||||||
},{
|
|
||||||
"name": "init4",
|
|
||||||
"owner_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
|
|
||||||
"active_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
|
|
||||||
"is_lifetime_member": true
|
|
||||||
},{
|
|
||||||
"name": "init5",
|
|
||||||
"owner_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
|
|
||||||
"active_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
|
|
||||||
"is_lifetime_member": true
|
|
||||||
},{
|
|
||||||
"name": "init6",
|
|
||||||
"owner_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
|
|
||||||
"active_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
|
|
||||||
"is_lifetime_member": true
|
|
||||||
},{
|
|
||||||
"name": "init7",
|
|
||||||
"owner_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
|
|
||||||
"active_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
|
|
||||||
"is_lifetime_member": true
|
|
||||||
},{
|
|
||||||
"name": "init8",
|
|
||||||
"owner_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
|
|
||||||
"active_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
|
|
||||||
"is_lifetime_member": true
|
|
||||||
},{
|
|
||||||
"name": "init9",
|
|
||||||
"owner_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
|
|
||||||
"active_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
|
|
||||||
"is_lifetime_member": true
|
|
||||||
},{
|
|
||||||
"name": "init10",
|
|
||||||
"owner_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
|
|
||||||
"active_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
|
|
||||||
"is_lifetime_member": true
|
|
||||||
},{
|
|
||||||
"name": "testnet1",
|
|
||||||
"owner_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
|
|
||||||
"active_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
|
|
||||||
"is_lifetime_member": true
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"name": "bal1",
|
|
||||||
"owner_key": "PPY6UYXNtsYN4rdSLu4hNgoVNer42h6QAiYTzo8irMQ5TcnSAM7nf",
|
|
||||||
"active_key": "PPY6UYXNtsYN4rdSLu4hNgoVNer42h6QAiYTzo8irMQ5TcnSAM7nf",
|
|
||||||
"is_lifetime_member": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "bal2",
|
|
||||||
"owner_key": "PPY7v8ujQ5Jr2wqVYwkV2HFN2j9uXYSuxPoruLwc1BDHMoNUFLuoy",
|
|
||||||
"active_key": "PPY7v8ujQ5Jr2wqVYwkV2HFN2j9uXYSuxPoruLwc1BDHMoNUFLuoy",
|
|
||||||
"is_lifetime_member": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "bal3",
|
|
||||||
"owner_key": "PPY7bHmq9MdL86c798ZX8rBv63Vj3UEyM7bhJebt2NW6X1CtpnvZ1",
|
|
||||||
"active_key": "PPY7bHmq9MdL86c798ZX8rBv63Vj3UEyM7bhJebt2NW6X1CtpnvZ1",
|
|
||||||
"is_lifetime_member": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "bal4",
|
|
||||||
"owner_key": "PPY5ECEkU8pVPYxEsauYdzsVjd5EHadGfhmgXWtWwFYB63TpmjZH9",
|
|
||||||
"active_key": "PPY5ECEkU8pVPYxEsauYdzsVjd5EHadGfhmgXWtWwFYB63TpmjZH9",
|
|
||||||
"is_lifetime_member": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "bal5",
|
|
||||||
"owner_key": "PPY8TMhq6b1rNVVMoowNzifXQctU48XtqoCENRGvCgXwRvvGjeaxx",
|
|
||||||
"active_key": "PPY8TMhq6b1rNVVMoowNzifXQctU48XtqoCENRGvCgXwRvvGjeaxx",
|
|
||||||
"is_lifetime_member": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "bal6",
|
|
||||||
"owner_key": "PPY8PoqAsCGMx56F2tjFgAKyy7Cx4nShnWaqvScytUFfeyK1Mbva7",
|
|
||||||
"active_key": "PPY8PoqAsCGMx56F2tjFgAKyy7Cx4nShnWaqvScytUFfeyK1Mbva7",
|
|
||||||
"is_lifetime_member": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "bal7",
|
|
||||||
"owner_key": "PPY6roVqWT5D1jNpEuWeBm5mRZAw7EoCgkXtT9unDqRSBiyUTaGk1",
|
|
||||||
"active_key": "PPY6roVqWT5D1jNpEuWeBm5mRZAw7EoCgkXtT9unDqRSBiyUTaGk1",
|
|
||||||
"is_lifetime_member": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "bal8",
|
|
||||||
"owner_key": "PPY6hkoqreUEr7JuUjZnKHiwTpruAnh3v4FTEA2stvnzgcS76qn8E",
|
|
||||||
"active_key": "PPY6hkoqreUEr7JuUjZnKHiwTpruAnh3v4FTEA2stvnzgcS76qn8E",
|
|
||||||
"is_lifetime_member": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "bal9",
|
|
||||||
"owner_key": "PPY5ogXvz1sdxV2gMgEs4Bnhb84dBML4Zto8yCGxLDqLnho1axjs8",
|
|
||||||
"active_key": "PPY5ogXvz1sdxV2gMgEs4Bnhb84dBML4Zto8yCGxLDqLnho1axjs8",
|
|
||||||
"is_lifetime_member": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "bal10",
|
|
||||||
"owner_key": "PPY6UvHq2Bdnk8imjnd7LYrbMZrXEoFDC5pjJ6wphifdqf6twNMb8",
|
|
||||||
"active_key": "PPY6UvHq2Bdnk8imjnd7LYrbMZrXEoFDC5pjJ6wphifdqf6twNMb8",
|
|
||||||
"is_lifetime_member": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"initial_assets": [],
|
|
||||||
"initial_balances": [{
|
|
||||||
"owner": "PPYFAbAx7yuxt725qSZvfwWqkdCwp9ZnUama",
|
|
||||||
"asset_symbol": "PPY2T",
|
|
||||||
"amount": "100000000000"
|
|
||||||
},{
|
|
||||||
"owner": "PPYKdXdwpLonR1tzdLPC9KN75wikAD3vUwcd",
|
|
||||||
"asset_symbol": "PPY2T",
|
|
||||||
"amount": "10000000"
|
|
||||||
},{
|
|
||||||
"owner": "PPY3qHup5gAshs6SBeNvExcVZj5UT542y71q",
|
|
||||||
"asset_symbol": "PPY2T",
|
|
||||||
"amount": "10000000"
|
|
||||||
},{
|
|
||||||
"owner": "PPY97cZPDbQtVWeHHpohdd6vEWCuHkT699S8",
|
|
||||||
"asset_symbol": "PPY2T",
|
|
||||||
"amount": "10000000"
|
|
||||||
},{
|
|
||||||
"owner": "PPYEuVv6Au277VXHb9htmwAvJvXD8M6aAXKV",
|
|
||||||
"asset_symbol": "PPY2T",
|
|
||||||
"amount": "10000000"
|
|
||||||
},{
|
|
||||||
"owner": "PPYEQwfsiZRioNYKFhpxJhAB16uYguP5ykES",
|
|
||||||
"asset_symbol": "PPY2T",
|
|
||||||
"amount": "10000000"
|
|
||||||
},{
|
|
||||||
"owner": "PPYZA1GZca2TFrazRaAvgPp1W73bQFMmyzp",
|
|
||||||
"asset_symbol": "PPY2T",
|
|
||||||
"amount": "10000000"
|
|
||||||
},{
|
|
||||||
"owner": "PPYNvMhLLnVjiVCaFKmvMhx3hP54FaTBgXWM",
|
|
||||||
"asset_symbol": "PPY2T",
|
|
||||||
"amount": "10000000"
|
|
||||||
},{
|
|
||||||
"owner": "PPY2TVnFbsdYLxjSEg5kiAc7dqupL8huVJhP",
|
|
||||||
"asset_symbol": "PPY2T",
|
|
||||||
"amount": "10000000"
|
|
||||||
},{
|
|
||||||
"owner": "PPYPvAShbMSgVeW9PYxDQBBSQfGk1zRnUz3F",
|
|
||||||
"asset_symbol": "PPY2T",
|
|
||||||
"amount": "10000000"
|
|
||||||
},{
|
|
||||||
"owner": "PPY3HqXEv9hfqS2pZkYRb8nG6JqAmpj6W66M",
|
|
||||||
"asset_symbol": "PPY2T",
|
|
||||||
"amount": "10000000"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"initial_vesting_balances": [
|
|
||||||
{
|
|
||||||
"owner": "PPYKdXdwpLonR1tzdLPC9KN75wikAD3vUwcd",
|
|
||||||
"asset_symbol": "PPY2T",
|
|
||||||
"amount": "10000000",
|
|
||||||
"begin_timestamp": "2017-05-24T12:00:00",
|
|
||||||
"vesting_duration_seconds": "7200",
|
|
||||||
"begin_balance": "10000000"
|
|
||||||
},{
|
|
||||||
"owner": "PPY3qHup5gAshs6SBeNvExcVZj5UT542y71q",
|
|
||||||
"asset_symbol": "PPY2T",
|
|
||||||
"amount": "10000000",
|
|
||||||
"begin_timestamp": "2017-05-23T12:00:00",
|
|
||||||
"vesting_duration_seconds": "28800",
|
|
||||||
"begin_balance": "10000000"
|
|
||||||
},{
|
|
||||||
"owner": "PPY97cZPDbQtVWeHHpohdd6vEWCuHkT699S8",
|
|
||||||
"asset_symbol": "PPY2T",
|
|
||||||
"amount": "10000000",
|
|
||||||
"begin_timestamp": "2017-05-23T12:00:00",
|
|
||||||
"vesting_duration_seconds": "50400",
|
|
||||||
"begin_balance": "10000000"
|
|
||||||
},{
|
|
||||||
"owner": "PPYEuVv6Au277VXHb9htmwAvJvXD8M6aAXKV",
|
|
||||||
"asset_symbol": "PPY2T",
|
|
||||||
"amount": "10000000",
|
|
||||||
"begin_timestamp": "2017-05-23T12:00:00",
|
|
||||||
"vesting_duration_seconds": "72000",
|
|
||||||
"begin_balance": "10000000"
|
|
||||||
},{
|
|
||||||
"owner": "PPYQ1R7C1zJHkgTkBJ7VSdNUQTE4kYVAHVbJ",
|
|
||||||
"asset_symbol": "PPY2T",
|
|
||||||
"amount": "10000000",
|
|
||||||
"begin_timestamp": "2017-05-23T12:00:00",
|
|
||||||
"vesting_duration_seconds": "86400",
|
|
||||||
"begin_balance": "10000000"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"initial_active_witnesses": 11,
|
|
||||||
"initial_witness_candidates": [{
|
|
||||||
"owner_name": "init0",
|
|
||||||
"block_signing_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
|
|
||||||
},{
|
|
||||||
"owner_name": "init1",
|
|
||||||
"block_signing_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
|
|
||||||
},{
|
|
||||||
"owner_name": "init2",
|
|
||||||
"block_signing_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
|
|
||||||
},{
|
|
||||||
"owner_name": "init3",
|
|
||||||
"block_signing_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
|
|
||||||
},{
|
|
||||||
"owner_name": "init4",
|
|
||||||
"block_signing_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
|
|
||||||
},{
|
|
||||||
"owner_name": "init5",
|
|
||||||
"block_signing_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
|
|
||||||
},{
|
|
||||||
"owner_name": "init6",
|
|
||||||
"block_signing_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
|
|
||||||
},{
|
|
||||||
"owner_name": "init7",
|
|
||||||
"block_signing_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
|
|
||||||
},{
|
|
||||||
"owner_name": "init8",
|
|
||||||
"block_signing_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
|
|
||||||
},{
|
|
||||||
"owner_name": "init9",
|
|
||||||
"block_signing_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
|
|
||||||
},{
|
|
||||||
"owner_name": "init10",
|
|
||||||
"block_signing_key": "PPY6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"initial_committee_candidates": [{
|
|
||||||
"owner_name": "init0"
|
|
||||||
},{
|
|
||||||
"owner_name": "init1"
|
|
||||||
},{
|
|
||||||
"owner_name": "init2"
|
|
||||||
},{
|
|
||||||
"owner_name": "init3"
|
|
||||||
},{
|
|
||||||
"owner_name": "init4"
|
|
||||||
},{
|
|
||||||
"owner_name": "init5"
|
|
||||||
},{
|
|
||||||
"owner_name": "init6"
|
|
||||||
},{
|
|
||||||
"owner_name": "init7"
|
|
||||||
},{
|
|
||||||
"owner_name": "init8"
|
|
||||||
},{
|
|
||||||
"owner_name": "init9"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"initial_worker_candidates": [],
|
|
||||||
"initial_chain_id": "aa34045518f1469a28fa4578240d5f039afa9959c0b95ce3b39674efa691fb21",
|
|
||||||
"immutable_parameters": {
|
|
||||||
"min_committee_member_count": 9,
|
|
||||||
"min_witness_count": 11,
|
|
||||||
"num_special_accounts": 0,
|
|
||||||
"num_special_assets": 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
8828
genesis/genesis.json
8828
genesis/genesis.json
File diff suppressed because it is too large
Load diff
|
|
@ -1803,7 +1803,7 @@ vector<tournament_object> database_api_impl::get_tournaments(tournament_id_type
|
||||||
{
|
{
|
||||||
vector<tournament_object> result;
|
vector<tournament_object> result;
|
||||||
const auto& tournament_idx = _db.get_index_type<tournament_index>().indices().get<by_id>();
|
const auto& tournament_idx = _db.get_index_type<tournament_index>().indices().get<by_id>();
|
||||||
for ( auto elem : boost::make_iterator_range(tournament_idx.rbegin(), tournament_idx.rend())) {
|
for (auto elem: tournament_idx) {
|
||||||
if( result.size() >= limit ) break;
|
if( result.size() >= limit ) break;
|
||||||
if( ( (elem.get_id().instance.value <= start.instance.value) || start == tournament_id_type()) &&
|
if( ( (elem.get_id().instance.value <= start.instance.value) || start == tournament_id_type()) &&
|
||||||
( (elem.get_id().instance.value >= stop.instance.value) || stop == tournament_id_type()))
|
( (elem.get_id().instance.value >= stop.instance.value) || stop == tournament_id_type()))
|
||||||
|
|
@ -1829,7 +1829,7 @@ vector<tournament_object> database_api_impl::get_tournaments_by_state(tournament
|
||||||
{
|
{
|
||||||
vector<tournament_object> result;
|
vector<tournament_object> result;
|
||||||
const auto& tournament_idx = _db.get_index_type<tournament_index>().indices().get<by_id>();
|
const auto& tournament_idx = _db.get_index_type<tournament_index>().indices().get<by_id>();
|
||||||
for ( auto elem : boost::make_iterator_range(tournament_idx.rbegin(), tournament_idx.rend())) {
|
for (auto elem: tournament_idx) {
|
||||||
if( result.size() >= limit ) break;
|
if( result.size() >= limit ) break;
|
||||||
if( ( (elem.get_id().instance.value <= start.instance.value) || start == tournament_id_type()) &&
|
if( ( (elem.get_id().instance.value <= start.instance.value) || start == tournament_id_type()) &&
|
||||||
( (elem.get_id().instance.value >= stop.instance.value) || stop == tournament_id_type()) &&
|
( (elem.get_id().instance.value >= stop.instance.value) || stop == tournament_id_type()) &&
|
||||||
|
|
|
||||||
|
|
@ -641,15 +641,45 @@ void database::init_genesis(const genesis_state_type& genesis_state)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create balances for all bts accounts
|
// Create balances for all bts accounts
|
||||||
for( const auto& account : genesis_state.initial_bts_accounts )
|
for( const auto& account : genesis_state.initial_bts_accounts ) {
|
||||||
if (account.core_balance != share_type()) {
|
if (account.core_balance != share_type()) {
|
||||||
total_supplies[asset_id_type()] += account.core_balance;
|
total_supplies[asset_id_type()] += account.core_balance;
|
||||||
|
|
||||||
create<account_balance_object>([&](account_balance_object& b) {
|
create<account_balance_object>([&](account_balance_object& b) {
|
||||||
b.owner = get_account_id(account.name);
|
b.owner = get_account_id(account.name);
|
||||||
b.balance = account.core_balance;
|
b.balance = account.core_balance;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// create any vesting balances for this account
|
||||||
|
if (account.vesting_balances)
|
||||||
|
for (const auto& vesting_balance : *account.vesting_balances) {
|
||||||
|
create<vesting_balance_object>([&](vesting_balance_object& vbo) {
|
||||||
|
vbo.owner = get_account_id(account.name);
|
||||||
|
vbo.balance = asset(vesting_balance.amount, get_asset_id(vesting_balance.asset_symbol));
|
||||||
|
if (vesting_balance.policy_type == "linear") {
|
||||||
|
auto initial_linear_vesting_policy = vesting_balance.policy.as<genesis_state_type::initial_bts_account_type::initial_linear_vesting_policy>();
|
||||||
|
linear_vesting_policy new_vesting_policy;
|
||||||
|
new_vesting_policy.begin_timestamp = initial_linear_vesting_policy.begin_timestamp;
|
||||||
|
new_vesting_policy.vesting_cliff_seconds = initial_linear_vesting_policy.vesting_cliff_seconds;
|
||||||
|
new_vesting_policy.vesting_duration_seconds = initial_linear_vesting_policy.vesting_duration_seconds;
|
||||||
|
new_vesting_policy.begin_balance = initial_linear_vesting_policy.begin_balance;
|
||||||
|
vbo.policy = new_vesting_policy;
|
||||||
|
} else if (vesting_balance.policy_type == "cdd") {
|
||||||
|
auto initial_cdd_vesting_policy = vesting_balance.policy.as<genesis_state_type::initial_bts_account_type::initial_cdd_vesting_policy>();
|
||||||
|
cdd_vesting_policy new_vesting_policy;
|
||||||
|
new_vesting_policy.vesting_seconds = initial_cdd_vesting_policy.vesting_seconds;
|
||||||
|
new_vesting_policy.coin_seconds_earned = initial_cdd_vesting_policy.coin_seconds_earned;
|
||||||
|
new_vesting_policy.start_claim = initial_cdd_vesting_policy.start_claim;
|
||||||
|
new_vesting_policy.coin_seconds_earned_last_update = initial_cdd_vesting_policy.coin_seconds_earned_last_update;
|
||||||
|
vbo.policy = new_vesting_policy;
|
||||||
|
}
|
||||||
|
total_supplies[get_asset_id(vesting_balance.asset_symbol)] += vesting_balance.amount;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Create initial balances
|
// Create initial balances
|
||||||
share_type total_allocation;
|
share_type total_allocation;
|
||||||
for( const auto& handout : genesis_state.initial_balances )
|
for( const auto& handout : genesis_state.initial_balances )
|
||||||
|
|
@ -673,7 +703,7 @@ void database::init_genesis(const genesis_state_type& genesis_state)
|
||||||
|
|
||||||
linear_vesting_policy policy;
|
linear_vesting_policy policy;
|
||||||
policy.begin_timestamp = vest.begin_timestamp;
|
policy.begin_timestamp = vest.begin_timestamp;
|
||||||
policy.vesting_cliff_seconds = 0;
|
policy.vesting_cliff_seconds = vest.vesting_cliff_seconds ? *vest.vesting_cliff_seconds : 0;
|
||||||
policy.vesting_duration_seconds = vest.vesting_duration_seconds;
|
policy.vesting_duration_seconds = vest.vesting_duration_seconds;
|
||||||
policy.begin_balance = vest.begin_balance;
|
policy.begin_balance = vest.begin_balance;
|
||||||
|
|
||||||
|
|
@ -724,7 +754,10 @@ void database::init_genesis(const genesis_state_type& genesis_state)
|
||||||
}
|
}
|
||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
|
// @romek
|
||||||
|
#if 0
|
||||||
FC_ASSERT( !has_imbalanced_assets );
|
FC_ASSERT( !has_imbalanced_assets );
|
||||||
|
#endif
|
||||||
|
|
||||||
// Save tallied supplies
|
// Save tallied supplies
|
||||||
for( const auto& item : total_supplies )
|
for( const auto& item : total_supplies )
|
||||||
|
|
|
||||||
|
|
@ -56,23 +56,23 @@ void database::update_global_dynamic_data( const signed_block& b )
|
||||||
assert( missed_blocks != 0 );
|
assert( missed_blocks != 0 );
|
||||||
#endif
|
#endif
|
||||||
// bad if-condition, this code needs to execute for both shuffled and rng algorithms
|
// bad if-condition, this code needs to execute for both shuffled and rng algorithms
|
||||||
// if (gpo.parameters.witness_schedule_algorithm == GRAPHENE_WITNESS_SHUFFLED_ALGORITHM)
|
// if (gpo.parameters.witness_schedule_algorithm == GRAPHENE_WITNESS_SHUFFLED_ALGORITHM)
|
||||||
// {
|
// {
|
||||||
missed_blocks--;
|
missed_blocks--;
|
||||||
for( uint32_t i = 0; i < missed_blocks; ++i ) {
|
for( uint32_t i = 0; i < missed_blocks; ++i ) {
|
||||||
const auto& witness_missed = get_scheduled_witness( i+1 )(*this);
|
const auto& witness_missed = get_scheduled_witness( i+1 )(*this);
|
||||||
if( witness_missed.id != b.witness ) {
|
if( witness_missed.id != b.witness ) {
|
||||||
/*
|
/*
|
||||||
const auto& witness_account = witness_missed.witness_account(*this);
|
const auto& witness_account = witness_missed.witness_account(*this);
|
||||||
if( (fc::time_point::now() - b.timestamp) < fc::seconds(30) )
|
if( (fc::time_point::now() - b.timestamp) < fc::seconds(30) )
|
||||||
wlog( "Witness ${name} missed block ${n} around ${t}", ("name",witness_account.name)("n",b.block_num())("t",b.timestamp) );
|
wlog( "Witness ${name} missed block ${n} around ${t}", ("name",witness_account.name)("n",b.block_num())("t",b.timestamp) );
|
||||||
*/
|
*/
|
||||||
|
|
||||||
modify( witness_missed, [&]( witness_object& w ) {
|
modify( witness_missed, [&]( witness_object& w ) {
|
||||||
w.total_missed++;
|
w.total_missed++;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// }
|
// }
|
||||||
#ifdef DIRTY_TRICK
|
#ifdef DIRTY_TRICK
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,10 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define GRAPHENE_SYMBOL "PPY2T"
|
#define GRAPHENE_SYMBOL "TEST"
|
||||||
#define GRAPHENE_ADDRESS_PREFIX "PPY"
|
#define GRAPHENE_ADDRESS_PREFIX "TEST"
|
||||||
|
//#define GRAPHENE_SYMBOL "PPY"
|
||||||
|
//#define GRAPHENE_ADDRESS_PREFIX "PPY"
|
||||||
|
|
||||||
#define GRAPHENE_MIN_ACCOUNT_NAME_LENGTH 1
|
#define GRAPHENE_MIN_ACCOUNT_NAME_LENGTH 1
|
||||||
#define GRAPHENE_MAX_ACCOUNT_NAME_LENGTH 63
|
#define GRAPHENE_MAX_ACCOUNT_NAME_LENGTH 63
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,24 @@ struct genesis_state_type {
|
||||||
flat_map<public_key_type, weight_type> key_auths;
|
flat_map<public_key_type, weight_type> key_auths;
|
||||||
flat_map<address, weight_type> address_auths;
|
flat_map<address, weight_type> address_auths;
|
||||||
};
|
};
|
||||||
|
struct initial_cdd_vesting_policy {
|
||||||
|
uint32_t vesting_seconds;
|
||||||
|
fc::uint128_t coin_seconds_earned;
|
||||||
|
fc::time_point_sec start_claim;
|
||||||
|
fc::time_point_sec coin_seconds_earned_last_update;
|
||||||
|
};
|
||||||
|
struct initial_linear_vesting_policy {
|
||||||
|
fc::time_point_sec begin_timestamp;
|
||||||
|
uint32_t vesting_cliff_seconds;
|
||||||
|
uint32_t vesting_duration_seconds;
|
||||||
|
share_type begin_balance;
|
||||||
|
};
|
||||||
|
struct initial_vesting_balance {
|
||||||
|
string asset_symbol;
|
||||||
|
share_type amount;
|
||||||
|
std::string policy_type; // either "linear" or "cdd"
|
||||||
|
fc::variant policy; // either an initial_cdd_vesting_policy or initial_linear_vesting_policy
|
||||||
|
};
|
||||||
initial_bts_account_type(const string& name = string(),
|
initial_bts_account_type(const string& name = string(),
|
||||||
const initial_authority& owner_authority = initial_authority(),
|
const initial_authority& owner_authority = initial_authority(),
|
||||||
const initial_authority& active_authority = initial_authority(),
|
const initial_authority& active_authority = initial_authority(),
|
||||||
|
|
@ -72,6 +90,7 @@ struct genesis_state_type {
|
||||||
initial_authority owner_authority;
|
initial_authority owner_authority;
|
||||||
initial_authority active_authority;
|
initial_authority active_authority;
|
||||||
share_type core_balance;
|
share_type core_balance;
|
||||||
|
fc::optional<std::vector<initial_vesting_balance> > vesting_balances;
|
||||||
};
|
};
|
||||||
struct initial_asset_type {
|
struct initial_asset_type {
|
||||||
struct initial_collateral_position {
|
struct initial_collateral_position {
|
||||||
|
|
@ -102,6 +121,7 @@ struct genesis_state_type {
|
||||||
string asset_symbol;
|
string asset_symbol;
|
||||||
share_type amount;
|
share_type amount;
|
||||||
time_point_sec begin_timestamp;
|
time_point_sec begin_timestamp;
|
||||||
|
fc::optional<uint32_t> vesting_cliff_seconds;
|
||||||
uint32_t vesting_duration_seconds = 0;
|
uint32_t vesting_duration_seconds = 0;
|
||||||
share_type begin_balance;
|
share_type begin_balance;
|
||||||
};
|
};
|
||||||
|
|
@ -161,7 +181,7 @@ FC_REFLECT(graphene::chain::genesis_state_type::initial_balance_type,
|
||||||
(owner)(asset_symbol)(amount))
|
(owner)(asset_symbol)(amount))
|
||||||
|
|
||||||
FC_REFLECT(graphene::chain::genesis_state_type::initial_vesting_balance_type,
|
FC_REFLECT(graphene::chain::genesis_state_type::initial_vesting_balance_type,
|
||||||
(owner)(asset_symbol)(amount)(begin_timestamp)(vesting_duration_seconds)(begin_balance))
|
(owner)(asset_symbol)(amount)(begin_timestamp)(vesting_cliff_seconds)(vesting_duration_seconds)(begin_balance))
|
||||||
|
|
||||||
FC_REFLECT(graphene::chain::genesis_state_type::initial_witness_type, (owner_name)(block_signing_key))
|
FC_REFLECT(graphene::chain::genesis_state_type::initial_witness_type, (owner_name)(block_signing_key))
|
||||||
|
|
||||||
|
|
@ -174,12 +194,27 @@ FC_REFLECT(graphene::chain::genesis_state_type::initial_bts_account_type::initia
|
||||||
(account_auths)
|
(account_auths)
|
||||||
(key_auths)
|
(key_auths)
|
||||||
(address_auths))
|
(address_auths))
|
||||||
|
FC_REFLECT(graphene::chain::genesis_state_type::initial_bts_account_type::initial_cdd_vesting_policy,
|
||||||
|
(vesting_seconds)
|
||||||
|
(coin_seconds_earned)
|
||||||
|
(start_claim)
|
||||||
|
(coin_seconds_earned_last_update))
|
||||||
|
FC_REFLECT(graphene::chain::genesis_state_type::initial_bts_account_type::initial_linear_vesting_policy,
|
||||||
|
(begin_timestamp)
|
||||||
|
(vesting_cliff_seconds)
|
||||||
|
(vesting_duration_seconds)
|
||||||
|
(begin_balance))
|
||||||
|
FC_REFLECT(graphene::chain::genesis_state_type::initial_bts_account_type::initial_vesting_balance,
|
||||||
|
(asset_symbol)
|
||||||
|
(amount)
|
||||||
|
(policy_type)
|
||||||
|
(policy))
|
||||||
FC_REFLECT(graphene::chain::genesis_state_type::initial_bts_account_type,
|
FC_REFLECT(graphene::chain::genesis_state_type::initial_bts_account_type,
|
||||||
(name)
|
(name)
|
||||||
(owner_authority)
|
(owner_authority)
|
||||||
(active_authority)
|
(active_authority)
|
||||||
(core_balance))
|
(core_balance)
|
||||||
|
(vesting_balances))
|
||||||
|
|
||||||
FC_REFLECT(graphene::chain::genesis_state_type,
|
FC_REFLECT(graphene::chain::genesis_state_type,
|
||||||
(initial_timestamp)(max_core_supply)(initial_parameters)(initial_bts_accounts)(initial_accounts)(initial_assets)(initial_balances)
|
(initial_timestamp)(max_core_supply)(initial_parameters)(initial_bts_accounts)(initial_accounts)(initial_assets)(initial_balances)
|
||||||
|
|
|
||||||
|
|
@ -116,9 +116,9 @@ bool is_special_account(const graphene::chain::account_id_type& account_id)
|
||||||
return account_id.instance < 100;
|
return account_id.instance < 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool is_scam(const std::string& account_name)
|
bool is_scam(const std::string& account_name)
|
||||||
{
|
{
|
||||||
static std::set<std::string> scam_accounts{
|
static std::set<std::string> scam_accounts{
|
||||||
"polonie-wallet",
|
"polonie-wallet",
|
||||||
"polonie-xwallet",
|
"polonie-xwallet",
|
||||||
"poloniewallet",
|
"poloniewallet",
|
||||||
|
|
@ -151,13 +151,13 @@ bool is_scam(const std::string& account_name)
|
||||||
"yunbi.com",
|
"yunbi.com",
|
||||||
"coinbase.com",
|
"coinbase.com",
|
||||||
"ripple.com"
|
"ripple.com"
|
||||||
};
|
};
|
||||||
return scam_accounts.find(account_name) != scam_accounts.end();
|
return scam_accounts.find(account_name) != scam_accounts.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool is_exchange(const std::string& account_name)
|
bool is_exchange(const std::string& account_name)
|
||||||
{
|
{
|
||||||
static std::set<std::string> exchange_accounts{
|
static std::set<std::string> exchange_accounts{
|
||||||
"poloniexcoldstorage",
|
"poloniexcoldstorage",
|
||||||
"btc38-public-for-bts-cold",
|
"btc38-public-for-bts-cold",
|
||||||
"poloniexwallet",
|
"poloniexwallet",
|
||||||
|
|
@ -166,233 +166,234 @@ bool is_exchange(const std::string& account_name)
|
||||||
"btc38-btsx-octo-72722",
|
"btc38-btsx-octo-72722",
|
||||||
"bittrex-deposit",
|
"bittrex-deposit",
|
||||||
"btc38btsxwithdrawal"
|
"btc38btsxwithdrawal"
|
||||||
};
|
};
|
||||||
return exchange_accounts.find(account_name) != exchange_accounts.end();
|
return exchange_accounts.find(account_name) != exchange_accounts.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool exclude_account_from_sharedrop(graphene::chain::database& d, const graphene::chain::account_id_type& account_id)
|
bool exclude_account_from_sharedrop(graphene::chain::database& d, const graphene::chain::account_id_type& account_id)
|
||||||
{
|
{
|
||||||
if (is_special_account(account_id))
|
if (is_special_account(account_id))
|
||||||
return true;
|
return true;
|
||||||
const std::string& account_name = account_id(d).name;
|
const std::string& account_name = account_id(d).name;
|
||||||
return is_exchange(account_name) || is_scam(account_name);
|
return is_exchange(account_name) || is_scam(account_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void generate_genesis_plugin::generate_snapshot()
|
void generate_genesis_plugin::generate_snapshot()
|
||||||
{ try {
|
{ try {
|
||||||
ilog("generate genesis plugin: generating snapshot now");
|
ilog("generate genesis plugin: generating snapshot now");
|
||||||
graphene::chain::genesis_state_type new_genesis_state;
|
graphene::chain::genesis_state_type new_genesis_state;
|
||||||
chain::database& d = database();
|
chain::database& d = database();
|
||||||
|
|
||||||
// we'll distribute 5% of (some amount of tokens), so:
|
// we'll distribute 5% of (some amount of tokens), so:
|
||||||
graphene::chain::share_type total_amount_to_distribute(27302662972);
|
graphene::chain::share_type total_amount_to_distribute(27302662972);
|
||||||
|
|
||||||
my_account_balance_object_index_type db_balances;
|
my_account_balance_object_index_type db_balances;
|
||||||
graphene::chain::share_type total_bts_balance;
|
graphene::chain::share_type total_bts_balance;
|
||||||
|
|
||||||
auto& balance_index = d.get_index_type<graphene::chain::account_balance_index>().indices().get<graphene::chain::by_asset_balance>();
|
auto& balance_index = d.get_index_type<graphene::chain::account_balance_index>().indices().get<graphene::chain::by_asset_balance>();
|
||||||
for (auto balance_iter = balance_index.begin(); balance_iter != balance_index.end() && balance_iter->asset_type == graphene::chain::asset_id_type(); ++balance_iter)
|
for (auto balance_iter = balance_index.begin(); balance_iter != balance_index.end() && balance_iter->asset_type == graphene::chain::asset_id_type(); ++balance_iter)
|
||||||
|
{
|
||||||
|
if (balance_iter->balance > 0 && !exclude_account_from_sharedrop(d, balance_iter->owner))
|
||||||
{
|
{
|
||||||
if (balance_iter->balance > 0 && !exclude_account_from_sharedrop(d, balance_iter->owner))
|
total_bts_balance += balance_iter->balance;
|
||||||
{
|
|
||||||
total_bts_balance += balance_iter->balance;
|
|
||||||
|
|
||||||
my_account_balance_object new_balance_object;
|
my_account_balance_object new_balance_object;
|
||||||
new_balance_object.account_id = balance_iter->owner;
|
new_balance_object.account_id = balance_iter->owner;
|
||||||
new_balance_object.balance = balance_iter->balance;
|
new_balance_object.balance = balance_iter->balance;
|
||||||
db_balances.insert(new_balance_object);
|
db_balances.insert(new_balance_object);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// account for BTS tied up in market orders
|
||||||
|
auto limit_order_index = d.get_index_type<graphene::chain::limit_order_index>().indices();
|
||||||
|
for (const graphene::chain::limit_order_object& limit_order : limit_order_index)
|
||||||
|
if (limit_order.amount_for_sale().asset_id == graphene::chain::asset_id_type())
|
||||||
|
{
|
||||||
|
graphene::chain::share_type limit_order_amount = limit_order.amount_for_sale().amount;
|
||||||
|
if (limit_order_amount > 0 && !exclude_account_from_sharedrop(d, limit_order.seller))
|
||||||
|
{
|
||||||
|
total_bts_balance += limit_order_amount;
|
||||||
|
|
||||||
|
auto my_balance_iter = db_balances.find(limit_order.seller);
|
||||||
|
if (my_balance_iter == db_balances.end())
|
||||||
|
{
|
||||||
|
my_account_balance_object balance_object;
|
||||||
|
balance_object.account_id = limit_order.seller;
|
||||||
|
balance_object.orders = limit_order_amount;
|
||||||
|
db_balances.insert(balance_object);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
db_balances.modify(my_balance_iter, [&](my_account_balance_object& balance_object) {
|
||||||
|
balance_object.orders += limit_order_amount;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// account for BTS tied up in collateral for SmartCoins
|
||||||
// account for BTS tied up in market orders
|
auto call_order_index = d.get_index_type<graphene::chain::call_order_index>().indices();
|
||||||
auto limit_order_index = d.get_index_type<graphene::chain::limit_order_index>().indices();
|
for (const graphene::chain::call_order_object& call_order : call_order_index)
|
||||||
for (const graphene::chain::limit_order_object& limit_order : limit_order_index)
|
if (call_order.get_collateral().asset_id == graphene::chain::asset_id_type())
|
||||||
if (limit_order.amount_for_sale().asset_id == graphene::chain::asset_id_type())
|
|
||||||
{
|
|
||||||
graphene::chain::share_type limit_order_amount = limit_order.amount_for_sale().amount;
|
|
||||||
if (limit_order_amount > 0 && !exclude_account_from_sharedrop(d, limit_order.seller))
|
|
||||||
{
|
|
||||||
total_bts_balance += limit_order_amount;
|
|
||||||
|
|
||||||
auto my_balance_iter = db_balances.find(limit_order.seller);
|
|
||||||
if (my_balance_iter == db_balances.end())
|
|
||||||
{
|
|
||||||
my_account_balance_object balance_object;
|
|
||||||
balance_object.account_id = limit_order.seller;
|
|
||||||
balance_object.orders = limit_order_amount;
|
|
||||||
db_balances.insert(balance_object);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
db_balances.modify(my_balance_iter, [&](my_account_balance_object& balance_object) {
|
|
||||||
balance_object.orders += limit_order_amount;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// account for BTS tied up in collateral for SmartCoins
|
|
||||||
auto call_order_index = d.get_index_type<graphene::chain::call_order_index>().indices();
|
|
||||||
for (const graphene::chain::call_order_object& call_order : call_order_index)
|
|
||||||
if (call_order.get_collateral().asset_id == graphene::chain::asset_id_type())
|
|
||||||
{
|
|
||||||
graphene::chain::share_type call_order_amount = call_order.get_collateral().amount;
|
|
||||||
if (call_order_amount > 0 && !exclude_account_from_sharedrop(d, call_order.borrower))
|
|
||||||
{
|
|
||||||
total_bts_balance += call_order_amount;
|
|
||||||
|
|
||||||
auto my_balance_iter = db_balances.find(call_order.borrower);
|
|
||||||
if (my_balance_iter == db_balances.end())
|
|
||||||
{
|
|
||||||
my_account_balance_object balance_object;
|
|
||||||
balance_object.account_id = call_order.borrower;
|
|
||||||
balance_object.collateral = call_order_amount;
|
|
||||||
db_balances.insert(balance_object);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
db_balances.modify(my_balance_iter, [&](my_account_balance_object& balance_object) {
|
|
||||||
balance_object.collateral += call_order_amount;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// account available-but-unclaimed BTS in vesting balances
|
|
||||||
auto vesting_balance_index = d.get_index_type<graphene::chain::vesting_balance_index>().indices();
|
|
||||||
for (const graphene::chain::vesting_balance_object& vesting_balance : vesting_balance_index)
|
|
||||||
if (vesting_balance.balance.asset_id == graphene::chain::asset_id_type())
|
|
||||||
{
|
|
||||||
graphene::chain::share_type vesting_balance_amount = vesting_balance.get_allowed_withdraw(d.head_block_time()).amount;
|
|
||||||
if (vesting_balance_amount > 0 && !exclude_account_from_sharedrop(d, vesting_balance.owner))
|
|
||||||
{
|
|
||||||
total_bts_balance += vesting_balance_amount;
|
|
||||||
|
|
||||||
auto my_balance_iter = db_balances.find(vesting_balance.owner);
|
|
||||||
if (my_balance_iter == db_balances.end())
|
|
||||||
{
|
|
||||||
my_account_balance_object balance_object;
|
|
||||||
balance_object.account_id = vesting_balance.owner;
|
|
||||||
balance_object.vesting = vesting_balance_amount;
|
|
||||||
db_balances.insert(balance_object);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
db_balances.modify(my_balance_iter, [&](my_account_balance_object& balance_object) {
|
|
||||||
balance_object.vesting += vesting_balance_amount;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
graphene::chain::share_type total_shares_dropped;
|
|
||||||
|
|
||||||
// Now, we assume we're distributing balances to all BTS holders proportionally, figure
|
|
||||||
// the smallest balance we can distribute and still assign the user a satoshi of the share drop
|
|
||||||
graphene::chain::share_type effective_total_bts_balance;
|
|
||||||
auto& by_effective_balance_index = db_balances.get<by_effective_balance>();
|
|
||||||
auto balance_iter = by_effective_balance_index.begin();
|
|
||||||
for (; balance_iter != by_effective_balance_index.end(); ++balance_iter)
|
|
||||||
{
|
{
|
||||||
fc::uint128 share_drop_amount = total_amount_to_distribute.value;
|
graphene::chain::share_type call_order_amount = call_order.get_collateral().amount;
|
||||||
share_drop_amount *= balance_iter->get_effective_balance().value;
|
if (call_order_amount > 0 && !exclude_account_from_sharedrop(d, call_order.borrower))
|
||||||
share_drop_amount /= total_bts_balance.value;
|
{
|
||||||
if (!share_drop_amount.to_uint64())
|
total_bts_balance += call_order_amount;
|
||||||
break; // balances are decreasing, so every balance after will also round to zero
|
|
||||||
total_shares_dropped += share_drop_amount.to_uint64();
|
auto my_balance_iter = db_balances.find(call_order.borrower);
|
||||||
effective_total_bts_balance += balance_iter->get_effective_balance();
|
if (my_balance_iter == db_balances.end())
|
||||||
|
{
|
||||||
|
my_account_balance_object balance_object;
|
||||||
|
balance_object.account_id = call_order.borrower;
|
||||||
|
balance_object.collateral = call_order_amount;
|
||||||
|
db_balances.insert(balance_object);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
db_balances.modify(my_balance_iter, [&](my_account_balance_object& balance_object) {
|
||||||
|
balance_object.collateral += call_order_amount;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// our iterator is just after the smallest balance we will process,
|
// account available-but-unclaimed BTS in vesting balances
|
||||||
// walk it backwards towards the larger balances, distributing the sharedrop as we go
|
auto vesting_balance_index = d.get_index_type<graphene::chain::vesting_balance_index>().indices();
|
||||||
graphene::chain::share_type remaining_amount_to_distribute = total_amount_to_distribute;
|
for (const graphene::chain::vesting_balance_object& vesting_balance : vesting_balance_index)
|
||||||
graphene::chain::share_type bts_balance_remaining = effective_total_bts_balance;
|
if (vesting_balance.balance.asset_id == graphene::chain::asset_id_type())
|
||||||
|
{
|
||||||
|
graphene::chain::share_type vesting_balance_amount = vesting_balance.get_allowed_withdraw(d.head_block_time()).amount;
|
||||||
|
if (vesting_balance_amount > 0 && !exclude_account_from_sharedrop(d, vesting_balance.owner))
|
||||||
|
{
|
||||||
|
total_bts_balance += vesting_balance_amount;
|
||||||
|
|
||||||
do {
|
auto my_balance_iter = db_balances.find(vesting_balance.owner);
|
||||||
--balance_iter;
|
if (my_balance_iter == db_balances.end())
|
||||||
fc::uint128 share_drop_amount = remaining_amount_to_distribute.value;
|
{
|
||||||
share_drop_amount *= balance_iter->get_effective_balance().value;
|
my_account_balance_object balance_object;
|
||||||
share_drop_amount /= bts_balance_remaining.value;
|
balance_object.account_id = vesting_balance.owner;
|
||||||
graphene::chain::share_type amount_distributed = share_drop_amount.to_uint64();
|
balance_object.vesting = vesting_balance_amount;
|
||||||
|
db_balances.insert(balance_object);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
db_balances.modify(my_balance_iter, [&](my_account_balance_object& balance_object) {
|
||||||
|
balance_object.vesting += vesting_balance_amount;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
by_effective_balance_index.modify(balance_iter, [&](my_account_balance_object& balance_object) {
|
graphene::chain::share_type total_shares_dropped;
|
||||||
balance_object.sharedrop += amount_distributed;
|
|
||||||
});
|
|
||||||
|
|
||||||
remaining_amount_to_distribute -= amount_distributed;
|
// Now, we assume we're distributing balances to all BTS holders proportionally, figure
|
||||||
bts_balance_remaining -= balance_iter->get_effective_balance();
|
// the smallest balance we can distribute and still assign the user a satoshi of the share drop
|
||||||
} while (balance_iter != by_effective_balance_index.begin());
|
graphene::chain::share_type effective_total_bts_balance;
|
||||||
assert(remaining_amount_to_distribute == 0);
|
auto& by_effective_balance_index = db_balances.get<by_effective_balance>();
|
||||||
|
auto balance_iter = by_effective_balance_index.begin();
|
||||||
|
for (; balance_iter != by_effective_balance_index.end(); ++balance_iter)
|
||||||
|
{
|
||||||
|
fc::uint128 share_drop_amount = total_amount_to_distribute.value;
|
||||||
|
share_drop_amount *= balance_iter->get_effective_balance().value;
|
||||||
|
share_drop_amount /= total_bts_balance.value;
|
||||||
|
if (!share_drop_amount.to_uint64())
|
||||||
|
break; // balances are decreasing, so every balance after will also round to zero
|
||||||
|
total_shares_dropped += share_drop_amount.to_uint64();
|
||||||
|
effective_total_bts_balance += balance_iter->get_effective_balance();
|
||||||
|
}
|
||||||
|
|
||||||
std::ofstream logfile;
|
// our iterator is just after the smallest balance we will process,
|
||||||
logfile.open(_csvlog_filename);
|
// walk it backwards towards the larger balances, distributing the sharedrop as we go
|
||||||
assert(logfile.is_open());
|
graphene::chain::share_type remaining_amount_to_distribute = total_amount_to_distribute;
|
||||||
logfile << "name,balance+orders+collateral+vesting,balance,orders,collateral,vesting,sharedrop\n";
|
graphene::chain::share_type bts_balance_remaining = effective_total_bts_balance;
|
||||||
|
|
||||||
|
do {
|
||||||
|
--balance_iter;
|
||||||
|
fc::uint128 share_drop_amount = remaining_amount_to_distribute.value;
|
||||||
|
share_drop_amount *= balance_iter->get_effective_balance().value;
|
||||||
|
share_drop_amount /= bts_balance_remaining.value;
|
||||||
|
graphene::chain::share_type amount_distributed = share_drop_amount.to_uint64();
|
||||||
|
|
||||||
|
by_effective_balance_index.modify(balance_iter, [&](my_account_balance_object& balance_object) {
|
||||||
|
balance_object.sharedrop += amount_distributed;
|
||||||
|
});
|
||||||
|
|
||||||
|
remaining_amount_to_distribute -= amount_distributed;
|
||||||
|
bts_balance_remaining -= balance_iter->get_effective_balance();
|
||||||
|
} while (balance_iter != by_effective_balance_index.begin());
|
||||||
|
assert(remaining_amount_to_distribute == 0);
|
||||||
|
|
||||||
|
std::ofstream logfile;
|
||||||
|
logfile.open(_csvlog_filename);
|
||||||
|
assert(logfile.is_open());
|
||||||
|
logfile << "name,balance+orders+collateral+vesting,balance,orders,collateral,vesting,sharedrop\n";
|
||||||
|
for (const my_account_balance_object& balance : by_effective_balance_index)
|
||||||
|
logfile << balance.account_id(d).name << "," <<
|
||||||
|
balance.get_effective_balance().value << "," <<
|
||||||
|
balance.balance.value << "," <<
|
||||||
|
balance.orders.value << "," <<
|
||||||
|
balance.collateral.value << "," <<
|
||||||
|
balance.vesting.value << "," <<
|
||||||
|
balance.sharedrop.value << "\n";
|
||||||
|
ilog("CSV log written to file ${filename}", ("filename", _csvlog_filename));
|
||||||
|
logfile.close();
|
||||||
|
|
||||||
|
// remove all balance objects with zero sharedrops
|
||||||
|
by_effective_balance_index.erase(by_effective_balance_index.lower_bound(0),
|
||||||
|
by_effective_balance_index.end());
|
||||||
|
|
||||||
|
// inefficient way of crawling the graph, but we only do it once
|
||||||
|
std::set<graphene::chain::account_id_type> already_generated;
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
unsigned accounts_generated_this_round = 0;
|
||||||
for (const my_account_balance_object& balance : by_effective_balance_index)
|
for (const my_account_balance_object& balance : by_effective_balance_index)
|
||||||
logfile << balance.account_id(d).name << "," <<
|
|
||||||
balance.get_effective_balance().value << "," <<
|
|
||||||
balance.balance.value << "," <<
|
|
||||||
balance.orders.value << "," <<
|
|
||||||
balance.collateral.value << "," <<
|
|
||||||
balance.vesting.value << "," <<
|
|
||||||
balance.sharedrop.value << "\n";
|
|
||||||
ilog("CSV log written to file ${filename}", ("filename", _csvlog_filename));
|
|
||||||
logfile.close();
|
|
||||||
|
|
||||||
// remove all balance objects with zero sharedrops
|
|
||||||
by_effective_balance_index.erase(by_effective_balance_index.lower_bound(0),
|
|
||||||
by_effective_balance_index.end());
|
|
||||||
|
|
||||||
// inefficient way of crawling the graph, but we only do it once
|
|
||||||
std::set<graphene::chain::account_id_type> already_generated;
|
|
||||||
for (;;)
|
|
||||||
{
|
{
|
||||||
unsigned accounts_generated_this_round = 0;
|
const graphene::chain::account_object& account_obj = balance.account_id(d);
|
||||||
for (const my_account_balance_object& balance : by_effective_balance_index)
|
if (already_generated.find(balance.account_id) == already_generated.end())
|
||||||
{
|
{
|
||||||
const graphene::chain::account_object& account_obj = balance.account_id(d);
|
graphene::chain::genesis_state_type::initial_bts_account_type::initial_authority owner;
|
||||||
if (already_generated.find(balance.account_id) == already_generated.end())
|
owner.weight_threshold = account_obj.owner.weight_threshold;
|
||||||
|
owner.key_auths = account_obj.owner.key_auths;
|
||||||
|
for (const auto& value : account_obj.owner.account_auths)
|
||||||
{
|
{
|
||||||
graphene::chain::genesis_state_type::initial_bts_account_type::initial_authority owner;
|
owner.account_auths.insert(std::make_pair(modify_account_name(value.first(d).name), value.second));
|
||||||
owner.weight_threshold = account_obj.owner.weight_threshold;
|
db_balances.insert(my_account_balance_object{value.first}); // make sure the account is generated, even if it has a zero balance
|
||||||
owner.key_auths = account_obj.owner.key_auths;
|
}
|
||||||
for (const auto& value : account_obj.owner.account_auths)
|
owner.key_auths = account_obj.owner.key_auths;
|
||||||
{
|
owner.address_auths = account_obj.owner.address_auths;
|
||||||
owner.account_auths.insert(std::make_pair(modify_account_name(value.first(d).name), value.second));
|
|
||||||
db_balances.insert(my_account_balance_object{value.first}); // make sure the account is generated, even if it has a zero balance
|
|
||||||
}
|
|
||||||
owner.key_auths = account_obj.owner.key_auths;
|
|
||||||
owner.address_auths = account_obj.owner.address_auths;
|
|
||||||
|
|
||||||
graphene::chain::genesis_state_type::initial_bts_account_type::initial_authority active;
|
graphene::chain::genesis_state_type::initial_bts_account_type::initial_authority active;
|
||||||
active.weight_threshold = account_obj.active.weight_threshold;
|
active.weight_threshold = account_obj.active.weight_threshold;
|
||||||
active.key_auths = account_obj.active.key_auths;
|
active.key_auths = account_obj.active.key_auths;
|
||||||
for (const auto& value : account_obj.active.account_auths)
|
for (const auto& value : account_obj.active.account_auths)
|
||||||
{
|
{
|
||||||
active.account_auths.insert(std::make_pair(modify_account_name(value.first(d).name), value.second));
|
active.account_auths.insert(std::make_pair(modify_account_name(value.first(d).name), value.second));
|
||||||
db_balances.insert(my_account_balance_object{value.first}); // make sure the account is generated, even if it has a zero balance
|
db_balances.insert(my_account_balance_object{value.first}); // make sure the account is generated, even if it has a zero balance
|
||||||
}
|
}
|
||||||
active.key_auths = account_obj.active.key_auths;
|
active.key_auths = account_obj.active.key_auths;
|
||||||
active.address_auths = account_obj.active.address_auths;
|
active.address_auths = account_obj.active.address_auths;
|
||||||
|
|
||||||
new_genesis_state.initial_bts_accounts.emplace_back(
|
new_genesis_state.initial_bts_accounts.emplace_back(
|
||||||
graphene::chain::genesis_state_type::initial_bts_account_type(modify_account_name(account_obj.name),
|
graphene::chain::genesis_state_type::initial_bts_account_type(modify_account_name(account_obj.name),
|
||||||
owner, active,
|
owner, active,
|
||||||
balance.sharedrop));
|
balance.sharedrop));
|
||||||
already_generated.insert(balance.account_id);
|
already_generated.insert(balance.account_id);
|
||||||
++accounts_generated_this_round;
|
++accounts_generated_this_round;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (accounts_generated_this_round == 0)
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
fc::json::save_to_file(new_genesis_state, _genesis_filename);
|
if (accounts_generated_this_round == 0)
|
||||||
ilog("New genesis state written to file ${filename}", ("filename", _genesis_filename));
|
break;
|
||||||
} FC_LOG_AND_RETHROW() }
|
}
|
||||||
|
fc::json::save_to_file(new_genesis_state, _genesis_filename);
|
||||||
|
ilog("New genesis state written to file ${filename}", ("filename", _genesis_filename));
|
||||||
|
} FC_LOG_AND_RETHROW() }
|
||||||
|
|
||||||
void generate_genesis_plugin::plugin_shutdown()
|
void generate_genesis_plugin::plugin_shutdown()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,56 +30,56 @@
|
||||||
|
|
||||||
namespace graphene { namespace generate_genesis_plugin {
|
namespace graphene { namespace generate_genesis_plugin {
|
||||||
|
|
||||||
class generate_genesis_plugin : public graphene::app::plugin {
|
class generate_genesis_plugin : public graphene::app::plugin {
|
||||||
public:
|
public:
|
||||||
~generate_genesis_plugin() {
|
~generate_genesis_plugin() {
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string plugin_name()const override;
|
std::string plugin_name()const override;
|
||||||
|
|
||||||
virtual void plugin_set_program_options(
|
virtual void plugin_set_program_options(
|
||||||
boost::program_options::options_description &command_line_options,
|
boost::program_options::options_description &command_line_options,
|
||||||
boost::program_options::options_description &config_file_options
|
boost::program_options::options_description &config_file_options
|
||||||
) override;
|
) override;
|
||||||
|
|
||||||
virtual void plugin_initialize( const boost::program_options::variables_map& options ) override;
|
virtual void plugin_initialize( const boost::program_options::variables_map& options ) override;
|
||||||
virtual void plugin_startup() override;
|
virtual void plugin_startup() override;
|
||||||
virtual void plugin_shutdown() override;
|
virtual void plugin_shutdown() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void block_applied(const graphene::chain::signed_block& b);
|
void block_applied(const graphene::chain::signed_block& b);
|
||||||
void generate_snapshot();
|
void generate_snapshot();
|
||||||
|
|
||||||
boost::program_options::variables_map _options;
|
boost::program_options::variables_map _options;
|
||||||
|
|
||||||
fc::optional<uint32_t> _block_to_snapshot;
|
fc::optional<uint32_t> _block_to_snapshot;
|
||||||
std::string _genesis_filename;
|
std::string _genesis_filename;
|
||||||
std::string _csvlog_filename;
|
std::string _csvlog_filename;
|
||||||
};
|
};
|
||||||
|
|
||||||
class my_account_balance_object
|
class my_account_balance_object
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// constructor copying from base class
|
// constructor copying from base class
|
||||||
//my_account_balance_object(const graphene::chain::account_balance_object& abo) : graphene::chain::account_balance_object(abo) {}
|
//my_account_balance_object(const graphene::chain::account_balance_object& abo) : graphene::chain::account_balance_object(abo) {}
|
||||||
graphene::chain::account_id_type account_id;
|
graphene::chain::account_id_type account_id;
|
||||||
|
|
||||||
graphene::chain::share_type balance;
|
graphene::chain::share_type balance;
|
||||||
graphene::chain::share_type orders;
|
graphene::chain::share_type orders;
|
||||||
graphene::chain::share_type collateral;
|
graphene::chain::share_type collateral;
|
||||||
graphene::chain::share_type vesting;
|
graphene::chain::share_type vesting;
|
||||||
graphene::chain::share_type sharedrop;
|
graphene::chain::share_type sharedrop;
|
||||||
graphene::chain::share_type get_effective_balance() const { return balance + orders + collateral + vesting; }
|
graphene::chain::share_type get_effective_balance() const { return balance + orders + collateral + vesting; }
|
||||||
};
|
};
|
||||||
using namespace boost::multi_index;
|
using namespace boost::multi_index;
|
||||||
struct by_account{};
|
struct by_account{};
|
||||||
struct by_effective_balance{};
|
struct by_effective_balance{};
|
||||||
typedef multi_index_container<my_account_balance_object,
|
typedef multi_index_container<my_account_balance_object,
|
||||||
indexed_by<ordered_unique<tag<by_account>,
|
indexed_by<ordered_unique<tag<by_account>,
|
||||||
member<my_account_balance_object, graphene::chain::account_id_type, &my_account_balance_object::account_id> >,
|
member<my_account_balance_object, graphene::chain::account_id_type, &my_account_balance_object::account_id> >,
|
||||||
ordered_non_unique<tag<by_effective_balance>,
|
ordered_non_unique<tag<by_effective_balance>,
|
||||||
const_mem_fun<my_account_balance_object, graphene::chain::share_type, &my_account_balance_object::get_effective_balance>,
|
const_mem_fun<my_account_balance_object, graphene::chain::share_type, &my_account_balance_object::get_effective_balance>,
|
||||||
std::greater<graphene::chain::share_type> > > > my_account_balance_object_index_type;
|
std::greater<graphene::chain::share_type> > > > my_account_balance_object_index_type;
|
||||||
|
|
||||||
|
|
||||||
} } //graphene::generate_genesis_plugin
|
} } //graphene::generate_genesis_plugin
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,17 @@
|
||||||
file(GLOB HEADERS "include/graphene/generate_uia_sharedrop_genesis/*.hpp")
|
file(GLOB HEADERS "include/graphene/generate_uia_sharedrop_genesis/*.hpp")
|
||||||
|
|
||||||
add_library( graphene_generate_uia_sharedrop_genesis
|
add_library( graphene_generate_uia_sharedrop_genesis
|
||||||
generate_uia_sharedrop_genesis.cpp
|
generate_uia_sharedrop_genesis.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries( graphene_generate_uia_sharedrop_genesis graphene_chain graphene_app graphene_time )
|
target_link_libraries( graphene_generate_uia_sharedrop_genesis graphene_chain graphene_app graphene_time )
|
||||||
target_include_directories( graphene_generate_uia_sharedrop_genesis
|
target_include_directories( graphene_generate_uia_sharedrop_genesis
|
||||||
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" )
|
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" )
|
||||||
|
|
||||||
install( TARGETS
|
install( TARGETS
|
||||||
graphene_generate_uia_sharedrop_genesis
|
graphene_generate_uia_sharedrop_genesis
|
||||||
|
|
||||||
RUNTIME DESTINATION bin
|
RUNTIME DESTINATION bin
|
||||||
LIBRARY DESTINATION lib
|
LIBRARY DESTINATION lib
|
||||||
ARCHIVE DESTINATION lib
|
ARCHIVE DESTINATION lib
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -47,11 +47,11 @@ void generate_uia_sharedrop_genesis_plugin::plugin_set_program_options(boost::pr
|
||||||
boost::program_options::options_description& config_file_options)
|
boost::program_options::options_description& config_file_options)
|
||||||
{
|
{
|
||||||
command_line_options.add_options()
|
command_line_options.add_options()
|
||||||
("input-uia-sharedrop-genesis-file", bpo::value<std::string>()->default_value("genesis.json"), "Genesis file to read")
|
("input-uia-sharedrop-genesis-file", bpo::value<std::string>()->default_value("genesis.json"), "Genesis file to read")
|
||||||
("output-uia-sharedrop-genesis-file", bpo::value<std::string>()->default_value("genesis.json"), "Genesis file to create")
|
("output-uia-sharedrop-genesis-file", bpo::value<std::string>()->default_value("genesis.json"), "Genesis file to create")
|
||||||
("output-uia-sharedrop-csvlog-file", bpo::value<std::string>()->default_value("log.csv"), "CSV log file to create")
|
("output-uia-sharedrop-csvlog-file", bpo::value<std::string>()->default_value("log.csv"), "CSV log file to create")
|
||||||
("uia-sharedrop-snapshot-block-number", bpo::value<uint32_t>(), "Block number at which to snapshot balances")
|
("uia-sharedrop-snapshot-block-number", bpo::value<uint32_t>(), "Block number at which to snapshot balances")
|
||||||
;
|
;
|
||||||
config_file_options.add(command_line_options);
|
config_file_options.add(command_line_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -128,38 +128,38 @@ namespace
|
||||||
bool is_scam(const std::string& account_name)
|
bool is_scam(const std::string& account_name)
|
||||||
{
|
{
|
||||||
static std::set<std::string> scam_accounts{
|
static std::set<std::string> scam_accounts{
|
||||||
"polonie-wallet",
|
"polonie-wallet",
|
||||||
"polonie-xwallet",
|
"polonie-xwallet",
|
||||||
"poloniewallet",
|
"poloniewallet",
|
||||||
"poloniex-deposit",
|
"poloniex-deposit",
|
||||||
"poloniex-wallet",
|
"poloniex-wallet",
|
||||||
"poloniexwall-et",
|
"poloniexwall-et",
|
||||||
"poloniexwallett",
|
"poloniexwallett",
|
||||||
"poloniexwall-t",
|
"poloniexwall-t",
|
||||||
"poloniexwalle",
|
"poloniexwalle",
|
||||||
"poloniex",
|
"poloniex",
|
||||||
"poloneix",
|
"poloneix",
|
||||||
"poloniex1",
|
"poloniex1",
|
||||||
"bittrex-deopsit",
|
"bittrex-deopsit",
|
||||||
"bittrex-deposi",
|
"bittrex-deposi",
|
||||||
"bittrex-depositt",
|
"bittrex-depositt",
|
||||||
"bittrex-dposit",
|
"bittrex-dposit",
|
||||||
"bittrex",
|
"bittrex",
|
||||||
"bittrex-deposits",
|
"bittrex-deposits",
|
||||||
"coinbase",
|
"coinbase",
|
||||||
"blocktrade",
|
"blocktrade",
|
||||||
"locktrades",
|
"locktrades",
|
||||||
"yun.bts",
|
"yun.bts",
|
||||||
"transwiser-walle",
|
"transwiser-walle",
|
||||||
"transwiser-wallets",
|
"transwiser-wallets",
|
||||||
"ranswiser-wallet",
|
"ranswiser-wallet",
|
||||||
"yun.btc",
|
"yun.btc",
|
||||||
"pay.coinbase.com",
|
"pay.coinbase.com",
|
||||||
"pay.bts.com",
|
"pay.bts.com",
|
||||||
"btc38.com",
|
"btc38.com",
|
||||||
"yunbi.com",
|
"yunbi.com",
|
||||||
"coinbase.com",
|
"coinbase.com",
|
||||||
"ripple.com"
|
"ripple.com"
|
||||||
};
|
};
|
||||||
return scam_accounts.find(account_name) != scam_accounts.end();
|
return scam_accounts.find(account_name) != scam_accounts.end();
|
||||||
}
|
}
|
||||||
|
|
@ -167,14 +167,14 @@ namespace
|
||||||
bool is_exchange(const std::string& account_name)
|
bool is_exchange(const std::string& account_name)
|
||||||
{
|
{
|
||||||
static std::set<std::string> exchange_accounts{
|
static std::set<std::string> exchange_accounts{
|
||||||
"poloniexcoldstorage",
|
"poloniexcoldstorage",
|
||||||
"btc38-public-for-bts-cold",
|
"btc38-public-for-bts-cold",
|
||||||
"poloniexwallet",
|
"poloniexwallet",
|
||||||
"btercom",
|
"btercom",
|
||||||
"yunbi-cold-wallet",
|
"yunbi-cold-wallet",
|
||||||
"btc38-btsx-octo-72722",
|
"btc38-btsx-octo-72722",
|
||||||
"bittrex-deposit",
|
"bittrex-deposit",
|
||||||
"btc38btsxwithdrawal"
|
"btc38btsxwithdrawal"
|
||||||
};
|
};
|
||||||
return exchange_accounts.find(account_name) != exchange_accounts.end();
|
return exchange_accounts.find(account_name) != exchange_accounts.end();
|
||||||
}
|
}
|
||||||
|
|
@ -342,9 +342,9 @@ void generate_uia_sharedrop_genesis_plugin::generate_snapshot()
|
||||||
active.address_auths = account_obj.active.address_auths;
|
active.address_auths = account_obj.active.address_auths;
|
||||||
|
|
||||||
new_genesis_state.initial_bts_accounts.emplace_back(
|
new_genesis_state.initial_bts_accounts.emplace_back(
|
||||||
graphene::chain::genesis_state_type::initial_bts_account_type(modify_account_name(account_obj.name),
|
graphene::chain::genesis_state_type::initial_bts_account_type(modify_account_name(account_obj.name),
|
||||||
owner, active,
|
owner, active,
|
||||||
sharedrop_amount));
|
sharedrop_amount));
|
||||||
already_generated.insert(account_id);
|
already_generated.insert(account_id);
|
||||||
++accounts_generated_this_round;
|
++accounts_generated_this_round;
|
||||||
}
|
}
|
||||||
|
|
@ -359,3 +359,4 @@ void generate_uia_sharedrop_genesis_plugin::generate_snapshot()
|
||||||
void generate_uia_sharedrop_genesis_plugin::plugin_shutdown()
|
void generate_uia_sharedrop_genesis_plugin::plugin_shutdown()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,50 +30,50 @@
|
||||||
|
|
||||||
namespace graphene { namespace generate_uia_sharedrop_genesis {
|
namespace graphene { namespace generate_uia_sharedrop_genesis {
|
||||||
|
|
||||||
class generate_uia_sharedrop_genesis_plugin : public graphene::app::plugin {
|
class generate_uia_sharedrop_genesis_plugin : public graphene::app::plugin {
|
||||||
public:
|
public:
|
||||||
~generate_uia_sharedrop_genesis_plugin() {
|
~generate_uia_sharedrop_genesis_plugin() {
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string plugin_name()const override;
|
std::string plugin_name()const override;
|
||||||
|
|
||||||
virtual void plugin_set_program_options(
|
virtual void plugin_set_program_options(
|
||||||
boost::program_options::options_description &command_line_options,
|
boost::program_options::options_description &command_line_options,
|
||||||
boost::program_options::options_description &config_file_options
|
boost::program_options::options_description &config_file_options
|
||||||
) override;
|
) override;
|
||||||
|
|
||||||
virtual void plugin_initialize( const boost::program_options::variables_map& options ) override;
|
virtual void plugin_initialize( const boost::program_options::variables_map& options ) override;
|
||||||
virtual void plugin_startup() override;
|
virtual void plugin_startup() override;
|
||||||
virtual void plugin_shutdown() override;
|
virtual void plugin_shutdown() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void block_applied(const graphene::chain::signed_block& b);
|
void block_applied(const graphene::chain::signed_block& b);
|
||||||
void generate_snapshot();
|
void generate_snapshot();
|
||||||
|
|
||||||
boost::program_options::variables_map _options;
|
boost::program_options::variables_map _options;
|
||||||
|
|
||||||
fc::optional<uint32_t> _block_to_snapshot;
|
fc::optional<uint32_t> _block_to_snapshot;
|
||||||
std::string _input_genesis_filename;
|
std::string _input_genesis_filename;
|
||||||
std::string _output_genesis_filename;
|
std::string _output_genesis_filename;
|
||||||
std::string _csvlog_filename;
|
std::string _csvlog_filename;
|
||||||
};
|
};
|
||||||
|
|
||||||
class uia_sharedrop_balance_object
|
class uia_sharedrop_balance_object
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
graphene::chain::account_id_type account_id;
|
graphene::chain::account_id_type account_id;
|
||||||
|
|
||||||
graphene::chain::share_type genesis;
|
graphene::chain::share_type genesis;
|
||||||
graphene::chain::share_type balance;
|
graphene::chain::share_type balance;
|
||||||
graphene::chain::share_type orders;
|
graphene::chain::share_type orders;
|
||||||
|
|
||||||
graphene::chain::share_type sharedrop;
|
graphene::chain::share_type sharedrop;
|
||||||
};
|
};
|
||||||
|
|
||||||
using namespace boost::multi_index;
|
using namespace boost::multi_index;
|
||||||
struct by_account{};
|
struct by_account{};
|
||||||
typedef multi_index_container<uia_sharedrop_balance_object,
|
typedef multi_index_container<uia_sharedrop_balance_object,
|
||||||
indexed_by<ordered_unique<tag<by_account>,
|
indexed_by<ordered_unique<tag<by_account>,
|
||||||
member<uia_sharedrop_balance_object, graphene::chain::account_id_type, &uia_sharedrop_balance_object::account_id> > > > uia_sharedrop_balance_object_index_type;
|
member<uia_sharedrop_balance_object, graphene::chain::account_id_type, &uia_sharedrop_balance_object::account_id> > > > uia_sharedrop_balance_object_index_type;
|
||||||
|
|
||||||
} } //graphene::generate_uia_sharedrop_genesis_plugin
|
} } //graphene::generate_uia_sharedrop_genesis_plugin
|
||||||
|
|
|
||||||
|
|
@ -583,7 +583,7 @@ class wallet_api
|
||||||
/**
|
/**
|
||||||
* @param role - active | owner | memo
|
* @param role - active | owner | memo
|
||||||
*/
|
*/
|
||||||
pair<public_key_type,string> get_private_key_from_password( string password, string account, string role )const;
|
pair<public_key_type,string> get_private_key_from_password( string account, string role, string password )const;
|
||||||
|
|
||||||
/** Converts a signed_transaction in JSON form to its binary representation.
|
/** Converts a signed_transaction in JSON form to its binary representation.
|
||||||
*
|
*
|
||||||
|
|
@ -1348,38 +1348,39 @@ class wallet_api
|
||||||
string witness,
|
string witness,
|
||||||
bool approve,
|
bool approve,
|
||||||
bool broadcast = false);
|
bool broadcast = false);
|
||||||
/** Change your witness votes.
|
|
||||||
|
/** Change your witness votes.
|
||||||
*
|
*
|
||||||
* An account can publish a list of all witnesses they approve of.
|
* An account can publish a list of all witnesses they approve of.
|
||||||
* Each account's vote is weighted according to the number of shares of the
|
* Each account's vote is weighted according to the number of shares of the
|
||||||
* core asset owned by that account at the time the votes are tallied.
|
* core asset owned by that account at the time the votes are tallied.
|
||||||
* This command allows you to add or remove one or more witnesses from this list
|
* This command allows you to add or remove one or more witnesses from this list
|
||||||
* in one call. When you are changing your vote on several witnesses, this
|
* in one call. When you are changing your vote on several witnesses, this
|
||||||
* may be easier than multiple `vote_for_witness` and
|
* may be easier than multiple `vote_for_witness` and
|
||||||
* `set_desired_witness_and_committee_member_count` calls.
|
* `set_desired_witness_and_committee_member_count` calls.
|
||||||
*
|
*
|
||||||
* @note you cannot vote against a witness, you can only vote for the witness
|
* @note you cannot vote against a witness, you can only vote for the witness
|
||||||
* or not vote for the witness.
|
* or not vote for the witness.
|
||||||
*
|
*
|
||||||
* @param voting_account the name or id of the account who is voting with their shares
|
* @param voting_account the name or id of the account who is voting with their shares
|
||||||
* @param witnesses_to_approve the names or ids of the witnesses owner accounts you wish
|
* @param witnesses_to_approve the names or ids of the witnesses owner accounts you wish
|
||||||
* to approve (these will be added to the list of witnesses
|
* to approve (these will be added to the list of witnesses
|
||||||
* you currently approve). This list can be empty.
|
* you currently approve). This list can be empty.
|
||||||
* @param witnesses_to_reject the names or ids of the witnesses owner accounts you wish
|
* @param witnesses_to_reject the names or ids of the witnesses owner accounts you wish
|
||||||
* to reject (these will be removed fromthe list of witnesses
|
* to reject (these will be removed fromthe list of witnesses
|
||||||
* you currently approve). This list can be empty.
|
* you currently approve). This list can be empty.
|
||||||
* @param desired_number_of_witnesses the number of witnesses you believe the network
|
* @param desired_number_of_witnesses the number of witnesses you believe the network
|
||||||
* should have. You must vote for at least this many
|
* should have. You must vote for at least this many
|
||||||
* witnesses. You can set this to 0 to abstain from
|
* witnesses. You can set this to 0 to abstain from
|
||||||
* voting on the number of witnesses.
|
* voting on the number of witnesses.
|
||||||
* @param broadcast true if you wish to broadcast the transaction
|
* @param broadcast true if you wish to broadcast the transaction
|
||||||
* @return the signed transaction changing your vote for the given witnesses
|
* @return the signed transaction changing your vote for the given witnesses
|
||||||
*/
|
*/
|
||||||
signed_transaction update_witness_votes(string voting_account,
|
signed_transaction update_witness_votes(string voting_account,
|
||||||
std::vector<std::string> witnesses_to_approve,
|
std::vector<std::string> witnesses_to_approve,
|
||||||
std::vector<std::string> witnesses_to_reject,
|
std::vector<std::string> witnesses_to_reject,
|
||||||
uint16_t desired_number_of_witnesses,
|
uint16_t desired_number_of_witnesses,
|
||||||
bool broadcast = false);
|
bool broadcast = false);
|
||||||
/** Set the voting proxy for an account.
|
/** Set the voting proxy for an account.
|
||||||
*
|
*
|
||||||
* If a user does not wish to take an active part in voting, they can choose
|
* If a user does not wish to take an active part in voting, they can choose
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -70,6 +70,8 @@ int main( int argc, char** argv )
|
||||||
("dev-account-count", bpo::value<uint32_t>()->default_value(0), "Prefix for dev accounts")
|
("dev-account-count", bpo::value<uint32_t>()->default_value(0), "Prefix for dev accounts")
|
||||||
("dev-balance-count", bpo::value<uint32_t>()->default_value(0), "Prefix for dev balances")
|
("dev-balance-count", bpo::value<uint32_t>()->default_value(0), "Prefix for dev balances")
|
||||||
("dev-balance-amount", bpo::value<uint64_t>()->default_value(uint64_t(1000)*uint64_t(1000)*uint64_t(100000)), "Amount in each dev balance")
|
("dev-balance-amount", bpo::value<uint64_t>()->default_value(uint64_t(1000)*uint64_t(1000)*uint64_t(100000)), "Amount in each dev balance")
|
||||||
|
("nop", "just write the genesis file out after reading it in, do not alter any keys or add accounts or balances. used to pretty-print a genesis file")
|
||||||
|
("replace-all-keys", bpo::value<boost::filesystem::path>(), "Replace all keys/addresses in the genesis files with dev keys based on dev-key-prefix and dump the new keys to this filename.")
|
||||||
;
|
;
|
||||||
|
|
||||||
bpo::variables_map options;
|
bpo::variables_map options;
|
||||||
|
|
@ -116,54 +118,134 @@ int main( int argc, char** argv )
|
||||||
genesis = graphene::app::detail::create_example_genesis();
|
genesis = graphene::app::detail::create_example_genesis();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string dev_key_prefix = options["dev-key-prefix"].as<std::string>();
|
if (!options.count("nop"))
|
||||||
|
|
||||||
auto get_dev_key = [&]( std::string prefix, uint32_t i ) -> public_key_type
|
|
||||||
{
|
{
|
||||||
return fc::ecc::private_key::regenerate( fc::sha256::hash( dev_key_prefix + prefix + std::to_string(i) ) ).get_public_key();
|
std::string dev_key_prefix = options["dev-key-prefix"].as<std::string>();
|
||||||
};
|
auto get_dev_key = [&]( std::string prefix, uint32_t i ) -> public_key_type
|
||||||
|
|
||||||
uint32_t dev_account_count = options["dev-account-count"].as<uint32_t>();
|
|
||||||
std::string dev_account_prefix = options["dev-account-prefix"].as<std::string>();
|
|
||||||
for(uint32_t i=0;i<dev_account_count;i++)
|
|
||||||
{
|
|
||||||
genesis_state_type::initial_account_type acct(
|
|
||||||
dev_account_prefix+std::to_string(i),
|
|
||||||
get_dev_key( "owner-", i ),
|
|
||||||
get_dev_key( "active-", i ),
|
|
||||||
false );
|
|
||||||
|
|
||||||
genesis.initial_accounts.push_back( acct );
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t dev_balance_count = options["dev-balance-count"].as<uint32_t>();
|
|
||||||
uint64_t dev_balance_amount = options["dev-balance-amount"].as<uint64_t>();
|
|
||||||
for(uint32_t i=0;i<dev_balance_count;i++)
|
|
||||||
{
|
|
||||||
genesis_state_type::initial_balance_type bal;
|
|
||||||
bal.owner = address( get_dev_key( "balance-", i ) );
|
|
||||||
bal.asset_symbol = "CORE";
|
|
||||||
bal.amount = dev_balance_amount;
|
|
||||||
genesis.initial_balances.push_back( bal );
|
|
||||||
}
|
|
||||||
|
|
||||||
std::map< std::string, size_t > name2index;
|
|
||||||
size_t num_accounts = genesis.initial_accounts.size();
|
|
||||||
for( size_t i=0; i<num_accounts; i++ )
|
|
||||||
name2index[ genesis.initial_accounts[i].name ] = i;
|
|
||||||
|
|
||||||
for( uint32_t i=0; i<genesis.initial_active_witnesses; i++ )
|
|
||||||
{
|
|
||||||
genesis_state_type::initial_witness_type& wit = genesis.initial_witness_candidates[ i ];
|
|
||||||
genesis_state_type::initial_account_type& wit_acct = genesis.initial_accounts[ name2index[ wit.owner_name ] ];
|
|
||||||
if( wit.owner_name.substr(0, 4) != "init" )
|
|
||||||
{
|
{
|
||||||
std::cerr << "need " << genesis.initial_active_witnesses << " init accounts as first entries in initial_active_witnesses\n";
|
return fc::ecc::private_key::regenerate( fc::sha256::hash( dev_key_prefix + prefix + std::to_string(i) ) ).get_public_key();
|
||||||
return 1;
|
};
|
||||||
|
|
||||||
|
if (options.count("replace-all-keys"))
|
||||||
|
{
|
||||||
|
unsigned dev_keys_used = 0;
|
||||||
|
std::map<std::string, fc::ecc::private_key> replacement_keys;
|
||||||
|
auto get_replacement_key = [&](const std::string& original_key) -> fc::ecc::private_key {
|
||||||
|
auto iter = replacement_keys.find(original_key);
|
||||||
|
if (iter != replacement_keys.end())
|
||||||
|
return iter->second;
|
||||||
|
fc::ecc::private_key new_private_key = fc::ecc::private_key::regenerate(fc::sha256::hash(dev_key_prefix + std::to_string(dev_keys_used++)));
|
||||||
|
replacement_keys[original_key] = new_private_key;
|
||||||
|
return new_private_key;
|
||||||
|
};
|
||||||
|
|
||||||
|
for (genesis_state_type::initial_balance_type& initial_balance : genesis.initial_balances)
|
||||||
|
{
|
||||||
|
std::string address_string = (std::string)initial_balance.owner;
|
||||||
|
initial_balance.owner = address(get_replacement_key(address_string).get_public_key());
|
||||||
|
}
|
||||||
|
|
||||||
|
for (genesis_state_type::initial_vesting_balance_type& initial_balance : genesis.initial_vesting_balances)
|
||||||
|
{
|
||||||
|
std::string address_string = (std::string)initial_balance.owner;
|
||||||
|
initial_balance.owner = address(get_replacement_key(address_string).get_public_key());
|
||||||
|
}
|
||||||
|
|
||||||
|
for (genesis_state_type::initial_witness_type& initial_witness : genesis.initial_witness_candidates)
|
||||||
|
{
|
||||||
|
std::string public_key_string = (std::string)initial_witness.block_signing_key;
|
||||||
|
initial_witness.block_signing_key = get_replacement_key(public_key_string).get_public_key();
|
||||||
|
}
|
||||||
|
|
||||||
|
for (genesis_state_type::initial_account_type& initial_account : genesis.initial_accounts)
|
||||||
|
{
|
||||||
|
std::string public_key_string = (std::string)initial_account.owner_key;
|
||||||
|
initial_account.owner_key = get_replacement_key(public_key_string).get_public_key();
|
||||||
|
public_key_string = (std::string)initial_account.active_key;
|
||||||
|
initial_account.active_key = get_replacement_key(public_key_string).get_public_key();
|
||||||
|
}
|
||||||
|
|
||||||
|
for (genesis_state_type::initial_bts_account_type& initial_account : genesis.initial_bts_accounts)
|
||||||
|
{
|
||||||
|
for (auto iter = initial_account.owner_authority.key_auths.begin();
|
||||||
|
iter != initial_account.owner_authority.key_auths.end(); ++iter)
|
||||||
|
{
|
||||||
|
std::string public_key_string = (std::string)iter->first;
|
||||||
|
iter->first = get_replacement_key(public_key_string).get_public_key();
|
||||||
|
}
|
||||||
|
for (auto iter = initial_account.active_authority.key_auths.begin();
|
||||||
|
iter != initial_account.active_authority.key_auths.end(); ++iter)
|
||||||
|
{
|
||||||
|
std::string public_key_string = (std::string)iter->first;
|
||||||
|
iter->first = get_replacement_key(public_key_string).get_public_key();
|
||||||
|
}
|
||||||
|
for (auto iter = initial_account.owner_authority.address_auths.begin();
|
||||||
|
iter != initial_account.owner_authority.address_auths.end(); ++iter)
|
||||||
|
{
|
||||||
|
std::string address_string = (std::string)iter->first;
|
||||||
|
iter->first = address(get_replacement_key(address_string).get_public_key());
|
||||||
|
}
|
||||||
|
for (auto iter = initial_account.active_authority.address_auths.begin();
|
||||||
|
iter != initial_account.active_authority.address_auths.end(); ++iter)
|
||||||
|
{
|
||||||
|
std::string address_string = (std::string)iter->first;
|
||||||
|
iter->first = address(get_replacement_key(address_string).get_public_key());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fc::path keys_csv_path = options["replace-all-keys"].as<boost::filesystem::path>();
|
||||||
|
std::ofstream keys_csv(keys_csv_path.string());
|
||||||
|
keys_csv << "wif_private_key,public_key,address\n";
|
||||||
|
for (const auto& value : replacement_keys)
|
||||||
|
keys_csv << graphene::utilities::key_to_wif(value.second) << "," << std::string(public_key_type(value.second.get_public_key()))
|
||||||
|
<< "," << std::string(address(value.second.get_public_key())) << "\n";
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
uint32_t dev_account_count = options["dev-account-count"].as<uint32_t>();
|
||||||
|
std::string dev_account_prefix = options["dev-account-prefix"].as<std::string>();
|
||||||
|
for(uint32_t i=0;i<dev_account_count;i++)
|
||||||
|
{
|
||||||
|
genesis_state_type::initial_account_type acct(
|
||||||
|
dev_account_prefix+std::to_string(i),
|
||||||
|
get_dev_key( "owner-", i ),
|
||||||
|
get_dev_key( "active-", i ),
|
||||||
|
false );
|
||||||
|
|
||||||
|
genesis.initial_accounts.push_back( acct );
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t dev_balance_count = options["dev-balance-count"].as<uint32_t>();
|
||||||
|
uint64_t dev_balance_amount = options["dev-balance-amount"].as<uint64_t>();
|
||||||
|
for(uint32_t i=0;i<dev_balance_count;i++)
|
||||||
|
{
|
||||||
|
genesis_state_type::initial_balance_type bal;
|
||||||
|
bal.owner = address( get_dev_key( "balance-", i ) );
|
||||||
|
bal.asset_symbol = "CORE";
|
||||||
|
bal.amount = dev_balance_amount;
|
||||||
|
genesis.initial_balances.push_back( bal );
|
||||||
|
}
|
||||||
|
|
||||||
|
std::map< std::string, size_t > name2index;
|
||||||
|
size_t num_accounts = genesis.initial_accounts.size();
|
||||||
|
for( size_t i=0; i<num_accounts; i++ )
|
||||||
|
name2index[ genesis.initial_accounts[i].name ] = i;
|
||||||
|
|
||||||
|
for( uint32_t i=0; i<genesis.initial_active_witnesses; i++ )
|
||||||
|
{
|
||||||
|
genesis_state_type::initial_witness_type& wit = genesis.initial_witness_candidates[ i ];
|
||||||
|
genesis_state_type::initial_account_type& wit_acct = genesis.initial_accounts[ name2index[ wit.owner_name ] ];
|
||||||
|
if( wit.owner_name.substr(0, 4) != "init" )
|
||||||
|
{
|
||||||
|
std::cerr << "need " << genesis.initial_active_witnesses << " init accounts as first entries in initial_active_witnesses\n";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
wit.block_signing_key = get_dev_key( "wit-block-signing-", i );
|
||||||
|
wit_acct.owner_key = get_dev_key( "wit-owner-", i );
|
||||||
|
wit_acct.active_key = get_dev_key( "wit-active-", i );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
wit.block_signing_key = get_dev_key( "wit-block-signing-", i );
|
|
||||||
wit_acct.owner_key = get_dev_key( "wit-owner-", i );
|
|
||||||
wit_acct.active_key = get_dev_key( "wit-active-", i );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fc::path output_filename = options["out"].as<boost::filesystem::path>();
|
fc::path output_filename = options["out"].as<boost::filesystem::path>();
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ endif()
|
||||||
|
|
||||||
# We have to link against graphene_debug_witness because deficiency in our API infrastructure doesn't allow plugins to be fully abstracted #246
|
# We have to link against graphene_debug_witness because deficiency in our API infrastructure doesn't allow plugins to be fully abstracted #246
|
||||||
target_link_libraries( witness_node
|
target_link_libraries( witness_node
|
||||||
PRIVATE graphene_app graphene_account_history graphene_market_history graphene_witness graphene_chain graphene_debug_witness graphene_egenesis_full fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} )
|
PRIVATE graphene_app graphene_account_history graphene_market_history graphene_witness graphene_chain graphene_debug_witness graphene_egenesis_full fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} )
|
||||||
# also add dependencies to graphene_generate_genesis graphene_generate_uia_sharedrop_genesis if you want those plugins
|
# also add dependencies to graphene_generate_genesis graphene_generate_uia_sharedrop_genesis if you want those plugins
|
||||||
|
|
||||||
install( TARGETS
|
install( TARGETS
|
||||||
|
|
|
||||||
|
|
@ -67,9 +67,9 @@ int main(int argc, char** argv) {
|
||||||
bpo::options_description app_options("Graphene Witness Node");
|
bpo::options_description app_options("Graphene Witness Node");
|
||||||
bpo::options_description cfg_options("Graphene Witness Node");
|
bpo::options_description cfg_options("Graphene Witness Node");
|
||||||
app_options.add_options()
|
app_options.add_options()
|
||||||
("help,h", "Print this help message and exit.")
|
("help,h", "Print this help message and exit.")
|
||||||
("data-dir,d", bpo::value<boost::filesystem::path>()->default_value("witness_node_data_dir"), "Directory containing databases, configuration file, etc.")
|
("data-dir,d", bpo::value<boost::filesystem::path>()->default_value("witness_node_data_dir"), "Directory containing databases, configuration file, etc.")
|
||||||
;
|
;
|
||||||
|
|
||||||
bpo::variables_map options;
|
bpo::variables_map options;
|
||||||
|
|
||||||
|
|
@ -89,8 +89,8 @@ int main(int argc, char** argv) {
|
||||||
}
|
}
|
||||||
catch (const boost::program_options::error& e)
|
catch (const boost::program_options::error& e)
|
||||||
{
|
{
|
||||||
std::cerr << "Error parsing command line: " << e.what() << "\n";
|
std::cerr << "Error parsing command line: " << e.what() << "\n";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( options.count("help") )
|
if( options.count("help") )
|
||||||
|
|
@ -171,13 +171,13 @@ int main(int argc, char** argv) {
|
||||||
fc::promise<int>::ptr exit_promise = new fc::promise<int>("UNIX Signal Handler");
|
fc::promise<int>::ptr exit_promise = new fc::promise<int>("UNIX Signal Handler");
|
||||||
|
|
||||||
fc::set_signal_handler([&exit_promise](int signal) {
|
fc::set_signal_handler([&exit_promise](int signal) {
|
||||||
elog( "Caught SIGINT attempting to exit cleanly" );
|
elog( "Caught SIGINT attempting to exit cleanly" );
|
||||||
exit_promise->set_value(signal);
|
exit_promise->set_value(signal);
|
||||||
}, SIGINT);
|
}, SIGINT);
|
||||||
|
|
||||||
fc::set_signal_handler([&exit_promise](int signal) {
|
fc::set_signal_handler([&exit_promise](int signal) {
|
||||||
elog( "Caught SIGTERM attempting to exit cleanly" );
|
elog( "Caught SIGTERM attempting to exit cleanly" );
|
||||||
exit_promise->set_value(signal);
|
exit_promise->set_value(signal);
|
||||||
}, SIGTERM);
|
}, SIGTERM);
|
||||||
|
|
||||||
ilog("Started witness node on a chain with ${h} blocks.", ("h", node->chain_database()->head_block_num()));
|
ilog("Started witness node on a chain with ${h} blocks.", ("h", node->chain_database()->head_block_num()));
|
||||||
|
|
@ -213,21 +213,21 @@ int main(int argc, char** argv) {
|
||||||
void write_default_logging_config_to_stream(std::ostream& out)
|
void write_default_logging_config_to_stream(std::ostream& out)
|
||||||
{
|
{
|
||||||
out << "# declare an appender named \"stderr\" that writes messages to the console\n"
|
out << "# declare an appender named \"stderr\" that writes messages to the console\n"
|
||||||
"[log.console_appender.stderr]\n"
|
"[log.console_appender.stderr]\n"
|
||||||
"stream=std_error\n\n"
|
"stream=std_error\n\n"
|
||||||
"# declare an appender named \"p2p\" that writes messages to p2p.log\n"
|
"# declare an appender named \"p2p\" that writes messages to p2p.log\n"
|
||||||
"[log.file_appender.p2p]\n"
|
"[log.file_appender.p2p]\n"
|
||||||
"filename=logs/p2p/p2p.log\n"
|
"filename=logs/p2p/p2p.log\n"
|
||||||
"# filename can be absolute or relative to this config file\n\n"
|
"# filename can be absolute or relative to this config file\n\n"
|
||||||
"# route any messages logged to the default logger to the \"stderr\" logger we\n"
|
"# route any messages logged to the default logger to the \"stderr\" logger we\n"
|
||||||
"# declared above, if they are info level are higher\n"
|
"# declared above, if they are info level are higher\n"
|
||||||
"[logger.default]\n"
|
"[logger.default]\n"
|
||||||
"level=info\n"
|
"level=info\n"
|
||||||
"appenders=stderr\n\n"
|
"appenders=stderr\n\n"
|
||||||
"# route messages sent to the \"p2p\" logger to the p2p appender declared above\n"
|
"# route messages sent to the \"p2p\" logger to the p2p appender declared above\n"
|
||||||
"[logger.p2p]\n"
|
"[logger.p2p]\n"
|
||||||
"level=debug\n"
|
"level=debug\n"
|
||||||
"appenders=p2p\n\n";
|
"appenders=p2p\n\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
fc::optional<fc::logging_config> load_logging_config_from_ini_file(const fc::path& config_ini_filename)
|
fc::optional<fc::logging_config> load_logging_config_from_ini_file(const fc::path& config_ini_filename)
|
||||||
|
|
@ -257,14 +257,14 @@ fc::optional<fc::logging_config> load_logging_config_from_ini_file(const fc::pat
|
||||||
// stdout/stderr will be taken from ini file, everything else hard-coded here
|
// stdout/stderr will be taken from ini file, everything else hard-coded here
|
||||||
fc::console_appender::config console_appender_config;
|
fc::console_appender::config console_appender_config;
|
||||||
console_appender_config.level_colors.emplace_back(
|
console_appender_config.level_colors.emplace_back(
|
||||||
fc::console_appender::level_color(fc::log_level::debug,
|
fc::console_appender::level_color(fc::log_level::debug,
|
||||||
fc::console_appender::color::green));
|
fc::console_appender::color::green));
|
||||||
console_appender_config.level_colors.emplace_back(
|
console_appender_config.level_colors.emplace_back(
|
||||||
fc::console_appender::level_color(fc::log_level::warn,
|
fc::console_appender::level_color(fc::log_level::warn,
|
||||||
fc::console_appender::color::brown));
|
fc::console_appender::color::brown));
|
||||||
console_appender_config.level_colors.emplace_back(
|
console_appender_config.level_colors.emplace_back(
|
||||||
fc::console_appender::level_color(fc::log_level::error,
|
fc::console_appender::level_color(fc::log_level::error,
|
||||||
fc::console_appender::color::cyan));
|
fc::console_appender::color::cyan));
|
||||||
console_appender_config.stream = fc::variant(stream_name).as<fc::console_appender::stream::type>();
|
console_appender_config.stream = fc::variant(stream_name).as<fc::console_appender::stream::type>();
|
||||||
logging_config.appenders.push_back(fc::appender_config(console_appender_name, "console", fc::variant(console_appender_config)));
|
logging_config.appenders.push_back(fc::appender_config(console_appender_name, "console", fc::variant(console_appender_config)));
|
||||||
found_logging_config = true;
|
found_logging_config = true;
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ database_fixture::database_fixture()
|
||||||
|
|
||||||
genesis_state.initial_timestamp = time_point_sec( GRAPHENE_TESTING_GENESIS_TIMESTAMP );
|
genesis_state.initial_timestamp = time_point_sec( GRAPHENE_TESTING_GENESIS_TIMESTAMP );
|
||||||
genesis_state.initial_timestamp = time_point_sec( (fc::time_point::now().sec_since_epoch() / GRAPHENE_DEFAULT_BLOCK_INTERVAL) * GRAPHENE_DEFAULT_BLOCK_INTERVAL );
|
genesis_state.initial_timestamp = time_point_sec( (fc::time_point::now().sec_since_epoch() / GRAPHENE_DEFAULT_BLOCK_INTERVAL) * GRAPHENE_DEFAULT_BLOCK_INTERVAL );
|
||||||
// genesis_state.initial_parameters.witness_schedule_algorithm = GRAPHENE_WITNESS_SHUFFLED_ALGORITHM;
|
// genesis_state.initial_parameters.witness_schedule_algorithm = GRAPHENE_WITNESS_SHUFFLED_ALGORITHM;
|
||||||
|
|
||||||
genesis_state.initial_active_witnesses = 10;
|
genesis_state.initial_active_witnesses = 10;
|
||||||
for( unsigned i = 0; i < genesis_state.initial_active_witnesses; ++i )
|
for( unsigned i = 0; i < genesis_state.initial_active_witnesses; ++i )
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue