Skip to content

Commit

Permalink
Improve documentation of create recipe (#543)
Browse files Browse the repository at this point in the history
* Improve documentation of create recipe

* Conditions were removed in commit 9148a61

* Adding quotes to command help

* removing conditions tag

* Update x/pylons/client/cli/tx_recipe.go

Co-authored-by: Barrie Byron <[email protected]>

* Update x/pylons/client/cli/tx_recipe.go

Co-authored-by: Barrie Byron <[email protected]>

Co-authored-by: Barrie Byron <[email protected]>
  • Loading branch information
Rafael de Andrade and Barrie Byron authored Dec 17, 2021
1 parent dbf44bf commit 59cc4b2
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 13 deletions.
14 changes: 2 additions & 12 deletions docs/RECIPE_WALKTHROUGH.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,12 +321,7 @@ Finally we have have our tradePercentage, tradeable, and outputs reflecting what
"key": "entityType",
"value": "character"
}
],
"conditions": {
"doubles": [],
"longs": [],
"strings": []
}
]
},
{
"ID": "sword",
Expand All @@ -344,12 +339,7 @@ Finally we have have our tradePercentage, tradeable, and outputs reflecting what
"maxValue": 10000000
}
],
"strings": [],
"conditions": {
"doubles": [],
"longs": [],
"strings": []
}
"strings": []
}
],
"entries": {
Expand Down
38 changes: 37 additions & 1 deletion x/pylons/client/cli/tx_recipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,43 @@ func CmdCreateRecipe() *cobra.Command {
cmd := &cobra.Command{
Use: "create-recipe [cookbook-id] [id] [name] [description] [version] [coin-inputs] [item-inputs] [entries] [outputs] [block-interval] [cost-per-block] [enabled] [extra-info]",
Short: "create new recipe",
Args: cobra.ExactArgs(13),
Long: `
The core of developing experiences on Pylons is the recipe. The structure of a recipe is complex and to have a more detailed
info on how to create recipes and having complete examples, please see https://github.com/Pylons-tech/pylons/blob/main/docs/RECIPE_WALKTHROUGH.md.
All the recipe fields are mandatory:
* "CookbookID" is the ID of the cookbook that contains this recipe.
* "RecipeID" is the unique identifier for this particular recipe.
* "Name" is the name of the recipe.
* "Description" is the plain text description of the recipe.
* "CoinInputs" detail which coins are required to run the recipe.
* "ItemInputs" detail which items are required to run the recipe.
* "Entries" is a list of the various outputs from the recipe. Items are established with an ID and a set of doubles, longs, and strings to refine the outputs.
* "Outputs" calls the unique IDs of the items in the entries list and uses the IDs as outputs after the execution of the recipe.
* "BlockInterval" indicates what block the recipe executes. For example, if blockInterval is at 2, the recipe executes after the chain has executed 2 blocks.
* "CostPerBlock" is a Cosmos SDK coin that is used to build the fee for paying for the execute-recipe transaction before the recipe blockInterval is met.
* "Enabled" is a boolean variable to enable the recipe.
`,
Example: `
pylonsd tx pylons create-recipe \
loud123456 \
recipe_loud123456 \
"Legend of the Undead Dragon" \
"Cookbook for running pylons recreation of LOUD" \
v0.3.1 \
"[\"100000uatom\",\"10000000ubedrock\"]" \
"[]" \
"{}" \
"[]" \
1 \
10000upylon \
true \
extra-info \
--from pylo1tqqp6wmctv0ykatyaefsqy6stj92lnt800lkee
`,
Args: cobra.ExactArgs(13),
RunE: func(cmd *cobra.Command, args []string) error {
argsCookbookID := args[0]
id := args[1]
Expand Down

0 comments on commit 59cc4b2

Please sign in to comment.