Completed generating configuration:
Log file: "/Users/greg/.aptos/testnet/validator.log"
Test dir: "/Users/greg/.aptos/testnet"
Aptos root key path: "/Users/greg/.aptos/testnet/mint.key"
Waypoint: 0:74c9d14285ec19e6bd15fbe851007ea8b66efbd772f613c191aa78721cadac25
ChainId: TESTING
REST API endpoint: 0.0.0.0:8080
Fullnode network: /ip4/0.0.0.0/tcp/6181
Aptos is running, press ctrl-c to exit
Faucet is running. Faucet endpoint: 0.0.0.0:8081
上述命令将使用验证器节点的默认配置。
不要在同一时间使用同一命令的两个实例
注意,同一命令的两个实例不能同时运行。这会导致验证器节点的端口冲突。
用本地测试网进行测试
你可以使用 Aptos CLI 进行全方位的本地测试网操作。关于如何配置 CLI,请先看下文。
配置 Aptos CLI 来使用本地测试网
你可以添加一个单独的配置文件,如下所示:
aptos init --profile local --rest-url <http://localhost:8080> --faucet-url <http://localhost:8081>
会得到如下的输出。在 Enter your private key... 命令提示符i啊,按回车键生成一个随机的新密钥。
Configuring for profile local
Using command line argument for rest URL <http://localhost:8080/>
Using command line argument for faucet URL <http://localhost:8081/>
Enter your private key as a hex literal (0x...) [Current: None | No input: Generate new key (or keep one if present)]
这将创建一个新的账户,并以默认的代币数量为其提供资金,如下所示:
No key given, generating key...
Account 7100C5295ED4F9F39DCC28D309654E291845984518307D3E2FE00AEA5F8CACC1 doesn't exist, creating it and funding it with 10000 coins
Aptos is now set up for account 7100C5295ED4F9F39DCC28D309654E291845984518307D3E2FE00AEA5F8CACC1! Run `aptos help` for more information about commands
{
"Result": "Success"
}