4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

はじめに

Solanaさわった続きでStakingしてみます。

環境

Rust 1.57 stable
MacOSX 11.6 (Intel Mac)
Solana(CLI) solana-cli 1.8.6 (src:e5aa5efb; feat:591501692)

あとは前提として開発用のdevnetを使っています。

準備

stake用のアカウントを作成する必要があるのですが、その元となるアカウントをまず別で作成します。

$ solana-keygen new --no-passphrase -o stake-account.json
Generating a new keypair
Wrote new keypair to stake-account.json
====================================================================================
pubkey: HeNhXBGNr8dW1P8RPocDEpj7DvFtGPBYnAH9BeZBskzi
====================================================================================
Save this seed phrase to recover your new keypair:
melody struggle rescue tornado exotic erode delay ocean battle critic symptom couple
====================================================================================

数SOLステーキング予定で、stake元となるアカウント、手数料払うアカウントすべて前回作成した DmAUUA2Rw1yXhstczJgRQYXBB3GrsesUhTvSVkzGfWWe アカウントで行う予定なので、airdropしておく。

$ solana airdrop 2 DmAUUA2Rw1yXhstczJgRQYXBB3GrsesUhTvSVkzGfWWe
Requesting airdrop of 2 SOL

Signature: 2mjCGJgbfwZUJsAUqScwcTmJmhAqPQVXtXaxxUKL2JbSN6Aj4Rv9VemJMQnNrqwfkywA2hE9SU1H6f4VrpF4q7Ga

2.499995 SOL

stake用アカウント作成

$ solana create-stake-account --from ~/.solana/test-keypair.json stake-account.json 1 --stake-authority ~/.solana/test-keypair.json --withdraw-authority ~/.solana/test-keypair.json --fee-payer ~/.solana/test-keypair.json --seed aaa

Signature: 2cqkvUYpjCaxTDPxFgTPezrcUpEQj2SwoYUumzFHF31n5RmJVjEek3MwMLBpbMoerkZGoyEYhGWwbP5QeX5NffJJ

--from でstake原資払う人。
--seed は適当。
~/.solana/test-keypair.json は前回作ったアカウント DmAUUA2Rw1yXhstczJgRQYXBB3GrsesUhTvSVkzGfWWe

エクスプローラーで確認

create-staking-account.png

2Za8hkBAGiMtGRoa8bg7SeL7vBgYn6TetjNqseSL7p2x が対象のアドレス

生成されたstake用アカウントのアドレスを閲覧してみる。

$ solana stake-account 2Za8hkBAGiMtGRoa8bg7SeL7vBgYn6TetjNqseSL7p2x
Balance: 1 SOL
Rent Exempt Reserve: 0.00228288 SOL
Stake account is undelegated
Stake Authority: DmAUUA2Rw1yXhstczJgRQYXBB3GrsesUhTvSVkzGfWWe
Withdraw Authority: DmAUUA2Rw1yXhstczJgRQYXBB3GrsesUhTvSVkzGfWWe

ここまでOKなはず。めちゃ簡単。
Delegate Stake(委任ステーク)とかもできるらしい。

devnetでも増えるのかな?数日してから確認してwithdrawとかやってみる予定。

参考

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?