code: func WriteChainConfig(db ethdb.Writer, hash common.Hash, cfg *params.ChainConfig) {
  	if cfg == nil {
  		return
  	}
  	data, err := json.Marshal(cfg)
  	if err != nil {
  		log.Crit("Failed to JSON encode chain config", "err", err)
  	}
  	if err := db.Put(configKey(hash), data); err != nil {
  		log.Crit("Failed to store chain config", "err", err)
  	}
  }
docs: // WriteChainConfig writes the chain config settings to the database.