@@ -221,12 +221,11 @@ void print_help() {
221221 std::cout << " Default: /c2pool/ (c2pool always identified by donation address)\n\n " ;
222222
223223 std::cout << " PRIVATE SHARECHAIN:\n " ;
224- std::cout << " --chain -id ID Private chain identifier (hex, e.g. DEADBEEF)\n " ;
224+ std::cout << " --network -id ID Private network identifier (hex, e.g. DEADBEEF)\n " ;
225225 std::cout << " Default: 0 (public p2pool network)\n " ;
226- std::cout << " --chain-prefix PREFIX P2P magic prefix (4 hex bytes, e.g. C2C2C2C2)\n " ;
227- std::cout << " Default: standard p2pool prefix for the coin\n " ;
228- std::cout << " --no-persist Create genesis share immediately (don't wait for peers)\n " ;
229- std::cout << " Required when starting a new private chain\n\n " ;
226+ std::cout << " Nonzero: creates a private sharechain. P2P prefix\n " ;
227+ std::cout << " and THE metadata will carry this ID on the blockchain.\n " ;
228+ std::cout << " Genesis shares are created automatically when chain is empty.\n\n " ;
230229
231230 std::cout << " V36 SHARE MESSAGE BLOB (CLI operator control):\n " ;
232231 std::cout << " --message-blob-hex HEX Encrypted authority-signed message_data blob\n " ;
@@ -387,9 +386,7 @@ int main(int argc, char* argv[]) {
387386 std::string coinbase_text; // --coinbase-text (replaces /c2pool/ tag)
388387
389388 // Private sharechain
390- uint32_t chain_id = 0 ; // 0 = public p2pool network
391- uint32_t chain_prefix = 0 ; // 0 = use default p2pool prefix
392- bool no_persist = false ; // create genesis share immediately
389+ uint32_t network_id = 0 ; // 0 = public p2pool network, nonzero = private
393390
394391 // Track which options were explicitly set via CLI so that --config file
395392 // values only fill in gaps (CLI always wins).
@@ -648,17 +645,9 @@ int main(int argc, char* argv[]) {
648645 coinbase_text = argv[++i];
649646 cli_explicit.insert (" coinbase_text" );
650647 }
651- else if (arg == " --chain-id" && i + 1 < argc) {
652- chain_id = static_cast <uint32_t >(std::stoul (argv[++i], nullptr , 16 ));
653- cli_explicit.insert (" chain_id" );
654- }
655- else if (arg == " --chain-prefix" && i + 1 < argc) {
656- chain_prefix = static_cast <uint32_t >(std::stoul (argv[++i], nullptr , 16 ));
657- cli_explicit.insert (" chain_prefix" );
658- }
659- else if (arg == " --no-persist" ) {
660- no_persist = true ;
661- cli_explicit.insert (" no_persist" );
648+ else if ((arg == " --network-id" || arg == " --chain-id" ) && i + 1 < argc) {
649+ network_id = static_cast <uint32_t >(std::stoul (argv[++i], nullptr , 16 ));
650+ cli_explicit.insert (" network_id" );
662651 }
663652 // Legacy support for old --port option
664653 else if (arg == " --port" && i + 1 < argc) {
@@ -1274,7 +1263,7 @@ int main(int argc, char* argv[]) {
12741263 return arr;
12751264 },
12761265 [](const uint256&, uint32_t ) -> bool { return true ; },
1277- [the_store, mi, chain_id, chain_prefix ](const std::string& chain, uint64_t height,
1266+ [the_store, mi, network_id ](const std::string& chain, uint64_t height,
12781267 const std::string& hash, uint64_t ts) {
12791268 c2pool::storage::TheCheckpoint cp;
12801269 cp.chain = chain; cp.block_height = height;
@@ -1284,8 +1273,7 @@ int main(int argc, char* argv[]) {
12841273 cp.sharechain_height = work.sharechain_height ;
12851274 cp.miner_count = work.miner_count ;
12861275 cp.hashrate_class = c2pool::TheMetadata::encode_hashrate (work.pool_hashrate );
1287- cp.chain_id_val = chain_id;
1288- cp.chain_prefix_val = chain_prefix;
1276+ cp.chain_id_val = network_id;
12891277 the_store->store (cp);
12901278 LOG_INFO << " [THE] Checkpoint: " << chain << " height=" << height
12911279 << " miners=" << cp.miner_count
0 commit comments