generator

package
v1.5.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2021 License: Apache-2.0 Imports: 17 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultAssociated

func DefaultAssociated(ndauhome string) string

DefaultAssociated returns the default path to the associated data

func Generate

func Generate(gfilepath, associated string) (err error)

Generate creates a genesisfile and associated data.

Both arguments are paths to the files which should be written.

Both files are written as TOML. Existing data in these files is clobbered.

func GenerateIn

func GenerateIn(dir string) (gfilepath, asscpath string, err error)

GenerateIn makes genesis and associated files in a particular location

If `dir` is blank, these files will be stored in a system-defined temporary location, usually `/tmp`. Otherwise they will be stored in the specified directory.

We don't keep track of these files or clean them up at any point. If they are in a temporary directory, on most OSX and Linux systems, they will be cleaned up after three days of disuse. We can get away with this because they're small.

Types

type Associated

type Associated map[string]interface{}

Associated tracks associated data which goes with the mocks.

In particular, it's used for tests. For example, we mock up some public/private keypairs for the ReleaseFromEndowment transaction. The public halves of those keys are written into the mock file, but the private halves are communicated to the test suite by means of the Associated struct.

func GenerateData

func GenerateData() (gfile genesisfile.GFile, assc Associated, err error)

GenerateData mocks up some system variables without touching the filesystem

func (Associated) Dump

func (a Associated) Dump(path string) error

Dump writes this associated data to a file

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL