Skip to content

Commit 46f6bcc

Browse files
committed
extend
1 parent 341de2b commit 46f6bcc

File tree

3 files changed

+553
-63
lines changed

3 files changed

+553
-63
lines changed

framework/cmd/main.go

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,28 @@ func main() {
2929
Name: "env",
3030
Aliases: []string{"e"},
3131
Usage: "Generate a Chainlink Node developer environment",
32-
Description: `This utility generate a Chainlink Node Cluster (DON) environment.
33-
Default setup includes:
34-
- Anvil (EVM emulator from Foundry) or Geth blockchain nodes
35-
- Chainlink Nodes
36-
- Fake server (for 3rd party dependencies)
37-
- Test boilerplates, CI and documentation
32+
Description: `🔗 Chainlink's Developer Environment Generator 🔗
33+
34+
Prerequisites:
35+
We are using Just, please install it first - https://github.com/casey/just
3836
3937
Usage:
4038
41-
Generate a basic environment:
42-
ctf gen env --cli myenv --nodes 4
39+
⚙️ Generate basic environment:
40+
ctf gen env --cli myenv --product-name Knilniahc --nodes 4
41+
42+
🔧 Address all TODO comments and customize it if needed
43+
44+
💻 Enter the shell and spin up the environment:
45+
cd devenv && just cli && myenv sh
46+
47+
🔍 Implement system-level smoke tests (tests/smoke_test.go) and run them:
48+
myenv test smoke
49+
50+
📈 Implement load/chaos tests (tests/load_test.go) and run them:
51+
myenv test load
52+
53+
🔄 Enforce quality standards in CI: copy .github/workflows to your CI folder and commit
4354
`,
4455
ArgsUsage: "",
4556
Flags: []cli.Flag{
@@ -48,6 +59,17 @@ Usage:
4859
Aliases: []string{"c"},
4960
Usage: "Your devenv CLI binary name",
5061
},
62+
&cli.StringFlag{
63+
Name: "product-name",
64+
Aliases: []string{"r"},
65+
Usage: "Your product name",
66+
},
67+
&cli.StringFlag{
68+
Name: "product-configuration-type",
69+
Aliases: []string{"p"},
70+
Value: "evm-single",
71+
Usage: "Product configuration type/layout (single network, multi-network, etc)",
72+
},
5173
&cli.IntFlag{
5274
Name: "nodes",
5375
Aliases: []string{"n"},
@@ -56,17 +78,23 @@ Usage:
5678
},
5779
},
5880
Action: func(c *cli.Context) error {
81+
productConfType := c.String("product-configuration-type")
5982
nodes := c.Int("nodes")
6083
cliName := c.String("cli")
6184
if cliName == "" {
6285
return fmt.Errorf("CLI name can't be empty, choose your CLI name")
6386
}
87+
productName := c.String("product-name")
88+
if productName == "" {
89+
return fmt.Errorf("Product name must be specified, call your product somehow, any name")
90+
}
6491
framework.L.Info().
6592
Str("Name", cliName).
6693
Int("CLNodes", nodes).
94+
Str("ProductConfigurationType", productConfType).
6795
Msg("Generating developer environment")
6896

69-
cg, err := framework.NewEnvBuilder(cliName, nodes).Build()
97+
cg, err := framework.NewEnvBuilder(cliName, nodes, productConfType, productName).Build()
7098
if err != nil {
7199
return fmt.Errorf("failed to create codegen: %w", err)
72100
}

0 commit comments

Comments
 (0)