VON Networkの動作確認

56
7 min readApr 9, 2020

VON Networkを利用して動作を確認した際の備忘録を残します。
実行環境はmacOS Catalina Version 10.15.3です。

VON Networkの起動

von-network の起動にはさまざまな方法がありますが、今回はDockerを利用した方法でおこないます。
(https://github.com/bcgov/von-network/blob/master/docs/UsingVONNetwork.md)

まず、von-networkリポジトリをcloneします。

$ git clone https://github.com/bcgov/von-network
$ cd von-network

von-networkリポジトリのclone後、VON Networkのdocker imagesをビルドしてIndy networkを起動します。

./manage build
./manage start --logs

台帳の表示

von-networkが起動したら9000番ポートでWebサーバも起動します。
ブラウザでhttp://127.0.0.1:9000/にアクセスします。

VON Network Webサーバーでは以下のことが可能であると記載されています。

・See the status of the nodes of the network.
・Look at the genesis file for the network.
・Create a DID.
・Browser the three ledgers that make up an Indy network
(https://github.com/bcgov/von-network/blob/master/docs/UsingVONNetwork.md#browsing-the-ledger)

トランザクションの表示

Leger Stateのリンクからトランザクションを表示できます。

Genesis Fileの表示

Connect to the NetworkのGenesis Transactionを押下しhttp://127.0.0.1:9000/genesis にアクセスすることでGenesis Fileを表示できます。

Authenticate a New DID からDIDを作成します。
さまざまなオプションがありますが、今回は以下の手順を参考に進めます。

1.Make sure that “Register from Seed” is selected.
2. Type your first name in the “Wallet Seed” field, and your full name in the “Alias” field.
3. Click “Register DID.”
https://github.com/bcgov/von-network/blob/master/docs/UsingVONNetwork.md#creating-a-did

以下のように名前をWallet seedを入力して Register DIDを押下します。
(32 characters or base64 と書いてあるがとりあえず気にしない)

Identity success fully registerd と表示されたので、当該トランザクションがを確認します。

トランザクション #7 のNymとVerkeyがIdentity success fully registerdで表示されたものと一致することが確認できます。

CLIの利用

VON NetworkはIndy CLIのインターフェースも提供しています。
次のコマンドを実行することでCLIを利用できることが確認できます。

./manage indy-cli
indy> help
Hyperledger Indy CLI
Usage:
[<command-group>] <command> [[<main-param-name>=]<main-param-value>] [<param_name-1>=<param_value-1>]...[<param_name-n>=<param_value-n>]
Getting help:
help - Display this help
<command-group> help - Display the help for the specific command group
[<command-group>] <command> help - Display the help for the specific command
Command groups are:
pool - Pool management commands
did - Identity management commands
ledger - Ledger management commands
payment-address - Payment address management commands
wallet - Wallet management commands
Top level commands are:
show - Print the content of text file
exit - Exit Indy CLI
about - Show about information
load-plugin - Load plugin in Libindy
prompt - Change command prompt
init-logger - Init logger according to a config file.
Indy Cli uses `log4rs` logging framework: https://crates.io/crates/log4rs
$ brew install coreutils

その他

今回はVON Networkを利用してローカルにIndy Networkを構築しました。
もし公開されているNetworkの利用を検討している場合、以下のSovrin Networkの利用が方法の一つとしてあります。

Sovrin Networkは特定の操作に料金が発生するため、注意して利用してください。

参考

https://github.com/bcgov/von-network
https://sovrin.org/issue-credentials/

--

--