Meroctl
Meroctl is a command-line tool that enables you to interact with your Calimero node directly from the shell.
Installation
You can choose to install meroctl using either the installation script or
Homebrew.
- Homebrew
- Installation Script
If you use Homebrew, you can install meroctl directly with the following
steps:
Steps
-
Add the Calimero Homebrew tap:
brew tap calimero-network/homebrew-tap -
Install
merod:brew install meroctl -
Verify the installation:
meroctl --version
If the version number appears, the installation was successful.
The installation script supports multiple terminal environments and will automatically configure your PATH based on your shell.
Steps
-
Open your terminal and run:
curl -sSf https://raw.githubusercontent.com/calimero-network/install-sh/master/install-meroctl.sh | bash -
Source the updated PATH:
source <your-shell-config-file>Replace
<your-shell-config-file>with.bashrc,.zshrc, or the relevant configuration file for your shell. -
Verify the installation:
meroctl --version
If the version number appears, the installation was successful.
Notes for Shell Environments
The script automatically updates your PATH based on your shell configuration:
- Bash: Updates
.bashrc. - Zsh: Updates
.zshrc. - Fish: Modifies
~/.config/fish/config.fish. - Csh/Tcsh: Updates
.cshrc.
To apply the changes immediately, use the source command as described in step
2 above.
Usage
meroctl [OPTIONS] --node <NAME> <COMMAND>
Commands:
appCommand for managing applicationscontextCommand for managing contextsidentityCommand for creating an empty identityproxyCommand for managing proxy contractcallExecuting read and write RPC callspeersShow a number of connected peersbootstrapSetup two nodes inside the same contexthelpPrint this message or the help of the given subcommand(s)
Run help to get more information about the available options and commands.
meroctl --help
Options:
--home <PATH>Directory for config and data-n,--node-name <NAME>Name of node-h,--helpPrint help-output-format <FORMAT>[default: plain-text] [possible values: json, plain-text]-V,--versionPrint version
Default location of the config and data directory is ~/.calimero. You can
change the location by using the --home option.
All of the communication with your node through the meroctl CLI is protected by your nodes private key.
Examples:
| Command | Description |
|---|---|
meroctl --node <NAME> app <COMMAND> | Command for managing applications |
meroctl --node <NAME> context <COMMAND> | Command for managing contexts |
meroctl --node <NAME> identity <COMMAND> | Command for creating identities |
meroctl --node <NAME> proxy <COMMAND> | Command for managing proxy contract |
meroctl --node <NAME> call [OPTIONS] --as <EXECUTOR> <CONTEXT_ID> <METHOD> | Executing read and write RPC calls |
Manage Applications
meroctl --node <NAME> app <COMMAND>
Commands:
getFetch application detailsinstallInstall an applicationlistList installed applications
Manage Contexts
meroctl --node <NAME> context <COMMAND>
Commands:
-
aliasCreate an alias for a context -
listList all contexts -
createCreate a new context -
joinJoin an application context -
inviteCreate invitation to a context for a invitee -
getFetch details about the contextDetails
-getsubcommandsinfoGet context information -client-keysGet client keys -storageGet storage information -
identityCreate or list a context identity or it's alias -
deleteDelete a context -
watchWatch events from a context -
updateUpdate app in context -
peersShow a number of connected peers
Managing Context Identities and Aliases
The context identity command supports alias management to simplify working
with public keys across contexts:
meroctl --node <NAME> context identity <COMMAND>
Commands:
-
listList identities in a context-
Use
--ownedto get only owned identitiesmeroctl --node <NAME> context identity list <contextId or alias> --owned
-
-
aliasManage identity aliasesadd <name> <identity> --context <context-id or alias>Create new alias for an identityremove <name> --context <context-id or alias>Remove an identity aliasget <name> --context <context-id or alias>Look up an identity's hash by alias
Context Management with Aliases
The context command includes alias management as a subcommand to simplify
working with context IDs:
meroctl --node <NAME> context <COMMAND>
The alias subcommand structure:
meroctl --node <NAME> context alias <COMMAND>
add <name> <context-id>Create new alias for a contextremove <name>Remove a context aliasget <name>Look up a context by alias
Additional context commands support using aliases:
create --as <alias> ...Create context with an identity aliasget <context-alias>Get context info using aliasinvite <context-alias> <invitee-alias> --as <inviter-alias>Create invitation using aliases- And more...
See the Invitations and Joinings guide for detailed examples of using aliases to streamline context management.
Manage Identities
meroctl --node <NAME> identity <COMMAND>
Commands:
generateGenerate public/private key pair used for context identity
Command for managing proxy contract
meroctl --node <NAME> proxy <COMMAND>
Commands:
getFetch details about the proxy contract
Show a number of connected peers
meroctl --node <NAME> peers
Executing read and write RPC calls
meroctl --node <NAME> call [OPTIONS] --as <EXECUTOR> <CONTEXT_ID> <METHOD>
Arguments:
<CONTEXT_ID>ContextId of the context<METHOD>Method to fetch details
Options:
--args <ARGS>JSON arguments to pass to the method--as <EXECUTOR>Public key of the executor--id <ID>Id of the RPC execute call [default: dontcare]
Setup two nodes inside the same context
meroctl --node <NAME> bootstrap <COMMAND> --merod-path <MEROD_PATH> --protocol <PROTOCOL> --app-path [APP_PATH]
Command initializes and run node1 and node2 in the same context.
Arguments:
<MEROD_PATH>Full path to merod binary.<PROTOCOL>One of supported protocols for context creation. (e.g. near, starknet, icp, stellar, ethereum)<APP_PATH>Path to the app wasm file. If not specified, the default core-template-app will be used
Commands:
start: Start bootstrap process