@@ -864,8 +864,8 @@ func (n *Network) GetPluginDir() (string, error) {
864
864
return n .DefaultFlags .GetStringVal (config .PluginDirKey )
865
865
}
866
866
867
- // GetGenesisFileContent returns the base64 encoding of the JSON
868
- // encoding of the network genesis.
867
+ // GetGenesisFileContent returns the base64-encoded JSON-marshaled
868
+ // network genesis.
869
869
func (n * Network ) GetGenesisFileContent () (string , error ) {
870
870
bytes , err := json .Marshal (n .Genesis )
871
871
if err != nil {
@@ -874,8 +874,8 @@ func (n *Network) GetGenesisFileContent() (string, error) {
874
874
return base64 .StdEncoding .EncodeToString (bytes ), nil
875
875
}
876
876
877
- // GetSubnetConfigContent returns the base64-encoded map of subnetID
878
- // to marshalled subnet configuration.
877
+ // GetSubnetConfigContent returns the base64-encoded and
878
+ // JSON-marshaled map of subnetID to subnet configuration.
879
879
func (n * Network ) GetSubnetConfigContent () (string , error ) {
880
880
subnetConfigs := maps .Clone (n .PrimarySubnetConfigs )
881
881
@@ -903,9 +903,8 @@ func (n *Network) GetSubnetConfigContent() (string, error) {
903
903
return base64 .StdEncoding .EncodeToString (marshaledConfigs ), nil
904
904
}
905
905
906
- // GetChainConfigContent returns the base64-encoded map of chain
907
- // alias/ID to marshalled chain configuration for both primary and
908
- // custom chains.
906
+ // GetChainConfigContent returns the base64-encoded and JSON-marshaled map of chain alias/ID
907
+ // to JSON-marshaled chain configuration for both primary and custom chains.
909
908
func (n * Network ) GetChainConfigContent () (string , error ) {
910
909
chainConfigs := map [string ]chains.ChainConfig {}
911
910
for alias , flags := range n .PrimaryChainConfigs {
@@ -953,7 +952,7 @@ func (n *Network) writeNodeFlags(node *Node) error {
953
952
// Set the bootstrap configuration
954
953
bootstrapIPs , bootstrapIDs , err := n .GetBootstrapIPsAndIDs (node )
955
954
if err != nil {
956
- return err
955
+ return fmt . Errorf ( "failed to determine bootstrap configuration: %w" , err )
957
956
}
958
957
flags [config .BootstrapIDsKey ] = strings .Join (bootstrapIDs , "," )
959
958
flags [config .BootstrapIPsKey ] = strings .Join (bootstrapIPs , "," )
@@ -963,22 +962,22 @@ func (n *Network) writeNodeFlags(node *Node) error {
963
962
if n .Genesis != nil {
964
963
genesisFileContent , err := n .GetGenesisFileContent ()
965
964
if err != nil {
966
- return err
965
+ return fmt . Errorf ( "failed to get genesis file content: %w" , err )
967
966
}
968
967
flags .SetDefault (config .GenesisFileContentKey , genesisFileContent )
969
968
}
970
969
971
970
subnetConfigContent , err := n .GetSubnetConfigContent ()
972
971
if err != nil {
973
- return err
972
+ return fmt . Errorf ( "failed to get subnet config content: %w" , err )
974
973
}
975
974
if len (subnetConfigContent ) > 0 {
976
975
flags .SetDefault (config .SubnetConfigContentKey , subnetConfigContent )
977
976
}
978
977
979
978
chainConfigContent , err := n .GetChainConfigContent ()
980
979
if err != nil {
981
- return err
980
+ return fmt . Errorf ( "failed to get chain config content: %w" , err )
982
981
}
983
982
if len (chainConfigContent ) > 0 {
984
983
flags .SetDefault (config .ChainConfigContentKey , chainConfigContent )
0 commit comments