func EditChain(do *definitions.Do) error { chainConf, err := util.LoadViperConfig(path.Join(BlockchainsPath), do.Name, "chain") if err != nil { return err } if err := util.Edit(chainConf, do.Args); err != nil { return err } var chain definitions.Chain loaders.MarshalChainDefinition(chainConf, &chain) return WriteChainDefinitionFile(&chain, chainConf.ConfigFileUsed()) }
// read the config file into viper func loadContractPackage(path string) (*viper.Viper, error) { return util.LoadViperConfig(path, "package", "contracts") }
// read the config file into viper func loadChainDefinition(chainName string) (*viper.Viper, error) { return util.LoadViperConfig(path.Join(BlockchainsPath), chainName, "chain") }
func loadServiceDefinition(servName string) (*viper.Viper, error) { return util.LoadViperConfig(path.Join(ServicesPath), servName, "service") }