Documentation ¶
Overview ¶
Package cmd is app for pexpo.
Index ¶
- Variables
- func BuildAction(ctx *cli.Context) error
- func CompileSolidity(file []string, config Config) (string, error)
- func CreateContractAction(ctx *cli.Context) error
- func CreateContractsNoTemplate(name string) error
- func CreateDeploymentAction(ctx *cli.Context) error
- func DeployAction(ctx *cli.Context) error
- func DeployContracts(AbiName string, BinName string, net Network, input []interface{})
- func GetAllDeployFile() []string
- func GetAllSolFile() []string
- func GetContractMetaData(AbiName string, BinName string) *bind.MetaData
- func InitAction(ctx *cli.Context) error
- func InstallSolidity(version string) error
- func SolcVersion() (string, error)
- func Start()
- type Compiler
- type Config
- type Contract
- type Deployment
- type DeploymentDetails
- type Network
- type Rpc
- type SolTemplateData
Constants ¶
This section is empty.
Variables ¶
var ( // InitCommand is command to init new project. InitCommand = cli.Command{ Name: "init", Usage: "Init new project.", Flags: []cli.Flag{ &NameFlag, &CompilerVersionFlag, &CompilerOptimizeFlag, &CompilerRunsFlag, }, Action: InitAction, } // CreateCommand is command to create new solidity contract / deployment. CreateCommand = cli.Command{ Name: "create", Usage: "Create new solidity contract / deployment", Subcommands: []*cli.Command{ &ContractCommand, &DeploymentCommand, }, } // ContractCommand is subcommand to create contract. ContractCommand = cli.Command{ Name: "contract", Usage: "Create new solidity contract.", Flags: []cli.Flag{ &TemplateFlag, }, Action: CreateContractAction, } // DeploymentCommand is subcommand to create deployment. DeploymentCommand = cli.Command{ Name: "deployment", Usage: "Create new solidity deployment.", Action: CreateDeploymentAction, } // BuildCommand is command to build / compile solidity contracts. BuildCommand = cli.Command{ Name: "build", Aliases: []string{"compile"}, Usage: "Build / Compile solidity contracts.", Action: BuildAction, } // DeployCommand is command to deploying solidity contracts. DeployCommand = cli.Command{ Name: "deploy", Usage: "Deploy solidity contract.", Flags: []cli.Flag{ &NetworkFlag, }, Action: DeployAction, } )
var ( // NameFlag is flag set set name. NameFlag = cli.StringFlag{ Name: "name", Usage: "Specify name.", Value: "pexpo", } // CompilerVersionFlag is flag to set compiler version. CompilerVersionFlag = cli.StringFlag{ Name: "compiler.version", Usage: "Specify solidity compiler version.", Value: "0.8.10", } // CompilerOptimizeFlag is flag to set compiler optimization. CompilerOptimizeFlag = cli.BoolFlag{ Name: "compiler.optimize", Usage: "Set compiler optimization", Value: false, } // CompilerRunsFlag is flag to set the number of compiler optimization runs. CompilerRunsFlag = cli.IntFlag{ Name: "compiler.runs", Usage: "Set the number of compiler optimization", Value: 0, } // NetworkFlag is flag to specify network. NetworkFlag = cli.StringFlag{ Name: "network", Usage: "Specify the network.", Value: "dev", } // TemplateFlag is flag for specify template. TemplateFlag = cli.StringFlag{ Name: "template", Usage: "Specify the template.", Value: "default", } )
var DeploymentResult = `` /* 133-byte string literal not displayed */
DeploymentResult is message template for deployment details.
var ( // PexpoHelpTemplate is help templates for pexpo cli app. PexpoHelpTemplate = `` /* 547-byte string literal not displayed */ )
var RpcList = []Rpc{
{Name: "dev", Host: "http://localhost:8545"},
{Name: "ropsten", Host: "https://ropsten.infura.io/v3/9254e752ae1a496d8469caa85485e1b8"},
{Name: "kovan", Host: "https://kovan.infura.io/v3/9254e752ae1a496d8469caa85485e1b8"},
{Name: "rinkbey", Host: "https://rinkeby.infura.io/v3/9254e752ae1a496d8469caa85485e1b8"},
{Name: "goerli", Host: "https://goerli.infura.io/v3/9254e752ae1a496d8469caa85485e1b8"},
{Name: "eth", Host: "https://mainnet.infura.io/v3/9254e752ae1a496d8469caa85485e1b8"},
{Name: "mumbai", Host: "https://polygon-mumbai.infura.io/v3/9254e752ae1a496d8469caa85485e1b8"},
{Name: "polygon", Host: "https://polygon-mainnet.infura.io/v3/9254e752ae1a496d8469caa85485e1b8"},
}
RpcList is list of many json-rpc api server.
Functions ¶
func BuildAction ¶
func BuildAction(ctx *cli.Context) error
BuildAction is action to build / compile solidity contracts.
func CompileSolidity ¶
CompileSolidity is a function to compile solidity file.
func CreateContractAction ¶
func CreateContractAction(ctx *cli.Context) error
CreateContractAction is action to create new solidity contract
func CreateContractsNoTemplate ¶
CreateContractsNoTemplate is function to create new contracts without template.
func CreateDeploymentAction ¶
func CreateDeploymentAction(ctx *cli.Context) error
CreateDeploymentAction is action to create new solidity deployment.
func DeployAction ¶
func DeployAction(ctx *cli.Context) error
DeployAction is action to deploy solidity contracts.
func DeployContracts ¶
DeployContracts will deploy the contracts.
func GetAllDeployFile ¶
func GetAllDeployFile() []string
GetAllDeployFile will get all bin and abi file.
func GetContractMetaData ¶
GetContractMetaData will return the contract metadta.
func InstallSolidity ¶
InstallSolidity will install solc using npm.
Types ¶
type Compiler ¶
type Compiler struct { Version string `json:"version"` Optimize bool `json:"optimize"` Runs int `json:"runs"` }
Compiler is struct of config.compiler.
type Config ¶
type Config struct { Name string `json:"name"` Networks map[string]Network `json:"networks"` Compiler Compiler `json:"compiler"` }
Config is struct of config file.
type Contract ¶
type Contract struct { Auth *bind.TransactOpts Backend bind.ContractBackend MetaData *bind.MetaData Input []interface{} }
Contract is structure of the contract management.
type Deployment ¶
type Deployment struct { Contract string `json:"contract"` Input []interface{} `json:"input"` }
Deployment is struct for deployment file.
type DeploymentDetails ¶
type DeploymentDetails struct { Contract string // Contract address Deployer string // Deployer address Hash string // Tx hash }
DeploymentDetails is struct for deployment details.
type SolTemplateData ¶
SolTemplateData is template data to fetch solidity file.