SOLANA CLIを使ってFile System Walletを作る

Posted: January 23, 2022

環境

それ用のDockerimageがDockerHubにあったので使わせていただく

環境はGCPのCloudshell使用

docker container run -itd -v <local_directory>:/root solanalabs/solana:stable /bin/bash

File System Walletの作成

上記の公式ドキュメントを参考に進める

key pair fileを作る

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>
================================================================================

pub key(wallet address)を表示

solana-keygen pubkey /root/my-solana-wallet/my-keypair.json

pub keyとprivate keyの認証

solana-keygen verify <PUBKEY> /root/my-solana-wallet/my-keypair.json

pub keyがkeypairファイルのprivate keyと整合がとれていれば、以下のようにSuccessが出る

Verification for public key: <pub_key>: Success