命令行帮助可用。键入 aptos help 或 aptos --help 以查看可用的命令选项。请参阅下面 aptos --help 的用法输出:
USAGE:
aptos <SUBCOMMAND>
OPTIONS:
-h, --help Print help information
-V, --version Print version information
SUBCOMMANDS:
account Toolfor interacting with accounts
config Toolfor interacting with configuration of the Aptos CLI tool
genesis Toolfor setting up an Aptos chain Genesis transaction
governance Toolfor on-chain governance
help Print this message or the help of the given subcommand(s)
info Show build information about the CLI
init Tool to initialize current directoryfor the aptos tool
key Toolfor generating, inspecting, and interacting with keys
move Toolfor Move related operations
node Toolfor operations related to nodes
stake Toolfor manipulating stake
USAGE:
aptos move <SUBCOMMAND>
OPTIONS:
-h, --help Print help information
-V, --version Print version information
SUBCOMMANDS:
clean
Cleans derived artifacts of a package
compile
Compiles a package and returns the [`ModuleId`]s
download
Downloads a package and stores it ina directory named after the package
help
Print this message or the help of the given subcommand(s)
init
Creates a new Move package at the given location
list
Lists information about packages and modules on-chain
prove
Proves the Move package
publish
Publishes the modules ina Move package to the Aptos blockchain
run
Run a Move function test
Runs Move unit tests fora package
transactional-test
Run Move transactional tests
USAGE:
aptos move compile [OPTIONS]
OPTIONS:
-h, --help
Print help information
--named-addresses <NAMED_ADDRESSES>
Named addresses forthe move binary
Example: alice=0x1234, bob=0x5678
Note: This will fail ifthere are duplicates inthe Move.toml file remove those first.
[default: ]
--output-dir <OUTPUT_DIR>
Path to save the compiled move package
Defaults to `<package_dir>/build`
--package-dir <PACKAGE_DIR>
Path to a move package (the folder with a Move.toml file)
-V, --version
Print version information
$ aptos init
Configuringfor profile default
Enter your rest endpoint [Current: None | No input: <https://fullnode.devnet.aptoslabs.com>]
No rest url given, using <https://fullnode.devnet.aptoslabs.com>...
Enter your faucet endpoint [Current: None | No input: <https://faucet.devnet.aptoslabs.com>]
No faucet url given, using <https://faucet.devnet.aptoslabs.com>...
Enter your private key as a hex literal (0x...) [Current: None | No input: Generate new key (or keep oneif present)]
No key given, generating key...
Account 00f1f20ddd0b0dd2291b6e42c97274668c479bca70f07c6b6a80b99720779696 doesn't exist, creating it and funding it with 10000 coins
Aptos is now set upfor account 00f1f20ddd0b0dd2291b6e42c97274668c479bca70f07c6b6a80b99720779696! Run`aptos help`for more information about commands
{
"Result": "Success"
}
$ aptos init --profile superuser
Configuringfor profile superuser
Enter your rest endpoint [Current: None | No input: <https://fullnode.devnet.aptoslabs.com>]
No rest url given, using <https://fullnode.devnet.aptoslabs.com>...
Enter your faucet endpoint [Current: None | No input: <https://faucet.devnet.aptoslabs.com>]
No faucet url given, using <https://faucet.devnet.aptoslabs.com>...
Enter your private key as a hex literal (0x...) [Current: None | No input: Generate new key (or keep oneif present)]
No key given, generating key...
Account 18B61497FD290B02BB0751F44381CADA1657C2B3AA6194A00D9BC9A85FAD3B04 doesn't exist, creating it and funding it with 10000 coins
Aptos is now set upfor account 18B61497FD290B02BB0751F44381CADA1657C2B3AA6194A00D9BC9A85FAD3B04! Run`aptos help`for more information about commands
{
"Result": "Success"
}
$ aptos move test --package-dir aptos-move/move-examples/hello_blockchain/ --named-addresseshello_blockchain=superuser
INCLUDING DEPENDENCY AptosFramework
INCLUDING DEPENDENCY AptosStdlib
INCLUDING DEPENDENCY MoveStdlib
BUILDING Examples
Running Move unit tests
[ PASS ] 0x742854f7dca56ea6309b51e8cebb830b12623f9c9d76c72c3242e4cad353dedc::MessageTests::sender_can_set_message
[ PASS ] 0x742854f7dca56ea6309b51e8cebb830b12623f9c9d76c72c3242e4cad353dedc::Message::sender_can_set_message
Test result: OK. Total tests: 2; passed: 2; failed: 0
{
"Result": "Success"
}