command

package
v0.0.0-...-42fb836 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Account = &cobra.Command{
	Use:   "account",
	Short: "tools to manage network accounts",
	Long:  `A set of commands to support the management of accounts.`,
	Run: func(cmd *cobra.Command, args []string) {

		cmd.HelpFunc()(cmd, args)
	},
}
View Source
var Assets = &cobra.Command{
	Use:   "assets",
	Short: "",
	Long:  ``,
	Run: func(cmd *cobra.Command, args []string) {
		const url = "https://api.pinata.cloud/data/testAuthentication"

		client := &http.Client{}
		req, err := http.NewRequest("GET", url, nil)
		if err != nil {
			fmt.Fprintln(os.Stderr, "error: "+err.Error())
			os.Exit(1)
		}
		req.Header.Set("pinata_api_key", viper.GetString("PINATA_KEY"))
		req.Header.Set("pinata_secret_api_key", viper.GetString("PINATA_SEC"))

		res, err := client.Do(req)
		if err != nil {
			fmt.Fprintln(os.Stderr, "error: "+err.Error())
			os.Exit(1)
		}
		body, err := ioutil.ReadAll(res.Body)
		if err != nil {
			fmt.Fprintln(os.Stderr, "error: "+err.Error())
			os.Exit(1)
		}
		msg := PinTestResponse{}
		if err := json.Unmarshal(body, &msg); nil != err {
			fmt.Fprintln(os.Stderr, "error: "+err.Error())
			os.Exit(1)
		}

		fmt.Printf(":: Testing Pinata api keys on %s \n", url)
		fmt.Printf(">> Response: %s \n\n", msg.Message)

		cmd.HelpFunc()(cmd, args)
	},
}
View Source
var Contract = &cobra.Command{
	Use:   "contract",
	Short: "",
	Long:  ``,
	Run: func(cmd *cobra.Command, args []string) {

		cmd.HelpFunc()(cmd, args)
	},
}
View Source
var Network = &cobra.Command{
	Use:   "network",
	Short: "tools to control a local network node",
	Long:  `A set of commands to support the management of a network nodes.`,
	Run: func(cmd *cobra.Command, args []string) {

		cmd.HelpFunc()(cmd, args)
	},
}

Functions

This section is empty.

Types

type Arc3App

type Arc3App struct {
	App      string `json:"app"`
	Name     string `json:"name"`
	UnitMax  string `json:"unitmax"`
	UnitName string `json:"unitname"`

	Image           string `json:"image"`
	Image_integrity string `json:"image_integrity"`
	Image_mimetype  string `json:"image_mimetype"`
}

Arc3App ASA Metadata Info (SA042-ASA)

type Arc3Asset

type Arc3Asset struct {
	Name     string `json:"name"`
	UnitName string `json:"unitname"`

	Image           string `json:"image"`
	Image_integrity string `json:"image_integrity"`
	Image_mimetype  string `json:"image_mimetype"`

	Properties SAAsset `json:"properties"`
}

Arc3Asset ASA Metadata Info (SA076-ASA)

type PinFileResponse

type PinFileResponse struct {
	PinSize   uint64 `json:"PinSize"`
	IpfsHash  string `json:"IpfsHash"`
	Timestamp string `json:"Timestamp"`
}

type PinTestResponse

type PinTestResponse struct {
	Message string `json:"message"`
}

type SAAsset

type SAAsset struct {
	// Traits     SATraits     `json:"traits"`
	Collection SACollection `json:"collection"`
}

SAAsset Asset Properies (SA101)

type SACollection

type SACollection struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Metadata string `json:"metadata"`
}

SACollection ASA Collection (SA042)

Jump to

Keyboard shortcuts

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