commands

package
v0.11.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2015 License: GPL-3.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const VERSION = version.VERSION

Variables

View Source
var Actions = &cobra.Command{
	Use:   "actions",
	Short: "Manage and perform structured actions.",
	Long: `Display and manage actions for various components of the
Eris platform and for the platform itself.

Actions are bundles of commands which rely upon a project
which is currently in scope or on a global set of actions.
Actions are held in yaml, toml, or json action-definition
files within the action folder in the eris tree (globally
scoped actions) or in a directory pointed to by the
actions field of the currently checked out project
(project scoped actions). Actions are a sequence of
commands which operate in a similar fashion to how a
circle.yml file or a .travis.yml script field may operate.

Actions execute in a series of individual sub-shells ran
on the host. Note actions do not run from inside containers
but can interact with containers either via the installed
eris commands or via the docker cli itself or, indeed, any
other programs installed *on the host*.`,
	Run: func(cmd *cobra.Command, args []string) { cmd.Help() },
}

Primary Actions Sub-Command flags to add: --global --project

View Source
var Chains = &cobra.Command{
	Use:   "chains",
	Short: "Start, stop, and manage blockchains.",
	Long: `Start, stop, and manage blockchains.

The chains subcommand is used to work on erisdb smart contract
blockchain networks. The name is not perfect, as eris is able
to operate a wide variety of blockchains out of the box. Most
of those existing blockchains should be ran via the [eris services ...]
commands. As they fall under the rubric of "things I just want
to turn on or off". While you can develop against those
blockchains, you generally aren't developing those blockchains
themselves. [eris chains ...] commands are built to help you build
blockchains. It is our opinionated gateway to the wonderful world
of permissioned smart contract networks.

Your own blockchain/smart contract machine is just an [eris chains new]
away!`,
	Run: func(cmd *cobra.Command, args []string) { cmd.Help() },
}

Primary Chains Sub-Command

View Source
var Clean = &cobra.Command{
	Use:   "clean",
	Short: "Cleans up your eris working environment",
	Long: `Stops and force removes all eris containers 
	(chains, services, datas, etc) by default. Useful
	for development.`,
	Run: func(cmd *cobra.Command, args []string) {
		CleanItUp(cmd, args)
	},
}

TODO better explanations of command

View Source
var Config = &cobra.Command{
	Use:   "config",
	Short: "Manage configuration settings.",
	Long: `Display and manage configuration settings for various components of the
Eris platform and for the platform itself.

The [eris config] command is only for configuring the Eris platform:
it will not work to configure any of the blockchains, services
or projects which are managed by the Eris platform. To configure
blockchains use [eris chains config]; to configure services use [eris services config]; 
to configure projects use [eris projects config] command.`,
	Run: func(cmd *cobra.Command, args []string) { cmd.Help() },
}
View Source
var Contracts = &cobra.Command{
	Use:   "contracts",
	Short: "Deploy, Test, and Manage Your Smart Contracts.",
	Long: `The contracts subcommand is used to test and deploy
smart contracts for use by your application.`,
	Run: func(cmd *cobra.Command, args []string) { cmd.Help() },
}

Primary Contracts Sub-Command

View Source
var Cum []int
View Source
var Data = &cobra.Command{
	Use:   "data",
	Short: "Manage data containers for your application.",
	Long: `The data subcommand is used to import, and export
data into containers for use by your application.

The [eris data import] and [eris data export] commands should be 
thought of from the point of view of the container.

The [eris data import] command sends files *as is* from 
~/.eris/data/NAME on the host to ~/.eris/ inside 
of the data container.

The [eris data export] command performs this process in the reverse. 
It sucks out whatever is in the volumes of the data container 
and sticks it back into ~/.eris/data/NAME on the host.

At Eris, we use this functionality to formulate little JSONs
and configs on the host and then "stick them back into the
containers"`,
	Run: func(cmd *cobra.Command, args []string) { cmd.Help() },
}

Primary Data Sub-Command

