我按照说明在这个link中使用留言簿示例
但是,在我创建了一个新帐户并尝试使用near login从终端登录到near之后,当浏览器自动打开时,我无法在浏览器中找到创建的帐户。然后我试图通过我的账号从终端登录,但我得到了以下错误:
Which account did you authorize for use with NEAR CLI?
Enter it here (if not redirected automatically):
guest.testnet
The account you provided [ guest.testnet ] has not authorized the expected key [
ed25519:4FRg1h... ] Please try again.在再次回顾这些步骤之后,我意识到钱包帐户的链接是在wallet.nearprotocol中创建帐户,而不是在wallet.testnet链接中。当我使用wallet.testnet.org创建帐户时,它工作得很好。现在我的问题是,在testnet中创建帐户和在nearprotocol中创建帐户有什么不同,因为这两个帐户都以testnet网络扩展结尾。
有人能帮上忙吗?
发布于 2021-11-23 11:01:40
我不太确定问题是什么?关于near cli,它默认使用testnet rpc,当您调用near -help时,您可以看到
--nodeUrl, --node_url NEAR node URL [string] [default: "https://rpc.testnet.near.org"]
--networkId, --network_id NEAR network ID, allows using different keys based on network [string] [default: "testnet"]这意味着如果您不传递其中一个参数,它将默认打开testnet wallet login link,并在默认情况下打开它。因此,如果您之前在该浏览器中导入了帐户,则可以登录,也可以使用其中一个导入选项立即导入。
现在关于钱包,主要的网络账户在.near结束,而不是.testnet。
不同之处在于mainnet钱包使用的是mainnet rpc端点。以下是Guest Book config.js中的mainnet和testnet的属性
{
networkId: "mainnet",
nodeUrl: "https://rpc.mainnet.near.org",
walletUrl: "https://wallet.near.org",
helperUrl: "https://helper.mainnet.near.org",
explorerUrl: "https://explorer.mainnet.near.org",
},
{
networkId: "testnet",
nodeUrl: "https://rpc.testnet.near.org",
contractName: CONTRACT_NAME,
walletUrl: "https://wallet.testnet.near.org",
helperUrl: "https://helper.testnet.near.org",
explorerUrl: "https://explorer.testnet.near.org",
}https://stackoverflow.com/questions/70077229
复制相似问题