[英]How do I get the associated pubkey from my solana json keypair?
I'm trying to figure out how to get my pubkey that is the default account for my file system wallet.我试图弄清楚如何获取我的 pubkey,它是我的文件系统钱包的默认帐户。 I know where the json file is located (ie ~/.config/solana/id.json) and of course I looked into it.我知道 json 文件的位置(即 ~/.config/solana/id.json),当然我也查看了它。 It's just an array of numbers, I can probably figure out what base the file is in and convert it to get my pub and private keys, but there has to be some kind of built in solana cli command to do this.它只是一个数字数组,我可能可以找出文件所在的基础并将其转换为获取我的 pub 和私钥,但必须有某种内置的 solana cli 命令来执行此操作。 Can anyone help?任何人都可以帮忙吗?
Ok, I was using the wrong cli tool.好的,我使用了错误的 cli 工具。 I thought it was in "solana-keygen" but the command was:我以为它在“solana-keygen”中,但命令是:
solana address
if you want to get the pubkey of a keypair in a file you can also use the following command:如果要在文件中获取密钥对的 pubkey,还可以使用以下命令:
solana-keygen pubkey file.json
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.