简体   繁体   English

如何从我的 solana json 密钥对中获取关联的公钥?

[英]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.

相关问题 Solana - 如何在 JavaScript / Node.js 中从我的本地密钥对中获取帐户? - Solana - How to get the account from my local keypair in JavaScript / Node.js? 如何仅从用户的公钥(Solana)中获取用户的密钥对? - How to get a user's keypair from their public key only (Solana)? 如何使用我已经存在的钱包地址而不是通过 solana CLI 生成新的公钥? - How can I use my already existing wallet address instead of generating a new pubkey through the solana CLI? 如何将我的 Solana 代币从 Mai.net 转移到 De.net? - How do I transfer my Solana token from Mainnet to Devnet? 如何使用 @solana/web3.js 从 Solana 中的自定义令牌中删除铸币权限? - How do I remove the minting authority from my custom token in Solana using @solana/web3.js? 如何从秘密短语(助记符)SOLANA 生成密钥对 - how to generate keypair from secret phrase (mnemonic) SOLANA Solana 密钥生成公钥不匹配 - Solana keygen pubkey not matching 如何从连接的钱包地址在 solana 中创建关联的代币地址? - How can I create a associated token address in solana from connected wallet address? Solana - 如何从我的 Phantom 钱包中获取余额? - Solana - How to get the balance from my Phantom wallet? 如何获得一些测试 USDC 以在 Solana devnet 上使用? - How do I get some test USDC for use on Solana devnet?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM