func (cfg *Config) DataDir() string {
	return filepath.Join(filesystem.GetCanonicalPath(cfg.DataDirParent), fmt.Sprint(cfg.P2P.NetworkID))
}
DataDir returns the absolute path to use for the node's data. This is the tilde-expanded path given in the config
with a subfolder named after the network ID.
package config
import (
	"fmt"
	"math/big"
	"path/filepath"
	"time"
	"github.com/spf13/viper"
	"github.com/spacemeshos/go-spacemesh/activation"
	apiConfig "github.com/spacemeshos/go-spacemesh/api/config"
	"github.com/spacemeshos/go-spacemesh/fetch"
	"github.com/spacemeshos/go-spacemesh/filesystem"
	hareConfig "github.com/spacemeshos/go-spacemesh/hare/config"
	eligConfig "github.com/spacemeshos/go-spacemesh/hare/eligibility/config"
	"github.com/spacemeshos/go-spacemesh/layerfetcher"
	"github.com/spacemeshos/go-spacemesh/log"
	"github.com/spacemeshos/go-spacemesh/mesh"
	"github.com/spacemeshos/go-spacemesh/p2p"
	timeConfig "github.com/spacemeshos/go-spacemesh/timesync/config"
	"github.com/spacemeshos/go-spacemesh/tortoisebeacon"
)
const (
	defaultConfigFileName = "./config.toml"
	defaultDataDirName    = "spacemesh"
)
var (
	defaultHomeDir = filesystem.GetUserHomeDirectory()
	defaultDataDir = filepath.Join(defaultHomeDir, defaultDataDirName, "/")
)
type Config struct {
	BaseConfig      `mapstructure:"main"`
	Genesis         *apiConfig.GenesisConfig `mapstructure:"genesis"`
	P2P             p2p.Config               `mapstructure:"p2p"`
	API             apiConfig.Config         `mapstructure:"api"`
	HARE            hareConfig.Config        `mapstructure:"hare"`
	HareEligibility eligConfig.Config        `mapstructure:"hare-eligibility"`
	TortoiseBeacon  tortoisebeacon.Config    `mapstructure:"tortoise-beacon"`
	TIME            timeConfig.TimeConfig    `mapstructure:"time"`
	REWARD          mesh.Config              `mapstructure:"reward"`
	POST            activation.PostConfig    `mapstructure:"post"`
	SMESHING        SmeshingConfig           `mapstructure:"smeshing"`
	LOGGING         LoggerConfig             `mapstructure:"logging"`
	LAYERS          layerfetcher.Config      `mapstructure:"layer-fetch"`
	FETCH           fetch.Config             `mapstructure:"fetch"`
}