View Source
var ErisCmd = &cobra.Command{
	Use:   "eris COMMAND [FLAG ...]",
	Short: "The Blockchain Application Platform",
	Long: `Eris is a platform for building, testing, maintaining, and operating
distributed applications with a blockchain backend. Eris makes it easy
and simple to wrangle the dragons of smart contract blockchains.

Made with <3 by Eris Industries.

Complete documentation is available at https://docs.erisindustries.com
` + "\nVersion:\n  " + VERSION,
	PersistentPreRun: func(cmd *cobra.Command, args []string) {
		var logLevel log.LogLevel
		if do.Verbose {
			logLevel = 2
		} else if do.Debug {
			logLevel = 3
		}
		log.SetLoggers(logLevel, config.GlobalConfig.Writer, config.GlobalConfig.ErrorWriter)

		ipfs.IpfsHost = config.GlobalConfig.Config.IpfsHost

		util.DockerConnect(do.Verbose, do.MachineName)
	},
	PersistentPostRun: func(cmd *cobra.Command, args []string) {
		err := config.SaveGlobalConfig(config.GlobalConfig.Config)
		if err != nil {
			logger.Errorln(err)
		}
		log.Flush()
	},
}

Defining the root command

View Source
var Files = &cobra.Command{
	Use:   "files",
	Short: "Manage files needed for your application using IPFS.",
	Long: `The files subcommand is used to import, and export
files to and from IPFS for use on the host machine.

These commands are provided in addition to the various
functionality which is included throughout the tool, such as
services import or services export which operate more
precisely. The eris files command is used as a general wrapper
around an IPFS gateway which would be running as eris services ipfs.

At times, due to the manner in which IPFS boots files commands
will fail. If you get errors when running eris files commands
then please run [eris services start ipfs] give that a second
or two to boot and then retry the eris files command which failed.`,
	Run: func(cmd *cobra.Command, args []string) { cmd.Help() },
}

Primary Files Sub-Command Flags to add: ipfsHost

View Source
var Help = &cobra.Command{
	Use:   "help COMMAND",
	Short: "Help about a command",
	Long: `Provide help for any command in the application.
Type eris help COMMAND for full details.`,
	PersistentPreRun:  func(cmd *cobra.Command, args []string) {},
	PersistentPostRun: func(cmd *cobra.Command, args []string) {},

	Run: func(c *cobra.Command, args []string) {
		cmd, _, e := c.Root().Find(args)
		if cmd == nil || e != nil {
			c.Printf("Unknown help topic %#q.", args)
			c.Root().Usage()
		} else {

			helpFunc := cmd.HelpFunc()
			helpFunc(cmd, args)
		}
	},
}
View Source
var Init = &cobra.Command{
	Use:   "init",
	Short: "Initialize the ~/.eris directory with default files or update to latest version",
	Long: `Create the ~/.eris directory with actions and services subfolders
and clone eris-ltd/eris-actions eris-ltd/eris-services into them, respectively.`,
	Run: func(cmd *cobra.Command, args []string) {
		Router(cmd, args)
	},
}

flags to add: --no-clone

View Source
var Keys = &cobra.Command{
	Use:   "keys",
	Short: "Do specific tasks with keys *for dev only*.",
	Long: `The keys subcommand is an opiniated wrapper around
eris-keys and requires a keys container to be running. 

It is for development only. 
Advanced functionality is available via: [eris services exec keys "eris-keys CMD"]
	
see https://docs.erisindustries.com/documentation/eris-keys/ for more info`,
	Run: func(cmd *cobra.Command, args []string) { cmd.Help() },
}
View Source
var ListEverything = &cobra.Command{
	Use:   "ls",
	Short: "List all the things eris knows about.",
	Long: `List all known definition files for services
and chains. Also lists all existing and running services and
chains and, data containers.

For more detailed output, use [eris services ls], [eris chains ls], 
and [eris data ls] commands with respective flags (--known, --existing, 
--running).`,

	Run: func(cmd *cobra.Command, args []string) {
		ListAllTheThings()
	},
}
View Source
var ManPage = &cobra.Command{
	Use:   "man",
	Short: "Display a man page.",
	Long:  `Display the Eris man page.`,
	Run: func(cmd *cobra.Command, args []string) {
		man := new(bytes.Buffer)

		GenerateManPage(man)
		DisplayManPage(man)
	},
}
View Source
var Projects = &cobra.Command{
	Use:   "projects",
	Short: "Start, Stop, and Manage Projects or Applications.",
	Long: `Start, stop, and manage projects or applications.

Within the Eris platform, projects are a bundle of services,
and actions which are configured to run in a specific manner.
Projects may be defined either by a package.json file in the
root of an application's directory or via a docker-compose.yml
file in the root of an application's directory. Projects are
given a human readable name so that Eris can checkout and
operate the application or project.`,
	Run: func(cmd *cobra.Command, args []string) { cmd.Help() },
}

