それ用のDockerimageがDockerHubにあったので使わせていただく
環境はGCPのCloudshell使用
docker container run -itd -v <local_directory>:/root solanalabs/solana:stable /bin/bash
上記の公式ドキュメントを参考に進める
mkdir /root/my-solana-wallet
solana-keygen new --outfile /root/my-solana-wallet/my-keypair.json
↓みたいなのが出てくる。BIP39のパスフレーズ聞かれるが、とりあえず空白で先に進むと勝手にBIP39のパスフレーズ生成してくれるっぽい。
Generating a new keypair
For added security, enter a BIP39 passphrase
NOTE! This passphrase improves security of the recovery seed phrase NOT the
keypair file itself, which is stored as insecure plain text
BIP39 Passphrase (empty for none):
Wrote new keypair to /root/my-solana-wallet/my-keypair.json
================================================================================
pubkey:
================================================================================
Save this seed phrase and your BIP39 passphrase to recover your new keypair:
<BIP39 passphrase>
================================================================================
solana-keygen pubkey /root/my-solana-wallet/my-keypair.json
solana-keygen verify <PUBKEY> /root/my-solana-wallet/my-keypair.json
pub keyがkeypairファイルのprivate keyと整合がとれていれば、以下のようにSuccessが出る
Verification for public key: <pub_key>: Success