cmd

package
v1.8.18 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2019 License: MIT Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// VERSION is set during build
	VERSION = "DEFAULT_VERSION"
)

Variables

View Source
var (
	ErrorMethodNotAllowed = errors.New("Method not allowed")
)
View Source
var RootCmd = &cobra.Command{
	Use:     "whiteblock",
	Version: VERSION,
	Short:   "Create and test blockchains",
	Long: `This application will deploy a blockchain, create nodes, and allow those nodes to interact in the network.
Documentation, usages, and exmaples can be found at https://docs.whiteblock.io/.
To report an issue: https://github.com/whiteblock/cli/issues/new?assignees=&labels=&template=bug_report.md&title=
	`,
}

Functions

func Build added in v1.8.17

func Build(cmd *cobra.Command, args []string, isAppend bool)

func CaptureAndDisplayTogether

func CaptureAndDisplayTogether(r1 io.Reader, r2 io.Reader, offset int, label1 string, label2 string)

Display the contents of two readers, line by line, together

func CaptureAndOutput

func CaptureAndOutput(r io.Reader)

func Execute

func Execute()

func GetBiome added in v1.8.17

func GetBiome(org Organization) (map[string]interface{}, error)

func GrabManyBlocks added in v1.8.17

func GrabManyBlocks(sem *semaphore.Weighted, start int, end int) ([]string, error)

func LoadBiomeAddress

func LoadBiomeAddress() error

func LoadProfile

func LoadProfile() error

func PadString

func PadString(str string, target int) string

Types

type BuildStatus

type BuildStatus struct {
	Error    map[string]string `json:"error"`
	Progress float64           `json:"progress"`
	Stage    string            `json:"stage"`
	Frozen   bool              `json:"frozen"`
}

type Contract added in v1.8.17

type Contract struct {
	DeployedNodeAddress string `json:"deployedNodeAddress,omitempty"`
	ContractName        string `json:"contractName,omitempty"`
	ContractAddress     string `json:"contractAddress,omitempty"`
}

type Node

type Node struct {
	ID           string            `json:"id"`
	TestNetID    string            `json:"testnetId"`
	Server       int               `json:"server"`
	LocalID      int               `json:"localId"`
	AbsoluteNum  int               `json:"absNum"`
	IP           string            `json:"ip"`
	Label        string            `json:"label"`
	Image        string            `json:"image"`
	Protocol     string            `json:"protocol"`
	PortMappings map[string]string `json:"portMappings,omitonempty"`
}

func GetNodes

func GetNodes() []Node

type Organization

type Organization struct {
	Id        int                      `json:"id"`
	Name      string                   `json:"name"`
	CreatedAt string                   `json:"created_at"`
	UpdatedAt string                   `json:"updated_at"`
	Biomes    []map[string]interface{} `json:"biomes"`
}

type Profile

type Profile struct {
	Id           int          `json:"id"`
	Organization Organization `json:"organization"`
}

func GetProfileFromJwt added in v1.8.17

func GetProfileFromJwt(jwt string) (Profile, error)

type Spinner

type Spinner struct {
	// contains filtered or unexported fields
}

func (*Spinner) Kill

func (this *Spinner) Kill()

func (*Spinner) Run

func (this *Spinner) Run(ms int)

func (*Spinner) SetText

func (this *Spinner) SetText(txt string)

type SqlQueryRequestPayload added in v1.8.12

type SqlQueryRequestPayload struct {
	Q string `json:"q"`
}

type WebsocketConnection

type WebsocketConnection struct {
	// contains filtered or unexported fields
}

func (*WebsocketConnection) Close

func (wsc *WebsocketConnection) Close()

func (*WebsocketConnection) GetMessage

func (wsc *WebsocketConnection) GetMessage() (message string, err error)

func (*WebsocketConnection) PingParams

func (wsc *WebsocketConnection) PingParams() (interval, timeout time.Duration)

func (*WebsocketConnection) WriteMessage

func (wsc *WebsocketConnection) WriteMessage(message string) error

type WebsocketTransport

type WebsocketTransport struct {
	PingInterval   time.Duration
	PingTimeout    time.Duration
	ReceiveTimeout time.Duration
	SendTimeout    time.Duration

	BufferSize int

	RequestHeader http.Header
}

func GetDefaultWebsocketTransport

func GetDefaultWebsocketTransport() *WebsocketTransport

* Returns websocket connection with default params

func (*WebsocketTransport) Connect

func (wst *WebsocketTransport) Connect(url string) (conn transport.Connection, err error)

func (*WebsocketTransport) HandleConnection

func (wst *WebsocketTransport) HandleConnection(
	w http.ResponseWriter, r *http.Request) (conn transport.Connection, err error)

func (*WebsocketTransport) Serve

* Websocket connection do not require any additional processing

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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