Primary Projects Sub-Command

View Source
var Remotes = &cobra.Command{
	Use:   "remotes",
	Short: "Manage and Perform Remote Machines and Services.",
	Long: `Display and Manage remote machines which are operating
various services reachable by the Eris platform.

Actions, if configured as such, can utilize remote machines.
To register and manage remote machines for sending of actions
to those machines, use this command.`,
	Run: func(cmd *cobra.Command, args []string) { cmd.Help() },
}
View Source
var Services = &cobra.Command{
	Use:   "services",
	Short: "Start, stop, and manage services required for your application.",
	Long: `Start, stop, and manage services required for your application.

Services are all services known and used by the Eris platform with the
exception of blockchain services.`,
	Run: func(cmd *cobra.Command, args []string) { cmd.Help() },
}

Primary Services Sub-Command

View Source
var Update = &cobra.Command{
	Use:   "update",
	Short: "Update the eris tool",
	Long: `Fetch the latest version (master branch by default)
and re-install eris; requires git and go to be installed.`,
	Run: func(cmd *cobra.Command, args []string) {
		UpdateTool(cmd, args)
	},
}
View Source
var VerSion = &cobra.Command{
	Use:   "version",
	Short: "Display Eris's Platform Version.",
	Long:  `Display the current installed version of Eris.`,
	Run:   DisplayVersion,
}

Functions

func AddCommands

func AddCommands()

Define the commands

func AddGlobalFlags

func AddGlobalFlags()

Flags that are to be used by commands are handled by the Do struct Define the persistent commands (globals)

func ArgCheck

func ArgCheck(num int, comp string, cmd *cobra.Command, args []string) error

func CatChain

func CatChain(cmd *cobra.Command, args []string)

func CatService

func CatService(cmd *cobra.Command, args []string)

func CheckoutChain

func CheckoutChain(cmd *cobra.Command, args []string)

checkout a chain

func CleanItUp

func CleanItUp(cmd *cobra.Command, args []string)

func ContractsDeploy

func ContractsDeploy(cmd *cobra.Command, args []string)

func ContractsExport

func ContractsExport(cmd *cobra.Command, args []string)

func ContractsImport

func ContractsImport(cmd *cobra.Command, args []string)

func ContractsTest

func ContractsTest(cmd *cobra.Command, args []string)

func ConvertKey

func ConvertKey(cmd *cobra.Command, args []string)

func CurrentChain

func CurrentChain(cmd *cobra.Command, args []string)

func DisplayManPage

func DisplayManPage(in *bytes.Buffer)

DisplayManPage runs the groff(1) formatter on a buffer and then starts a pager to display the result.

func DisplayVersion

func DisplayVersion(cmd *cobra.Command, args []string)

func DoAction

func DoAction(cmd *cobra.Command, args []string)

func EditAction

func EditAction(cmd *cobra.Command, args []string)

func EditChain

func EditChain(cmd *cobra.Command, args []string)

edit a chain definition file

func EditService

func EditService(cmd *cobra.Command, args []string)

func ExecChain added in v0.10.2

func ExecChain(cmd *cobra.Command, args []string)

func ExecData

func ExecData(cmd *cobra.Command, args []string)

func ExecService added in v0.10.2

func ExecService(cmd *cobra.Command, args []string)

func Execute

func Execute()

func ExportAction

func ExportAction(cmd *cobra.Command, args []string)

func ExportChain

func ExportChain(cmd *cobra.Command, args []string)

func ExportData

func ExportData(cmd *cobra.Command, args []string)

func ExportKey

func ExportKey(cmd *cobra.Command, args []string)

func ExportService

func ExportService(cmd *cobra.Command, args []string)

func FilesCat added in v0.10.2

func FilesCat(cmd *cobra.Command, args []string)

func FilesGet added in v0.10.2

func FilesGet(cmd *cobra.Command, args []string)

func FilesList added in v0.10.2

func FilesList(cmd *cobra.Command, args []string)

func FilesManageCached added in v0.10.2

