Documentation ¶
Index ¶
- Constants
- Variables
- func GetProposer(header *types.Header) common.Address
- func NewBlockchain(network *DockerNetwork, numOfValidators int, options ...Option) (bc *blockchain)
- func NewConstellation(c *client.Client, options ...ConstellationOption) *constellation
- func NewConstellationNetwork(network *DockerNetwork, numOfValidators int, options ...ConstellationOption) (ctn *constellationNetwork)
- func NewDefaultBlockchain(network *DockerNetwork, numOfValidators int) (bc *blockchain)
- func NewDefaultBlockchainWithFaulty(network *DockerNetwork, numOfNormal int, numOfFaulty int) (bc *blockchain)
- func NewDefaultConstellationNetwork(network *DockerNetwork, numOfValidators int) (ctn *constellationNetwork)
- func NewDefaultQuorumBlockchain(network *DockerNetwork, ctn ConstellationNetwork) (bc *blockchain)
- func NewDefaultQuorumBlockchainWithFaulty(network *DockerNetwork, ctn ConstellationNetwork, numOfNormal int, ...) (bc *blockchain)
- func NewEthereum(c *docker.Client, options ...Option) *ethereum
- func NewQuorumBlockchain(network *DockerNetwork, ctn ConstellationNetwork, options ...Option) (bc *blockchain)
- type Blockchain
- type Constellation
- type ConstellationNetwork
- type ConstellationOption
- func CTDockerNetworkName(dockerNetworkName string) ConstellationOption
- func CTHost(ip net.IP, port int) ConstellationOption
- func CTImageRepository(repository string) ConstellationOption
- func CTImageTag(tag string) ConstellationOption
- func CTKeyName(keyName string) ConstellationOption
- func CTLogging(enabled bool) ConstellationOption
- func CTOtherNodes(urls []string) ConstellationOption
- func CTSocketFilename(socketFilename string) ConstellationOption
- func CTVerbosity(verbosity int) ConstellationOption
- func CTWorkDir(workDir string) ConstellationOption
- 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 IsQuorum(isQuorum 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 RPCPort(port int) Option
- func SyncMode(mode string) 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
Constants ¶
View Source
const ( FirstOctet = 172 SecondOctet = 17 )
Variables ¶
View Source
var ( ErrNoBlock = errors.New("no block generated") ErrTimeout = errors.New("timeout") )
Functions ¶
func NewBlockchain ¶
func NewBlockchain(network *DockerNetwork, numOfValidators int, options ...Option) (bc *blockchain)
func NewConstellation ¶
func NewConstellation(c *client.Client, options ...ConstellationOption) *constellation
func NewConstellationNetwork ¶
func NewConstellationNetwork(network *DockerNetwork, numOfValidators int, options ...ConstellationOption) (ctn *constellationNetwork)
func NewDefaultBlockchain ¶
func NewDefaultBlockchain(network *DockerNetwork, numOfValidators int) (bc *blockchain)
func NewDefaultBlockchainWithFaulty ¶
func NewDefaultBlockchainWithFaulty(network *DockerNetwork, numOfNormal int, numOfFaulty int) (bc *blockchain)
func NewDefaultConstellationNetwork ¶
func NewDefaultConstellationNetwork(network *DockerNetwork, numOfValidators int) (ctn *constellationNetwork)
func NewDefaultQuorumBlockchain ¶
func NewDefaultQuorumBlockchain(network *DockerNetwork, ctn ConstellationNetwork) (bc *blockchain)
func NewDefaultQuorumBlockchainWithFaulty ¶
func NewDefaultQuorumBlockchainWithFaulty(network *DockerNetwork, ctn ConstellationNetwork, numOfNormal int, numOfFaulty int) (bc *blockchain)
func NewEthereum ¶
func NewQuorumBlockchain ¶
func NewQuorumBlockchain(network *DockerNetwork, ctn ConstellationNetwork, options ...Option) (bc *blockchain)
Types ¶
type Blockchain ¶
type Constellation ¶
type Constellation interface { // GenerateKey() generates private/public key pair GenerateKey() (string, error) // Start() starts constellation service Start() error // Stop() stops constellation service Stop() error // Host() returns constellation 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 }
*
- Constellation interface and constructors *
type ConstellationNetwork ¶
type ConstellationNetwork interface { Start() error Stop() error Finalize() NumOfConstellations() int GetConstellation(int) Constellation }
Constellation functions ----------------------------------------------------------------------------
type ConstellationOption ¶
type ConstellationOption func(*constellation)
TODO: refactor this with ethereum options? *
- Constellation options *
func CTDockerNetworkName ¶
func CTDockerNetworkName(dockerNetworkName string) ConstellationOption
func CTImageRepository ¶
func CTImageRepository(repository string) ConstellationOption
func CTImageTag ¶
func CTImageTag(tag string) ConstellationOption
func CTKeyName ¶
func CTKeyName(keyName string) ConstellationOption
func CTLogging ¶
func CTLogging(enabled bool) ConstellationOption
func CTOtherNodes ¶
func CTOtherNodes(urls []string) ConstellationOption
func CTSocketFilename ¶
func CTSocketFilename(socketFilename string) ConstellationOption
func CTVerbosity ¶
func CTVerbosity(verbosity int) ConstellationOption
func CTWorkDir ¶
func CTWorkDir(workDir string) ConstellationOption
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 ¶
Click to show internal directories.
Click to hide internal directories.