LoginSignup
0
0

More than 1 year has passed since last update.

Tezosのghostnetにローカルノードをつなげて蛇口からお金をもらう方法

Posted at

Tezosのテストネットワークはプロトコルごとに edonet→granadanet→hangzhounet→ithacanetなど名前が変わってきたけど、毎回変わって不便ということから ghostnet という名前が変わらないテストネットが爆誕したようです。

手元にtezos-nodeがある人は --network オプションで ghostnet を指定して利用することができるみたい。

./tezos-node run --data-dir /data/tezos/test-ghost --rpc-addr localhost --network ghostnet
tezos-node: Error:
              Specified --network has chain name TEZOS_ITHACANET_2022-01-25T15:00:00Z,
              but current configuration implies expected chain name TEZOS_MAINNET. Use:
              tezos-node config init --network <NETWORK> to configure your node.

最初にconfig initが必要だった。

./tezos-node config init --network ghostnet --data-dir /data/tezos/test-ghostnet/

あらためて

./tezos-node run --data-dir /data/tezos/test-ghost --rpc-addr localhost --network ghostnet

蛇口からお金をもらう

https://teztnets.xyz/ghostnet-faucet
にアクセスして Get Ghostnet ꜩ ボタンからJSON形式で activation key を発行してもらいます。
例えば私は以下のようなやつをもらいました。

{
	"pkh": "tz1gFFNknhYbVbvKREWiMNRWkNtNpMeqkM1L",
	"mnemonic": [
		"match",
		"loop",
		"muscle",
		"category",
		"shiver",
		"sail",
		"spring",
		"genius",
		"mixed",
		"board",
		"frost",
		"drink",
		"menu",
		"forget",
		"syrup"
	],
	"email": "ucjmdtko.xdxqyruq@teztnets.xyz",
	"password": "gwNRhyD1Pq",
	"amount": "23458877470",
	"activation_code": "c7d8d8d7791fcfc5064f5e16fd27f67fe482a775"
}

↑このjsonを例えば faucet-ghostnet.json みたいなファイル名で保存して、tezos-clientでactivate。

./tezos-client activate account faucet with faucet-ghostnet.json 

10数秒ほど待って:

Node is bootstrapped.
Operation successfully injected in the node.
Operation hash is 'onjsMfvVh7SJiDnys7RyXXfNNFr4zurDjJibu4jcJ5aKmcNigEe'
Waiting for the operation to be included...
Operation found in block: BMRY55ASHBJDFki68VmpfVTr6jmY7Wt8wCrhSfk7Vhrs3Tt3EXH (pass: 2, offset: 0)
This sequence of operations was run:
  Genesis account activation:
    Account: tz1gFFNknhYbVbvKREWiMNRWkNtNpMeqkM1L
    Balance updates:
      commitment(btz1hQkz7ihVFRasGoceXDwDkwU1FN5MvfBDd) ... -ꜩ56392.322914
      tz1gFFNknhYbVbvKREWiMNRWkNtNpMeqkM1L ................ +ꜩ56392.322914

The operation has only been included 0 blocks ago.
We recommend to wait more.
Use command
  tezos-client wait for onjsMfvVh7SJiDnys7RyXXfNNFr4zurDjJibu4jcJ5aKmcNigEe to be included --confirmations 1 --branch BL3c8pJZ2aJoBN6WCmTL5h4mHXRV5bo5n5MC5FJHdQcPCqeKZYK
and/or an external block explorer.
Account faucet (tz1gFFNknhYbVbvKREWiMNRWkNtNpMeqkM1L) activated with ꜩ56392.322914.

list known addresses で確認すると faucetという名前で 56392.322914 ꜩ もらえていることがわかるね 。ラッキー。

$ ./tezos-client list known addresses
faucet: tz1gFFNknhYbVbvKREWiMNRWkNtNpMeqkM1L (unencrypted sk known)
$ ./tezos-client get balance for faucet
56392.322914 ꜩ
0
0
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
0
0