func WriteNetCfg(f *os.File, params *chaincfg.Params) error {
	parser := flags.NewParser(nil, flags.None)
	_, err := parser.AddGroup(soterNetIniSection, soterNetIniSection, &netCfg{})
	if err != nil {
		return err
	}
	_, err = parser.ParseArgs(paramsToArgs(params))
	if err != nil {
		return err
	}
	iniParser := flags.NewIniParser(parser)
	iniParser.Write(f, flags.IniDefault)
	return nil
}
TODO: Have WriteNetCfg compare given params against defaults, and write differences.
This will require writing MarshalFlag and UnmarshalFlag for all types without built-in parsing support in go-flags.

WriteNetCfg writes chaincfg.Param values that we may be modifying during the test run to the open file descriptor, in
ini file format.
package soterutil
import (
	"fmt"
	"math/big"
	"os"
	"time"
	"github.com/jessevdk/go-flags"
	"github.com/soteria-dag/soterd/chaincfg"
)
const (
	soterNetIniSection = "Soter Net Options"
)
type soterBigInt struct {
	bigInt *big.Int
}
func (b soterBigInt) MarshalFlag() (string, error) {
	bytes, err := b.bigInt.MarshalText()
	if err != nil {
		return "", nil
	}
	return fmt.Sprintf("%s", bytes), nil
}
func (b *soterBigInt) UnmarshalFlag(v string) error {
	bigInt := new(big.Int)
	err := bigInt.UnmarshalText([]byte(v))
	if err != nil {
		return err
	}
	b.bigInt = bigInt
	return nil
}
type netCfg struct {
	Name string `short:"n" long:"name" description:"Name of net params type"`
	TargetTimespan time.Duration `short:"t" long:"targettimespan" description:"Desired amount of time that should elapse before checking if block difficulty requirement should be changed to maintain desired block generation rate"`
	TargetTimePerBlock time.Duration `short:"d" long:"targettimeperblock" description:"Desired amount of time to generate each block"`
}
func paramsToArgs(params *chaincfg.Params) []string {
	return []string{
		"--name", params.Name,
		"--targettimespan", params.TargetTimespan.String(),
		"--targettimeperblock", params.TargetTimePerBlock.String(),
	}
}