Conversation
packages/cli/src/index.ts
Outdated
| } | ||
| ) | ||
| .command( | ||
| "lightnet:wait-for-network", |
There was a problem hiding this comment.
So I had imagined this as a bit more reusable. Something like protokit run deposit where run says "execute a script" and deposit is the name of the script.
Where the script can either be one of our predefined scripts or a user-supplied one from the starter kit.
Now to realize this we have a few tools available that yargs gives us:
We can do nested commands: https://github.com/yargs/yargs/blob/main/example/nested.mjs
We can also let yargs go through the directories automatically and scaffold the command structure: https://github.com/yargs/yargs/blob/main/example/command_hierarchy.mjs
Some combination of this would be the most intuitive, create a mechanism to structure this on the framework side and then plug in the starter-kit side into the same mechanism
There was a problem hiding this comment.
More information on the folder stuff: https://github.com/yargs/yargs/blob/main/docs/advanced.md#providing-a-command-module
…-functionality-update
…y-update Feat/cli extended functionality update
…proto-kit/framework into feat/cli-extended-functionality
… feat/cli-extended-functionality
Description
This PR extends the Proto-Kit CLI with new commands for environment setup, bridge , settlement deployment, and explorer management.
New Commands
Environment Management
wizardprotokit wizardBridge Operations
bridge deposit <tokenId> <fromKey> <toKey> <amount>tokenId- Token identifierfromKey- Sender's private key (or environment variable name)toKey- Recipient's public key (or environment variable name)amount- Amount to deposit (in whole units)protokit bridge deposit 1 SENDER_KEY RECIPIENT_KEY 100bridge redeem <tokenId> <toKey> <amount>tokenId- Token identifiertoKey- Recipient's public key (or environment variable name)amount- Amount to redeemprotokit bridge redeem 1 RECIPIENT_KEY 100bridge withdraw <tokenId> <senderKey> <amount>tokenId- Token identifiersenderKey- Sender's private key (or environment variable name)amount- Amount to withdrawprotokit bridge withdraw 1 SENDER_KEY 100Settlement Deployment
settlement deployprotokit settlement deploysettlement token-deploy <tokenSymbol> <feepayerKey> <receiverPublicKey> [mintAmount]tokenSymbol- Symbol for the token (e.g., "USDC")feepayerKey- Private key for paying deployment feesreceiverPublicKey- Public key to receive minted tokens[mintAmount]- Amount to mint initially (default: 0)protokit settlement token-deploy 1 FEEPAYER_KEY RECEIVER_KEY 1000Lightnet Utilities
lightnet waitprotokit lightnet waitlightnet faucet <publicKey>publicKey- Destination public key (or environment variable name)protokit lightnet faucet B62qnzbXQcUoQFnjvF4Kog6KfNsuuSoo7LSLvomPeak2CLvEYiUqTlightnet initializeprotokit lightnet initializeDeveloper Tools
generate-keys [count][count]- Number of key pairs to generate (default: 1)protokit generate-keys 5explorer start-p, --port- Port to run on (default: 5003)--indexer-url- GraphQL endpoint URL for the indexerprotokit explorer start -p 3000 --indexer-url http://localhost:8081/graphqlAll commands that interact with environment variable can be handled through two options:
Option 1:
--env-path(File-based)Loads environment variables from a
.envfileOption 2:
--set KEY=valuePasses environment variables directly as command-line arguments. Can be used multiple times.
Option 3:
--env {envName}Passes environment name.
closes #353