config

package
v0.0.0-...-9a3f633 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2021 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exists

func Exists(path string) (bool, error)

Exists returns true of the config root exists.

func Init

func Init(path string) error

Init initializes a config with a default account.

Types

type Accounts

type Accounts struct {
	Pinned  []common.Address `json:"pinned,omitempty"`
	Default common.Address   `json:"default,omitempty"`
}

type Config

type Config struct {
	Accounts Accounts `json:"accounts"`
	Ethereum Ethereum `json:"ethereum"`
	IPFS     IPFS     `json:"ipfs"`
	Signer   Signer   `json:"signer"`
	HTTP     HTTP     `json:"http"`
	// contains filtered or unexported fields
}

func Default

func Default(rootPath string) Config

Default returns a config with default settings.

func Load

func Load(path string) (*Config, error)

Load loads the config from the given root path.

func (Config) Save

func (c Config) Save() error

Save writes the config to the root path.

type Ethereum

type Ethereum struct {
	// BiconomyApiKey is the mexa public api key.
	BiconomyApiKey string `json:"biconomy_api_key"`
	// Contracts is a mapping of contract addresses.
	Contracts map[string]common.Address `json:"contracts"`
	// ChainID is the unique id of the ethereum chain.
	ChainID *big.Int `json:"chain_id"`
	// MetaTx enables meta transactions.
	MetaTx bool `json:"meta_tx"`
	// RPC is the ethereum rpc address.
	RPC string `json:"rpc"`
}

type HTTP

type HTTP struct {
	// ApiAddr is the api server address to use
	ApiAddr string `json:"api_address"`
	// WebAddr is the static web server address to use
	WebAddr string `json:"web_address"`
}

type IPFS

type IPFS struct {
	// API is the IPFS api address.
	API string `json:"api"`
	// Peers is a mapping of peer addresses to connect to.
	Peers []string `json:"peers"`
}

type Signer

type Signer struct {
	// AdvancedMode allows warning instead of rejecting.
	AdvancedMode bool `json:"advanced_mode"`
	// LightKDF enables faster KDF for low power devices.
	LightKDF bool `json:"light_kdf"`
	// NoUSB disables usb signer devices.
	NoUSB bool `json:"no_usb"`
	// SmartCardPath enables smart card signing.
	SmartCardPath string `json:"smart_card_path"`
	// KeyStorePath is the path to the key store.
	KeyStorePath string `json:"key_store_path"`
	// IPCAddress is the signer ipc address.
	IPCAddress string `json:"ipc_address"`
}

Jump to

Keyboard shortcuts

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