Documentation ¶
Index ¶
- Variables
- func AbsolutePath(Datadir string, filename string) string
- func AddHex(s string) string
- func Address(slice []byte) (addr []byte)
- func AddressStringToBytes(addr string) []byte
- func Big(num string) *big.Int
- func BigCopy(src *big.Int) *big.Int
- func BigD(data []byte) *big.Int
- func BigMax(x, y *big.Int) *big.Int
- func BigMin(x, y *big.Int) *big.Int
- func BigPow(a, b int) *big.Int
- func BigToBytes(num *big.Int, base int) []byte
- func BitTest(num *big.Int, i int) bool
- func Bytes2Hex(d []byte) string
- func ClearDir(dir string) error
- func Coerce2Hex(s string) string
- func CoerceHexAndPad(aa string, padright bool) string
- func Copy(src, dst string) error
- func CopyBytes(b []byte) (copiedBytes []byte)
- func Editor(file string) error
- func Exit(err error)
- func FieldFromTag(v reflect.Value, field string) (string, error)
- func FirstBitSet(v *big.Int) int
- func GenerateSingle(cmd *cobra.Command, out *bytes.Buffer, linkHandler func(string) string, ...)
- func GenerateSpecs(dir, render_dir, front_matter string) []string
- func GenerateTree(cmd *cobra.Command, dir string, specs []string, front_matter, base_url string)
- func IfExit(err error)
- func InitDataDir(Datadir string) error
- func InitErisDir() (err error)
- func IsHex(s string) bool
- func LeftPadBytes(slice []byte, l int) []byte
- func LeftPadString(str string, l int) string
- func NewInvalidKindErr(kind, k reflect.Kind) error
- func NumberToBytes(num interface{}, N int) []byte
- func ReadJson(config interface{}, config_file string) error
- func ResolveErisRoot() string
- func RightPadBytes(slice []byte, l int) []byte
- func RightPadString(str string, l int) string
- func S256(x *big.Int) *big.Int
- func SetProperty(cv reflect.Value, field string, value interface{}) error
- func StripHex(s string) string
- func StripOnes(s string) string
- func StripZeros(s string) string
- func U256(x *big.Int) *big.Int
- func UnLeftPadBytes(slice []byte) []byte
- func UnRightPadBytes(slice []byte) []byte
- func Usr() string
- func WriteFile(data, path string) error
- func WriteJson(config interface{}, config_file string) error
Constants ¶
This section is empty.
Variables ¶
var ( // Convenience Directories GoPath = os.Getenv("GOPATH") ErisLtd = filepath.Join(GoPath, "src", "github.com", "eris-ltd") // CSK: to deprecate ErisGo = filepath.Join(GoPath, "src", "github.com", "eris-ltd") // CSK: to keep ErisGH = "https://github.com/eris-ltd/" ErisRoot = ResolveErisRoot() ErisContainerRoot = "/home/eris/.eris" // XXX: this is used as root in the `eris/base` image // Major Directories ActionsPath = filepath.Join(ErisRoot, "actions") AppsPath = filepath.Join(ErisRoot, "apps") // previously "dapps" ChainsPath = filepath.Join(ErisRoot, "chains") // previously "blockchains" KeysPath = filepath.Join(ErisRoot, "keys") RemotesPath = filepath.Join(ErisRoot, "remotes") ScratchPath = filepath.Join(ErisRoot, "scratch") ServicesPath = filepath.Join(ErisRoot, "services") // Chains Directories HEAD = filepath.Join(ChainsPath, "HEAD") DefaultChainPath = filepath.Join(ChainsPath, "default") AccountsTypePath = filepath.Join(ChainsPath, "account-types") ChainTypePath = filepath.Join(ChainsPath, "chain-types") // Keys Directories KeysDataPath = filepath.Join(KeysPath, "data") KeyNamesPath = filepath.Join(KeysPath, "names") // Scratch Directories (basically eris' cache) (globally coordinated) DataContainersPath = filepath.Join(ScratchPath, "data") LanguagesScratchPath = filepath.Join(ScratchPath, "languages") // previously "~/.eris/languages" LllcScratchPath = filepath.Join(ScratchPath, "lllc") SolcScratchPath = filepath.Join(ScratchPath, "sol") SerpScratchPath = filepath.Join(ScratchPath, "ser") // Services Directories PersonalServicesPath = filepath.Join(ServicesPath, "global") // Deprecated Directories (remove on 0.12 release) BlockchainsPath = filepath.Join(ErisRoot, "blockchains") DappsPath = filepath.Join(ErisRoot, "dapps") LanguagesPath = filepath.Join(ErisRoot, "languages") )
var ( Big1 = big.NewInt(1) Big2 = big.NewInt(2) Big3 = big.NewInt(3) Big0 = big.NewInt(0) BigTrue = Big1 BigFalse = Big0 Big32 = big.NewInt(32) Big256 = big.NewInt(0xff) Big257 = big.NewInt(257) )
Common big integers often used
var ChainsDirs = []string{ ChainsPath, DefaultChainPath, AccountsTypePath, ChainTypePath, }
These should only be used by specific tooling rather than eris-cli level
var DirsToMigrate = map[string]string{ BlockchainsPath: ChainsPath, DappsPath: AppsPath, LanguagesPath: LanguagesScratchPath, }
eris update checks if old dirs exist & migrates them
var KeysDirs = []string{ KeysPath, KeysDataPath, KeyNamesPath, }
These should only be used by specific tooling rather than eris-cli level
var MajorDirs = []string{ ErisRoot, ActionsPath, AppsPath, ChainsPath, DefaultChainPath, AccountsTypePath, ChainTypePath, KeysPath, KeysDataPath, KeyNamesPath, RemotesPath, ScratchPath, DataContainersPath, LanguagesScratchPath, LllcScratchPath, SolcScratchPath, SerpScratchPath, ServicesPath, PersonalServicesPath, }
var ScratchDirs = []string{ ScratchPath, DataContainersPath, LanguagesScratchPath, LllcScratchPath, SolcScratchPath, SerpScratchPath, }
These should only be used by specific tooling rather than eris-cli level
var ServicesDirs = []string{ ServicesPath, PersonalServicesPath, }
These should only be used by specific tooling rather than eris-cli level
Functions ¶
func AbsolutePath ¶
func AddressStringToBytes ¶
func BigToBytes ¶
Big to bytes
Returns the bytes of a big integer with the size specified by **base** Attempts to pad the byte array with zeros.
func Coerce2Hex ¶
s can be string, hex, or int. returns properly formatted 32byte hex value
func CoerceHexAndPad ¶
func FirstBitSet ¶
func GenerateSingle ¶
func GenerateSpecs ¶
func GenerateTree ¶
func InitDataDir ¶
func LeftPadBytes ¶
func LeftPadString ¶
func NewInvalidKindErr ¶
func NumberToBytes ¶
keeps N bytes of the conversion
func ResolveErisRoot ¶
func ResolveErisRoot() string
TODO: [csk] give this a default string if folks want it somewhere besides ~/.eris ...?
func RightPadBytes ¶
func RightPadString ¶
func SetProperty ¶
Set a field in a struct value Field can be field name or json tag name Values can be strings that can be cast to int or bool
only handles strings, ints, bool
func StripZeros ¶
func UnLeftPadBytes ¶
func UnRightPadBytes ¶
Types ¶
This section is empty.