Documentation ¶
Index ¶
- Constants
- Variables
- func BasePath(name string) string
- func ExpandDir(targetPath string) string
- func GetDevGenesisPath(t *testing.T) string
- func GetDevGenesisSpecPathTest(t *testing.T) string
- func GetGssmrGenesisPath() (path string, err error)
- func GetGssmrGenesisPathTest(t *testing.T) string
- func GetGssmrGenesisRawPath() (path string, err error)
- func GetGssmrGenesisRawPathTest(t *testing.T) string
- func GetProjectRootPath() (rootPath string, err error)
- func GetProjectRootPathTest(t *testing.T) (rootPath string)
- func HomeDir() string
- func KeystoreDir(basepath string) (keystorepath string, err error)
- func KeystoreFilepaths(basepath string) ([]string, error)
- func KeystoreFiles(basepath string) ([]string, error)
- func LoadBadgerDB(basePath string) (*badger.DB, error)
- func LoadChainDB(basePath string) (*chaindb.BadgerDB, error)
- func PathExists(p string) bool
- func SetupDatabase(basepath string, inMemory bool) (chaindb.Database, error)
Constants ¶
const DefaultDatabaseDir = "db"
DefaultDatabaseDir directory inside basepath where database contents are stored
Variables ¶
var (
ErrFindProjectRoot = errors.New("cannot find project root")
)
Functions ¶
func BasePath ¶
BasePath attempts to create a data directory using the given name within the gossamer directory within the user's HOME directory, returns absolute path or, if unable to locate HOME directory, returns within current directory
func GetDevGenesisPath ¶
GetDevGenesisPath gets the dev genesis path
func GetDevGenesisSpecPathTest ¶
GetDevGenesisSpecPathTest gets the dev genesis spec path
func GetGssmrGenesisPath ¶
GetGssmrGenesisPath gets the gssmr genesis path and returns an error if it cannot find it.
func GetGssmrGenesisPathTest ¶
GetGssmrGenesisPathTest gets the gssmr genesis path and fails the test if it cannot find it.
func GetGssmrGenesisRawPath ¶
GetGssmrGenesisRawPath gets the gssmr raw genesis path and returns an error if it cannot find it.
func GetGssmrGenesisRawPathTest ¶
GetGssmrGenesisRawPathTest gets the gssmr raw genesis path and fails the test if it cannot find it.
func GetProjectRootPath ¶
GetProjectRootPath finds the root of the project where `go.mod` is and returns it as an absolute path.
func GetProjectRootPathTest ¶
GetProjectRootPathTest finds the root of the project where `go.mod` is and returns it as an absolute path. It fails the test if it's not found.
func KeystoreDir ¶
KeystoreDir returns the absolute filepath of the keystore directory
func KeystoreFilepaths ¶
KeystoreFilepaths lists all the keys in the basepath/keystore/ directory and returns them as a list of filepaths
func KeystoreFiles ¶
KeystoreFiles returns the filenames of all the keys in the basepath's keystore
func LoadBadgerDB ¶
LoadBadgerDB load the db at the given path.
func LoadChainDB ¶
LoadChainDB load the db at the given path.
func PathExists ¶
PathExists returns true if the named file or directory exists, otherwise false
Types ¶
This section is empty.