AElf.Cli
How to install aelf command in local
-
cd
to the dirsrc/AElf.Cli
, rundotnet pack
-
Run following command in same dir
dotnet tool install --global --add-source ./nupkg aelf.cli
- Now you can use
aelf
cli
aelf start
Watch, you need to add your aelf keystore file (a json file) to aelf/keys
dir, and config the address and password to src/AElf.Cli/appsettings.json
file.
dotnet pack
need to be run again if you modify the code, then usedotnet tool update
to updateaelf
cli
dotnet pack
dotnet tool update --global --add-source ./nupkg aelf.cli
How to add new command
-
Add
*Command.cs
file toCommands
dir and make this class inherit fromIAElfCommand
-
Impl following 3 methods
- ExecuteAsync:The logic of executing this command
- GetUsageInfo:Get more information about this command
- GetShortDescription:Short decription of this command
-
Then register this command to
AElfCliModule.cs
, the format you can ref to HelpCommand and StartCommand -
dotnet pack
&dotnet tool update --global --add-source ./nupkg aelf.cli
as stated before