Open heyasjack opened 5 years ago
I think it can't find the genesis file because it is in a subdirectory. Try
./witness_node --data-dir=data/my-blocktestnet --genesis-json=genesis/my-genesis.json --seed-nodes "[]"
instead.
@cedar-book the documentation seems to be wrong in that detail.
Also, the error message from witness_node
is misleading and should be improved.
Or perhaps the program failed to parse genesis file due to wrong format or so? @heyasjack can you upload your genesis file so we can check?
Or perhaps the program failed to parse genesis file due to wrong format or so? @heyasjack can you upload your genesis file so we can check?
@abitmore Thank you for your help!
And the genesis has 2 version. I have tried both of them, but it seemed that both of them have similar problems. The old one is from https://dev.bitshares.works/en/master/development/testnets/private_testnet_genesis_example.html#private-testnet-genesis-example And the new one is copied from bitshares-core/libraries/egenesis/genesis-dev.json , which refer to https://github.com/bitshares/bitshares-core/issues/1591
the old one ` { "initial_timestamp": "2016-01-18T09:18:25", "max_core_supply": "1000000000000000", "initial_parameters": { "current_fees": { "parameters": [[ 0,{ "fee": 2000000, "price_per_kbyte": 1000000 } ],[ 1,{ "fee": 500000 } ],[ 2,{ "fee": 0 } ],[ 3,{ "fee": 2000000 } ],[ 4,{} ],[ 5,{ "basic_fee": 500000, "premium_fee": 200000000, "price_per_kbyte": 100000 } ],[ 6,{ "fee": 2000000, "price_per_kbyte": 100000 } ],[ 7,{ "fee": 300000 } ],[ 8,{ "membership_annual_fee": 200000000, "membership_lifetime_fee": 1000000000 } ],[ 9,{ "fee": 50000000 } ],[ 10,{ "symbol3": "50000000000", "symbol4": "30000000000", "long_symbol": 500000000, "price_per_kbyte": 10 } ],[ 11,{ "fee": 50000000, "price_per_kbyte": 10 } ],[ 12,{ "fee": 50000000 } ],[ 13,{ "fee": 50000000 } ],[ 14,{ "fee": 2000000, "price_per_kbyte": 100000 } ],[ 15,{ "fee": 2000000 } ],[ 16,{ "fee": 100000 } ],[ 17,{ "fee": 10000000 } ],[ 18,{ "fee": 50000000 } ],[ 19,{ "fee": 100000 } ],[ 20,{ "fee": 500000000 } ],[ 21,{ "fee": 2000000 } ],[ 22,{ "fee": 2000000, "price_per_kbyte": 10 } ],[ 23,{ "fee": 2000000, "price_per_kbyte": 10 } ],[ 24,{ "fee": 100000 } ],[ 25,{ "fee": 100000 } ],[ 26,{ "fee": 100000 } ],[ 27,{ "fee": 2000000, "price_per_kbyte": 10 } ],[ 28,{ "fee": 0 } ],[ 29,{ "fee": 500000000 } ],[ 30,{ "fee": 2000000 } ],[ 31,{ "fee": 100000 } ],[ 32,{ "fee": 100000 } ],[ 33,{ "fee": 2000000 } ],[ 34,{ "fee": 500000000 } ],[ 35,{ "fee": 100000, "price_per_kbyte": 10 } ],[ 36,{ "fee": 100000 } ],[ 37,{} ],[ 38,{ "fee": 2000000, "price_per_kbyte": 10 } ],[ 39,{ "fee": 500000, "price_per_output": 500000 } ],[ 40,{ "fee": 500000, "price_per_output": 500000 } ],[ 41,{ "fee": 500000 } ],[ 42,{} ],[ 43,{ "fee": 2000000 } ] ], "scale": 10000 }, "block_interval": 5, "maintenance_interval": 86400, "maintenance_skip_slots": 3, "committee_proposal_review_period": 1209600, "maximum_transaction_size": 2048, "maximum_block_size": 2048000000, "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": 2000, "network_percent_of_fee": 2000, "lifetime_referrer_percent_of_fee": 3000, "cashback_vesting_period_seconds": 31536000, "cashback_vesting_threshold": 10000000, "count_non_member_votes": true, "allow_non_member_whitelists": false, "witness_pay_per_block": 1000000, "worker_budget_per_day": "50000000000", "max_predicate_opcode": 1, "fee_liquidation_threshold": 10000000, "accounts_per_fee_scale": 1000, "account_fee_scale_bitshifts": 4, "max_authority_depth": 2, "extensions": [] }, "initial_accounts": [{ "name": "init0", "owner_key": "--- set a public key ---", "active_key": "--- set a public key ---", "is_lifetime_member": true },{ "name": "init1", "owner_key": "--- set a public key ---", "active_key": "--- set a public key ---", "is_lifetime_member": true },{ "name": "init2", "owner_key": "--- set a public key ---", "active_key": "--- set a public key ---", "is_lifetime_member": true },{ "name": "init3", "owner_key": "--- set a public key ---", "active_key": "--- set a public key ---", "is_lifetime_member": true },{ "name": "init4", "owner_key": "--- set a public key ---", "active_key": "--- set a public key ---", "is_lifetime_member": true },{ "name": "init5", "owner_key": "--- set a public key ---", "active_key": "--- set a public key ---", "is_lifetime_member": true },{ "name": "init6", "owner_key": "--- set a public key ---", "active_key": "--- set a public key ---", "is_lifetime_member": true },{ "name": "init7", "owner_key": "--- set a public key ---", "active_key": "--- set a public key ---", "is_lifetime_member": true },{ "name": "init8", "owner_key": "--- set a public key ---", "active_key": "--- set a public key ---", "is_lifetime_member": true },{ "name": "init9", "owner_key": "--- set a public key ---", "active_key": "--- set a public key ---", "is_lifetime_member": true },{ "name": "init10", "owner_key": "--- set a public key ---", "active_key": "--- set a public key ---", "is_lifetime_member": true },{ "name": "nathan", "owner_key": "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3", "active_key": "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3", "is_lifetime_member": false } ], "initial_assets": [], "initial_balances": [{ "owner": "--- set a public key ---", "asset_symbol": "TEST", "amount": "1000000000000000" } ], "initial_vesting_balances": [], "initial_active_witnesses": 11, "initial_witness_candidates": [{ "owner_name": "init0", "block_signing_key": "--- set a public key ---" },{ "owner_name": "init1", "block_signing_key": "--- set a public key ---" },{ "owner_name": "init2", "block_signing_key": "--- set a public key ---" },{ "owner_name": "init3", "block_signing_key": "--- set a public key ---" },{ "owner_name": "init4", "block_signing_key": "--- set a public key ---" },{ "owner_name": "init5", "block_signing_key": "--- set a public key ---" },{ "owner_name": "init6", "block_signing_key": "--- set a public key ---" },{ "owner_name": "init7", "block_signing_key": "--- set a public key ---" },{ "owner_name": "init8", "block_signing_key": "--- set a public key ---" },{ "owner_name": "init9", "block_signing_key": "--- set a public key ---" },{ "owner_name": "init10", "block_signing_key": "--- set a public key ---" } ], "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" },{ "owner_name": "init10" } ], "initial_worker_candidates": [], "immutable_parameters": { "min_committee_member_count": 11, "min_witness_count": 11, "num_special_accounts": 0, "num_special_assets": 0 } }
the new one
{
"initial_timestamp": "2019-02-14T20:32:55",
"max_core_supply": "1000000000000000",
"initial_parameters": {
"current_fees": {
"parameters": [[
0,{
"fee": 2000000,
"price_per_kbyte": 1000000
}
],[
1,{
"fee": 500000
}
],[
2,{
"fee": 0
}
],[
3,{
"fee": 2000000
}
],[
4,{}
],[
5,{
"basic_fee": 500000,
"premium_fee": 200000000,
"price_per_kbyte": 100000
}
],[
6,{
"fee": 2000000,
"price_per_kbyte": 100000
}
],[
7,{
"fee": 300000
}
],[
8,{
"membership_annual_fee": 200000000,
"membership_lifetime_fee": 1000000000
}
],[
9,{
"fee": 50000000
}
],[
10,{
"symbol3": "50000000000",
"symbol4": "30000000000",
"long_symbol": 500000000,
"price_per_kbyte": 10
}
],[
11,{
"fee": 50000000,
"price_per_kbyte": 10
}
],[
12,{
"fee": 50000000
}
],[
13,{
"fee": 50000000
}
],[
14,{
"fee": 2000000,
"price_per_kbyte": 100000
}
],[
15,{
"fee": 2000000
}
],[
16,{
"fee": 100000
}
],[
17,{
"fee": 10000000
}
],[
18,{
"fee": 50000000
}
],[
19,{
"fee": 100000
}
],[
20,{
"fee": 500000000
}
],[
21,{
"fee": 2000000
}
],[
22,{
"fee": 2000000,
"price_per_kbyte": 10
}
],[
23,{
"fee": 2000000,
"price_per_kbyte": 10
}
],[
24,{
"fee": 100000
}
],[
25,{
"fee": 100000
}
],[
26,{
"fee": 100000
}
],[
27,{
"fee": 2000000,
"price_per_kbyte": 10
}
],[
28,{
"fee": 0
}
],[
29,{
"fee": 500000000
}
],[
30,{
"fee": 2000000
}
],[
31,{
"fee": 100000
}
],[
32,{
"fee": 100000
}
],[
33,{
"fee": 2000000
}
],[
34,{
"fee": 500000000
}
],[
35,{
"fee": 100000,
"price_per_kbyte": 10
}
],[
36,{
"fee": 100000
}
],[
37,{}
],[
38,{
"fee": 2000000,
"price_per_kbyte": 10
}
],[
39,{
"fee": 500000,
"price_per_output": 500000
}
],[
40,{
"fee": 500000,
"price_per_output": 500000
}
],[
41,{
"fee": 500000
}
],[
42,{}
],[
43,{
"fee": 2000000
}
],[
44,{}
],[
45,{
"fee": 2000000
}
],[
46,{}
],[
47,{
"fee": 2000000
}
],[
48,{
"fee": 2000000
}
]
],
"scale": 10000
},
"block_interval": 5,
"maintenance_interval": 86400,
"maintenance_skip_slots": 3,
"committee_proposal_review_period": 1209600,
"maximum_transaction_size": 2048,
"maximum_block_size": 2000000,
"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": 2000,
"network_percent_of_fee": 2000,
"lifetime_referrer_percent_of_fee": 3000,
"cashback_vesting_period_seconds": 31536000,
"cashback_vesting_threshold": 10000000,
"count_non_member_votes": true,
"allow_non_member_whitelists": false,
"witness_pay_per_block": 1000000,
"worker_budget_per_day": "50000000000",
"max_predicate_opcode": 1,
"fee_liquidation_threshold": 10000000,
"accounts_per_fee_scale": 1000,
"account_fee_scale_bitshifts": 4,
"max_authority_depth": 2,
"extensions": []
},
"initial_accounts": [{
"name": "init0",
"owner_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"active_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"is_lifetime_member": true
},{
"name": "init1",
"owner_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"active_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"is_lifetime_member": true
},{
"name": "init2",
"owner_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"active_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"is_lifetime_member": true
},{
"name": "init3",
"owner_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"active_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"is_lifetime_member": true
},{
"name": "init4",
"owner_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"active_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"is_lifetime_member": true
},{
"name": "init5",
"owner_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"active_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"is_lifetime_member": true
},{
"name": "init6",
"owner_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"active_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"is_lifetime_member": true
},{
"name": "init7",
"owner_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"active_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"is_lifetime_member": true
},{
"name": "init8",
"owner_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"active_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"is_lifetime_member": true
},{
"name": "init9",
"owner_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"active_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"is_lifetime_member": true
},{
"name": "init10",
"owner_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"active_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"is_lifetime_member": true
},{
"name": "nathan",
"owner_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"active_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"is_lifetime_member": false
}
],
"initial_assets": [],
"initial_balances": [{
"owner": "BTSFAbAx7yuxt725qSZvfwWqkdCwp9ZnUama",
"asset_symbol": "BTS",
"amount": "1000000000000000"
}
],
"initial_vesting_balances": [],
"initial_active_witnesses": 11,
"initial_witness_candidates": [{
"owner_name": "init0",
"block_signing_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
},{
"owner_name": "init1",
"block_signing_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
},{
"owner_name": "init2",
"block_signing_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
},{
"owner_name": "init3",
"block_signing_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
},{
"owner_name": "init4",
"block_signing_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
},{
"owner_name": "init5",
"block_signing_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
},{
"owner_name": "init6",
"block_signing_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
},{
"owner_name": "init7",
"block_signing_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
},{
"owner_name": "init8",
"block_signing_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
},{
"owner_name": "init9",
"block_signing_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
},{
"owner_name": "init10",
"block_signing_key": "BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
}
],
"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"
},{
"owner_name": "init10"
}
],
"initial_worker_candidates": [],
"immutable_parameters": {
"min_committee_member_count": 11,
"min_witness_count": 11,
"num_special_accounts": 0,
"num_special_assets": 0
}
}
`
@pmconrad Thank you for your help ! I tried your code in testnet_home, but it seemed to have a same problem. And the genesis.json file have 2 version, I get confused of them.
The old one is from https://dev.bitshares.works/en/master/development/testnets/private_testnet_genesis_example.html#private-testnet-genesis-example And the new one is copied from bitshares-core/libraries/egenesis/genesis-dev.json , which refer to #1591
I haven't change the genesis.json when I run the witness_node. Should I need to change some variable or chain ID of it? And I'm going to try both of them using your code in different location now.
@heyasjack try absolute path, e.g. --genesis-json=/root/bitshares-core/testnet_home/genesis/my-genesis.json
?
Please make sure the file is there:
ls -l /root/bitshares-core/testnet_home/genesis/my-genesis.json
The old one with "block_signing_key": "--- set a public key ---"
won't work anyway.
@abitmore Thank you for your advice! But I failed again. I used GCP ubuntu for testing, so maybe I had made something wrong setting. And if you have some free time, could you make a test on your device according to the tutorial, so we can see whether the document is wrong or I made the wrong setting. https://dev.bitshares.works/en/master/development/testnets/private_testnet.html I‘m all gratitude!
@abitmore @pmconrad Thank you for your help!
Well, I succeed in running the witness_node with
root@instance-7:/home/user1/bitshares-core# programs/witness_node/witness_node --data-d ir data/my-blockprod --genesis-json genesis/my-genesis.json --seed-nodes "[]"
which is from https://github.com/bitshares/bitshares-core/wiki/private-testnet.
I leave genesis file in bitshares-core/genesis/my-genesis.json, and the my-genesis.json is from https://github.com/bitshares/bitshares-core/blob/master/libraries/egenesis/genesis-dev.json
And later I will repeat these steps and check whether it is stable.
oh, I failed again. With almost the same steps.
3364457ms th_a db_management.cpp:224 open ] 7 bad_cast_exception: Bad Cast Invalid cast from type 'string_type' to Object {"type":"string_type"} th_a variant.cpp:582 get_object 3364457ms th_a db_management.cpp:224 open ] data_dir: /home/use1/bitshares-core/data/my-blockprod/bloc kchain
The succeed running console:
3387741ms th_a object_database.cpp:115 open ] Opening object d atabase from /home/user1/bitshares-core/data/my-blockprod/blockchain ... 3387811ms th_a object_database.cpp:124 open ] Done opening obj ect database. 3387813ms th_a application.cpp:209 reset_p2p_node ] Configured p2p n ode to listen on 0.0.0.0:43167
The failed console:
3364455ms th_a object_database.cpp:115 open ] Opening object database from /home/user1/bitshares-core/data/my-blockprod/blockchain ... 3364457ms th_a object_database.cpp:124 open ] Done opening object database. 3364457ms th_a application.cpp:353 operator() ] Initializing database... 3364457ms th_a db_management.cpp:224 open ] 7 bad_cast_exception: Bad Cast Invalid cast from type 'string_type' to Object {"type":"string_type"} th_a variant.cpp:582 get_object 3364457ms th_a db_management.cpp:224 open ] data_dir: /home/user1/bitshares-core/data/my-blockprod/blockchain
Their difference begin from that. But I noticed the difference between application.cpp:209 and application.cpp:353 ,but I don't know why and how to solve it... I will test more and I hope you can give me a hand! Please!
Well, I FOUND IT! So stupid I am, the my-genesis.json have something miss part maybe I missed them in the copy step.
Yeeeaaa, I repeat it successfully!
The most important things is the route and location, the tutorial has made misleading about the location, check the location of my-genesis.json when you run witness_node.
And the second point is the my-genesis.json, you should copy command
cp -r libraries/egenesis/genesis-dev.json testnet_home/genesis
and then enter the testnet_home/genesis and mv genesis-dev.json my-genesis.json
it often miss the first line of the file, check it first.
Oh, I suggest that the tutorial should be added using screen when running the witness_node and cli_wallet
Updated by @abitmore: see https://github.com/bitshares/bitshares-core/issues/1770#issuecomment-495113403 for what to do with this issue.
Instructions Hello, I'm new to bitshares and I'd like to learn bitshares from building a private testnet. But when I tried to build one referring to -https://github.com/bitshares/bitshares-core/wiki/private-testnet -https://dev.bitshares.works/en/master/development/testnets/private_testnet.html it always stuck in 4-1 ./witness_node --data-dir=data/my-blocktestnet --genesis-json=my-genesis.json --seed-nodes "[]" it couldn't run a node
Build Error