@@ -57,6 +57,7 @@ pub struct ChainParams {
5757 pub council_members : Vec < String > ,
5858 pub tech_committee_members : Vec < String > ,
5959 pub sudo_key : String ,
60+ pub network_id : i32 ,
6061}
6162
6263impl ChainParams {
@@ -159,6 +160,7 @@ fn cord_braid_custom_config_genesis(config: ChainParams) -> serde_json::Value {
159160 initial_well_known_nodes,
160161 initial_authorities,
161162 initial_sudo_key,
163+ config. network_id ,
162164 )
163165}
164166
@@ -189,7 +191,7 @@ fn cord_loom_custom_config_genesis(config: ChainParams) -> serde_json::Value {
189191
190192 let initial_sudo_key: AccountId = array_bytes:: hex_n_into_unchecked ( & config. authorities [ 0 ] [ 0 ] ) ;
191193
192- cord_loom_custom_genesis ( initial_authorities, initial_sudo_key)
194+ cord_loom_custom_genesis ( initial_authorities, initial_sudo_key, config . network_id )
193195}
194196
195197fn cord_weave_custom_config_genesis ( config : ChainParams ) -> serde_json:: Value {
@@ -219,7 +221,7 @@ fn cord_weave_custom_config_genesis(config: ChainParams) -> serde_json::Value {
219221
220222 let initial_sudo_key: AccountId = array_bytes:: hex_n_into_unchecked ( & config. authorities [ 0 ] [ 0 ] ) ;
221223
222- cord_weave_custom_genesis ( initial_authorities, initial_sudo_key)
224+ cord_weave_custom_genesis ( initial_authorities, initial_sudo_key, config . network_id )
223225}
224226
225227pub fn cord_custom_config ( config : ChainParams ) -> Result < CordChainSpec , String > {
@@ -299,12 +301,14 @@ fn cord_braid_custom_genesis(
299301 BeefyId ,
300302 ) > ,
301303 root_key : AccountId ,
304+ network_id : i32 ,
302305) -> serde_json:: Value {
303306 serde_json:: json!( {
304307 "balances" : {
305308 "balances" : initial_authorities. iter( ) . map( |k| ( k. 0 . clone( ) , ENDOWMENT ) ) . collect:: <Vec <_>>( ) ,
306309 } ,
307- "doken" : { "networkId" : 2003 } ,
310+ /* TODO: Make the protocolId modular as well, to support origin chains */
311+ "doken" : { "protocolId" : "c0rd" . to_string( ) , "networkId" : network_id } ,
308312 "nodeAuthorization" : {
309313 "nodes" : initial_well_known_nodes. iter( ) . map( |x| ( x. 0 . clone( ) , x. 1 . clone( ) ) ) . collect:: <Vec <_>>( ) ,
310314 } ,
@@ -353,12 +357,14 @@ fn cord_loom_custom_genesis(
353357 BeefyId ,
354358 ) > ,
355359 root_key : AccountId ,
360+ network_id : i32 ,
356361) -> serde_json:: Value {
357362 serde_json:: json!( {
358363 "balances" : {
359364 "balances" : initial_authorities. iter( ) . map( |k| ( k. 0 . clone( ) , ENDOWMENT ) ) . collect:: <Vec <_>>( ) ,
360365 } ,
361- "doken" : { "networkId" : 2002 } ,
366+ /* TODO: Make the protocolId modular as well, to support origin chains */
367+ "doken" : { "protocolId" : "c0rd" . to_string( ) , "networkId" : network_id } ,
362368 "authorityMembership" : {
363369 "initialAuthorities" : initial_authorities
364370 . iter( )
@@ -413,12 +419,14 @@ fn cord_weave_custom_genesis(
413419 BeefyId ,
414420 ) > ,
415421 root_key : AccountId ,
422+ network_id : i32 ,
416423) -> serde_json:: Value {
417424 serde_json:: json!( {
418425 "balances" : {
419426 "balances" : initial_authorities. iter( ) . map( |k| ( k. 0 . clone( ) , ENDOWMENT ) ) . collect:: <Vec <_>>( ) ,
420427 } ,
421- "doken" : { "networkId" : 2001 } ,
428+ /* TODO: Make the protocolId modular as well, to support origin chains */
429+ "doken" : { "protocolId" : "c0rd" . to_string( ) , "networkId" : network_id } ,
422430 "session" : {
423431 "keys" : initial_authorities
424432 . iter( )
0 commit comments