本ファイルは、第5章で入力するコマンドなどを記述しています。

*irohaコンテナとsome-postgresコンテナおよびirohadプロセスが動作している状況で実施してください
 sudo docker start iroha some-postgres
 sudo docker exec -it iroha /bin/bash
 irohad --config config.docker --keypair_name node0

 この端末は放置して別の端末で以下を実施します


[5.1.2　例題「コワーキングスペース日本」構築作業]
「コワーキングスペース日本」が使用するデータベースおよびテーブルの構築手順(Terminal 5-1-1)
sudo docker exec -it some-postgres /bin/bash

psql -U postgres iroha_default
CREATE DATABASE reidai;

\c reidai

CREATE TABLE kaiin_info (
no serial,
id VARCHAR(20),
name  VARCHAR(50),
kana  VARCHAR(50),
addr VARCHAR(100),
tel VARCHAR(30),
bd VARCHAR(20),
ed VARCHAR(20),
block bigint,
today timestamp DEFAULT now(),
PRIMARY KEY(no));

CREATE TABLE shiharai_info (
no serial,
id VARCHAR(20),
prepay   numeric,
ticket   numeric,
total    numeric,
shisetsu VARCHAR(50),
ninzu    int,
usetime  numeric,
job      VARCHAR(10),
today timestamp DEFAULT now(),
PRIMARY KEY(no));

\q

exit

*サンプルファイル「Iroha_Sample1.zip」のexample2ディレクトリ内のすべてのファイルを~/node_modules/iroha-helpers/example/ディレクトリにコピーしてください。

*ご利用のユーザ名に合わせてweb.jsファイルの33行目を書き換えます
 ファイルの権限を変更するには以下のコマンドを実行します
 sudo chmod u+w,g+w,o+w ~/node_modules/iroha-helpers/example/web.js


[5.1.3　例題「コワーキングスペース日本」の操作]
「コワーキングスペース日本」の起動(Terminal 5-1-2)
cd ~/node_modules/iroha-helpers/example
sudo node web.js

Webブラウザに「コワーキングスペース日本」のURLをセット(Chart 5-1-9)
http://localhost:8080/


*irohadプロセスを停止してDockerホストに戻り各コンテナを停止します
Ctrl+C
exit
sudo docker stop iroha some-postgres