func FilesManageCached(cmd *cobra.Command, args []string)

func FilesPin added in v0.10.2

func FilesPin(cmd *cobra.Command, args []string)

func FilesPut added in v0.10.2

func FilesPut(cmd *cobra.Command, args []string)

func FlagCheck

func FlagCheck(num int, comp string, cmd *cobra.Command, flags []string) error

restrict flag behaviour when needed (rare but used sometimes)

func GenerateKey

func GenerateKey(cmd *cobra.Command, args []string)

func GenerateManPage

func GenerateManPage(man *bytes.Buffer)

GenerateManPages uses the Cobra commands' info to construct a man page. It fills in the man buffer with the groff(1) markup code.

func GetPubKey

func GetPubKey(cmd *cobra.Command, args []string)

func GraduateChain

func GraduateChain(cmd *cobra.Command, args []string)

func ImportAction

func ImportAction(cmd *cobra.Command, args []string)

func ImportChain

func ImportChain(cmd *cobra.Command, args []string)

import a chain definition file

func ImportData

func ImportData(cmd *cobra.Command, args []string)

func ImportKey

func ImportKey(cmd *cobra.Command, args []string)

func ImportService

func ImportService(cmd *cobra.Command, args []string)

install

func InitializeConfig

func InitializeConfig()

func InspectChain

func InspectChain(cmd *cobra.Command, args []string)

func InspectData

func InspectData(cmd *cobra.Command, args []string)

func InspectService

func InspectService(cmd *cobra.Command, args []string)

func InstallChain

func InstallChain(cmd *cobra.Command, args []string)

fetch and install a chain

the idea here is you will either specify a chainName as the arg and that will double as the chainID, or you want a local reference name for the chain, so you specify the chainID with a flag and give your local reference name as the arg

func KillChain

func KillChain(cmd *cobra.Command, args []string)

func KillService

func KillService(cmd *cobra.Command, args []string)

func ListActions

func ListActions(cmd *cobra.Command, args []string)

func ListAllChains

func ListAllChains(cmd *cobra.Command, args []string)

func ListAllServices

func ListAllServices(cmd *cobra.Command, args []string)

func ListAllTheThings

func ListAllTheThings()

func ListKnownData

func ListKnownData(cmd *cobra.Command, args []string)

----------------------------------------------------

func LogChain

func LogChain(cmd *cobra.Command, args []string)

func LogService

func LogService(cmd *cobra.Command, args []string)

func MakeGenesisFile

func MakeGenesisFile(cmd *cobra.Command, args []string)

func NewAction

func NewAction(cmd *cobra.Command, args []string)

func NewChain

func NewChain(cmd *cobra.Command, args []string)

create a new chain

genesis is either given or a simple single-validator genesis will be laid for you

func NewService

func NewService(cmd *cobra.Command, args []string)

func PlopChain added in v0.10.2

func PlopChain(cmd *cobra.Command, args []string)

func PortsChain added in v0.10.2

func PortsChain(cmd *cobra.Command, args []string)

func PortsService added in v0.10.2

func PortsService(cmd *cobra.Command, args []string)

func RegisterChain added in v0.10.3

func RegisterChain(cmd *cobra.Command, args []string)

register a chain in the etcb chain registry

func RenameAction

func RenameAction(cmd *cobra.Command, args []string)

func RenameChain

func RenameChain(cmd *cobra.Command, args []string)

func RenameData

func RenameData(cmd *cobra.Command, args []string)

func RenameService

func RenameService(cmd *cobra.Command, args []string)

func RmAction

func RmAction(cmd *cobra.Command, args []string)

func RmChain

func RmChain(cmd *cobra.Command, args []string)

func RmData

func RmData(cmd *cobra.Command, args []string)

func RmService

func RmService(cmd *cobra.Command, args []string)

func Router added in v0.10.2

func Router(cmd *cobra.Command, args []string)

func StartChain

func StartChain(cmd *cobra.Command, args []string)

func StartService

func StartService(cmd *cobra.Command, args []string)

func UpdateChain

func UpdateChain(cmd *cobra.Command, args []string)

func UpdateService

func UpdateService(cmd *cobra.Command, args []string)

Updates an installed service, or installs it if it has not been installed.

func UpdateTool

func UpdateTool(cmd *cobra.Command, args []string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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