Documentation ¶
Index ¶
- Constants
- Variables
- func GetGoSmiloImage() string
- func GetSpeaker(header *types.Header) common.Address
- func GetVaultImage() string
- func NewBlockchain(network *DockerNetwork, numOfFullnodes int, options ...Option) (bc *blockchain, err error)
- func NewDefaultBlockchain(network *DockerNetwork, numOfFullnodes int) (bc *blockchain, err error)
- func NewDefaultBlockchainWithFaulty(network *DockerNetwork, numOfNormal int, numOfFaulty int) (bc *blockchain, err error)
- func NewDefaultSmiloBlockchain(network *DockerNetwork, ctn VaultNetwork) (bc *blockchain, err error)
- func NewDefaultSmiloBlockchainWithFaulty(network *DockerNetwork, ctn VaultNetwork, numOfNormal int, numOfFaulty int) (bc *blockchain, err error)
- func NewDefaultVaultNetwork(network *DockerNetwork, numOfFullnodes int) (ctn *vaultNetwork, err error)
- func NewEthereum(c *docker.Client, options ...Option) *ethereum
- func NewSmiloBlockchain(network *DockerNetwork, ctn VaultNetwork, options ...Option) (bc *blockchain, err error)
- func NewVault(c *client.Client, options ...VaultOption) *vault
- func NewVaultNetwork(network *DockerNetwork, numOfFullnodes int, options ...VaultOption) (ctn *vaultNetwork, err error)
- type Blockchain
- type DockerNetwork
- type Ethereum
- type NetworkManager
- type NodeIncubator
- type Option
- func Accounts(accounts []common.Address) Option
- func DataDir(dir string) Option
- func DockerBinds(binds []string) Option
- func DockerEnv(env []string) Option
- func DockerNetworkName(dockerNetworkName string) Option
- func Etherbase(etherbase string) Option
- func FaultyMode(mode int) Option
- func HostDataDir(path string) Option
- func HostIP(ip net.IP) Option
- func HostName(hostName string) Option
- func HostPort(port int) Option
- func HostRPCPort(port int) Option
- func HostWebSocketPort(port int) Option
- func IPC(enabled bool) Option
- func Identity(id string) Option
- func ImageRepository(repository string) Option
- func ImageTag(tag string) Option
- func IsSmilo(isSmilo bool) Option
- func Key(key *ecdsa.PrivateKey) Option
- func KeyStore(dir string) Option
- func Logging(enabled bool) Option
- func Mine() Option
- func NAT(nat string) Option
- func NetworkID(networkID string) Option
- func NoDiscover() Option
- func NoUSB() Option
- func NodeKey(nodekey string) Option
- func NodeKeyHex(hex string) Option
- func Password(password string) Option
- func Port(port int) Option
- func RPC() Option
- func RPCAPI(apis string) Option
- func RPCAddress(address string) Option
- func RPCOrigin(origins string) Option
- func RPCPort(port int) Option
- func SyncMode(mode string) Option
- func Testnet() Option
- func Unlock(index int) Option
- func Verbosity(verbosity int) Option
- func WebSocket() Option
- func WebSocketAPI(apis string) Option
- func WebSocketAddress(address string) Option
- func WebSocketOrigin(origins string) Option
- func WebSocketPort(port int) Option
- type Vault
- type VaultNetwork
- type VaultOption
- func CTDockerNetworkName(dockerNetworkName string) VaultOption
- func CTHost(ip net.IP, port int) VaultOption
- func CTImageRepository(repository string) VaultOption
- func CTImageTag(tag string) VaultOption
- func CTKeyName(keyName string) VaultOption
- func CTLogging(enabled bool) VaultOption
- func CTOtherNodes(urls []string) VaultOption
- func CTSocketFilename(socketFilename string) VaultOption
- func CTWorkDir(workDir string) VaultOption
Constants ¶
View Source
const ( FirstOctet = 172 SecondOctet = 17 )
Variables ¶
View Source
var ( ErrNoBlock = errors.New("no block generated") ErrTimeout = errors.New("timeout") )
Functions ¶
func GetGoSmiloImage ¶
func GetGoSmiloImage() string
func GetVaultImage ¶
func GetVaultImage() string
func NewBlockchain ¶
func NewBlockchain(network *DockerNetwork, numOfFullnodes int, options ...Option) (bc *blockchain, err error)
func NewDefaultBlockchain ¶
func NewDefaultBlockchain(network *DockerNetwork, numOfFullnodes int) (bc *blockchain, err error)
func NewDefaultBlockchainWithFaulty ¶
func NewDefaultBlockchainWithFaulty(network *DockerNetwork, numOfNormal int, numOfFaulty int) (bc *blockchain, err error)
func NewDefaultSmiloBlockchain ¶
func NewDefaultSmiloBlockchain(network *DockerNetwork, ctn VaultNetwork) (bc *blockchain, err error)
func NewDefaultSmiloBlockchainWithFaulty ¶
func NewDefaultSmiloBlockchainWithFaulty(network *DockerNetwork, ctn VaultNetwork, numOfNormal int, numOfFaulty int) (bc *blockchain, err error)
func NewDefaultVaultNetwork ¶
func NewDefaultVaultNetwork(network *DockerNetwork, numOfFullnodes int) (ctn *vaultNetwork, err error)
func NewEthereum ¶
func NewSmiloBlockchain ¶
func NewSmiloBlockchain(network *DockerNetwork, ctn VaultNetwork, options ...Option) (bc *blockchain, err error)
func NewVault ¶
func NewVault(c *client.Client, options ...VaultOption) *vault
func NewVaultNetwork ¶
func NewVaultNetwork(network *DockerNetwork, numOfFullnodes int, options ...VaultOption) (ctn *vaultNetwork, err error)
Types ¶
type Blockchain ¶
type DockerNetwork ¶
type DockerNetwork struct {
// contains filtered or unexported fields
}
func NewDockerNetwork ¶
func NewDockerNetwork() (*DockerNetwork, error)
func (*DockerNetwork) GetFreeIPAddrs ¶
func (n *DockerNetwork) GetFreeIPAddrs(num int) ([]net.IP, error)
func (*DockerNetwork) ID ¶
func (n *DockerNetwork) ID() string
func (*DockerNetwork) Name ¶
func (n *DockerNetwork) Name() string
func (*DockerNetwork) Remove ¶
func (n *DockerNetwork) Remove() error
func (*DockerNetwork) Subnet ¶
func (n *DockerNetwork) Subnet() string
type Ethereum ¶
type Ethereum interface { Init(string) error Start() error Stop() error NodeAddress() string Address() common.Address ContainerID() string Host() string NewClient() client.Client ConsensusMonitor(err chan<- error, quit chan struct{}) WaitForProposed(expectedAddress common.Address, t time.Duration) error WaitForPeersConnected(int) error WaitForBlocks(int, ...time.Duration) error WaitForBlockHeight(int) error // Want for block for no more than the given number during the given time duration WaitForNoBlocks(int, time.Duration) error // Wait for settling balances for the given accounts WaitForBalances([]common.Address, ...time.Duration) error AddPeer(string) error StartMining() error StopMining() error Accounts() []common.Address DockerEnv() []string DockerBinds() []string }
type NetworkManager ¶
type NetworkManager interface {
TryGetFreeSubnet() string
}
type NodeIncubator ¶
type Option ¶
type Option func(*ethereum)
func DockerBinds ¶
func DockerNetworkName ¶
func FaultyMode ¶
func HostDataDir ¶
func HostRPCPort ¶
func HostWebSocketPort ¶
func ImageRepository ¶
func Key ¶
func Key(key *ecdsa.PrivateKey) Option
func NoDiscover ¶
func NoDiscover() Option
func NodeKeyHex ¶
func RPCAddress ¶
func WebSocketAPI ¶
func WebSocketAddress ¶
func WebSocketOrigin ¶
func WebSocketPort ¶
type Vault ¶
type Vault interface { // GenerateKey() generates private/public key pair GenerateKey() (string, error) // Start() starts vault service Start() error // Stop() stops vault service Stop() error // Host() returns vault service url Host() string // Running() returns true if container is running Running() bool // WorkDir() returns local working directory WorkDir() string // ConfigPath() returns container config path ConfigPath() string // Binds() returns volume binding paths Binds() []string // PublicKeys() return public keys PublicKeys() []string }
*
- Vault interface and constructors *
type VaultNetwork ¶
type VaultNetwork interface { Start() error Stop() error Finalize() NumOfVaults() int GetVault(int) Vault }
Vault functions ----------------------------------------------------------------------------
type VaultOption ¶
type VaultOption func(*vault)
TODO: refactor this with ethereum options? *
- Vault options *
func CTDockerNetworkName ¶
func CTDockerNetworkName(dockerNetworkName string) VaultOption
func CTImageRepository ¶
func CTImageRepository(repository string) VaultOption
func CTImageTag ¶
func CTImageTag(tag string) VaultOption
func CTKeyName ¶
func CTKeyName(keyName string) VaultOption
func CTLogging ¶
func CTLogging(enabled bool) VaultOption
func CTOtherNodes ¶
func CTOtherNodes(urls []string) VaultOption
func CTSocketFilename ¶
func CTSocketFilename(socketFilename string) VaultOption
func CTWorkDir ¶
func CTWorkDir(workDir string) VaultOption
Click to show internal directories.
Click to hide internal directories.