0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Create an Account

Last updated at Posted at 2024-11-25

Previous << Get an Account
Next >> Deploy a Contract

Flow CLIは、任意のFlow Access APIにアカウント作成トランザクションを送信するコマンドを提供します。アカウントを作成する方法には2つのオプションがあり、プロセスとアカウント作成をガイドする対話型モードと、選択したネットワーク上に既に存在するアカウントを必要とするマニュアルプロセスがあります。

Interactive Mode

対話型モードでアカウントを作成すると、アカウント名とネットワークの選択を求められます。必要な情報を入力すると、アカウントが作成され、flow.jsonに保存されます。アカウント作成がテストネットまたはメインネットで行われた場合、アカウントキーは別のキーファイルに保存され、.gitignoreにも追加されます。キーセキュリティについてさらに詳しくはこちらをご覧ください

💡アカウント作成プロセスには最大1分かかる場合がありますので、ご了承ください。

flow accounts create

Enter an account name: mike
 Testnet

🎉 New account created with address 0x77e6ae4c8c2f1dd6 and name mike on Testnet network.

Heres a summary of all the actions that were taken:
 - Added the new account to flow.json.
 - Saved the private key to mike.pkey.
 - Added mike.pkey to .gitignore.

Manual Mode

マニュアルモードを使用するには、署名者として提供するネットワーク上に既存のアカウントが必要です。このアカウントをflow.jsonに追加しなければ、コマンドは動作しません。また、キーペアを生成する必要があります。flow keys generateコマンドの使用をお勧めします。このコマンドの詳細については、こちらで確認できます

# Create an account on Flow Testnet
> flow accounts create \
    --key a69c6986e846ba6d0....1397f5904cd319c3e01e96375d5777f1a47010 \
    --signer my-testnet-account 

Address	 0x01cf0e2f2f715450
Balance	 10000000
Keys	 1

Key 0	Public Key		 a69c6986e846ba6d0....1397f5904cd319c3e01e96375d5777f1a47010
	Weight			 1000
	Signature Algorithm	 ECDSA_P256
	Hash Algorithm		 SHA3_256

Contracts Deployed: 0

上記の例では、flow.jsonファイルは次のようになります。

{
  "accounts": {
    "my-testnet-account": {
      "address": "a2c4941b5f3c7151",
      "key": "12c5dfde...bb2e542f1af710bd1d40b2"
    }
  }
}

Flags

Public Key

  • Flag: --key
  • Valid inputs: a hex-encoded public key in raw form.

新しいアカウントの作成時に追加する公開鍵を指定します。

Key Weight

  • Flag: --key-weight
  • Valid inputs: number between 0 and 1000
  • Default: 1000

新しいアカウントに追加する公開鍵の重み(weight)を指定します。

このフラグを使用する場合は、各--keyフラグに対する--key-weightフラグを指定しなければなりません。

Public Key Signature Algorithm

  • Flag: --sig-algo
  • Valid inputs: "ECDSA_P256", "ECDSA_secp256k1"
  • Default: "ECDSA_P256"

指定した公開鍵のECDSA署名アルゴリズムを指定します。このオプションは、--key フラグと併用する場合のみ使用できます。

secp256k1とP-256の曲線をサポートしています。

Public Key Hash Algorithm

  • Flag: --hash-algo
  • Valid inputs: "SHA2_256", "SHA3_256"
  • Default: "SHA3_256"

アカウント作成時に公開鍵とペアになるハッシュアルゴリズムを指定します。

Signer

  • Flag: --signer
  • Valid inputs: the name of an account defined in flow.json.

トランザクションに署名しアカウント生成費用を支払うのに使用するアカウントの名前を指定します。

Contract

  • Flag: --contract
  • Valid inputs: String with format name:filename, where name is name of the contract as it is defined in the contract source code and filename is the filename of the contract source code.

アカウント作成時にデプロイされるコントラクトを1つか複数指定します。

Include Fields

  • Flag: --include
  • Valid inputs: contracts

結果の出力に含めるフィールドを指定します。テキスト形式の出力のみに適用されます。

Host

  • Flag: --host
  • Valid inputs: an IP address or hostname.
  • Default: 127.0.0.1:3569 (Flow Emulator)

コマンドを実行する際に使用する Access API のホスト名を指定します。このフラグは、--network フラグで定義されたホストをすべて上書きします。

Network Key

  • Flag: --network-key
  • Valid inputs: ホストのネットワーク公開鍵の 16 進数文字列

コマンドを実行する際に、セキュアなGRPCクライアントを作成するために使用するAccess APIのネットワーク公開鍵を指定します。

Network

  • Flag: --network
  • Short Flag: -n
  • Valid inputs: the name of a network defined in the configuration (flow.json)
  • Default: emulator

どのネットワークに対してコマンドを実行するのかを指定します。

Filter

  • Flag: --filter
  • Short Flag: -x
  • Valid inputs: a case-sensitive name of the result property.

結果から、唯一の値として取得したいプロパティの名前を指定します。

Output

  • Flag: --output
  • Short Flag: -o
  • Valid inputs: json, inline

コマンド結果のフォーマットを指定します。

Save

  • Flag: --save
  • Short Flag: -s
  • Valid inputs: a path in the current filesystem.

結果を保存したいファイル名を指定してください。

Log

  • Flag: --log
  • Short Flag: -l
  • Valid inputs: none, error, debug
  • Default: info

ログレベルを指定します。コマンド実行中に表示する出力を制御します。

Configuration

  • Flag: --config-path
  • Short Flag: -f
  • Valid inputs: a path in the current filesystem.
  • Default: flow.json

flow.jsonコンフィギュレーションファイルへのパスを指定します。-fフラグを複数回使用して複数のコンフィグレーションファイルをマージすることもできます。

Version Check

  • Flag: --skip-version-check
  • Default: false

低速なネットワーク接続における処理を高速化するために、起動時のバージョンチェックをスキップします。

Last updated on Nov 7, 2024 by Giovanni Sanchez

翻訳元👇


Previous << Get an Account

Flow BlockchainのCadence version1.0ドキュメント (Create an Account)

Next >> Deploy a Contract

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?