Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Docker (Windows) でブロックチェーン
Search
yochi
December 01, 2017
Technology
0
2k
Docker (Windows) でブロックチェーン
【ブロックチェーン技術に興味のあるエンジニア対象】bitFlyer Drink Meetup! #9 の発表資料です。
yochi
December 01, 2017
Tweet
Share
Other Decks in Technology
See All in Technology
Witchcraft for Memory
pocke
1
350
Claude Code Actionを使ったコード品質改善の取り組み
potix2
PRO
6
2.3k
Welcome to the LLM Club
koic
0
170
地図も、未来も、オープンに。 〜OSGeo.JPとFOSS4Gのご紹介〜
wata909
0
110
生成AI活用の組織格差を解消する 〜ビジネス職のCursor導入が開発効率に与えた好循環〜 / Closing the Organizational Gap in AI Adoption
upamune
4
2.6k
エンジニア向け技術スタック情報
kauche
1
260
Uniadex__公開版_20250617-AIxIoTビジネス共創ラボ_ツナガルチカラ_.pdf
iotcomjpadmin
0
160
Amazon S3標準/ S3 Tables/S3 Express One Zoneを使ったログ分析
shigeruoda
4
520
TechLION vol.41~MySQLユーザ会のほうから来ました / techlion41_mysql
sakaik
0
180
SalesforceArchitectGroupOsaka#20_CNX'25_Report
atomica7sei
0
170
Amazon ECS & AWS Fargate 運用アーキテクチャ2025 / Amazon ECS and AWS Fargate Ops Architecture 2025
iselegant
16
5.6k
2025-06-26_Lightning_Talk_for_Lightning_Talks
_hashimo2
2
100
Featured
See All Featured
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
48
2.8k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
800
Art, The Web, and Tiny UX
lynnandtonic
299
21k
The Invisible Side of Design
smashingmag
299
51k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.8k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
8
670
Building Flexible Design Systems
yeseniaperezcruz
328
39k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
124
52k
[RailsConf 2023] Rails as a piece of cake
palkan
55
5.6k
Typedesign – Prime Four
hannesfritz
42
2.7k
Documentation Writing (for coders)
carmenintech
72
4.9k
The Cult of Friendly URLs
andyhume
79
6.5k
Transcript
Docker (Windows) で ブロックチェーン 越智 佳景
本日の内容 • ブロックチェーン • Docker • Hyperledger Sawtoothを動かす
ブロックチェーン
ブロックチェーン • Bitcoinで開発された技術 • 改ざん困難な記録(ブロックチェーン) <=台帳 • 構成要素 • トランザクション
• ブロック • … • Hyperledger (Hyper=すごい Ledger=台帳) • Linux Foundationで開発 • Hyperledger Sawtooth
Bitcoinトランザクション • コインを使う(AB) • Input: Aのアドレス • Output: Bのアドレス+金額 •
OutputからInputを生成 • Output: Aの公開鍵 • Input: Aの秘密鍵でダイジェスト • 鍵が合う=持ち主だけが正しいトラン ザクション生成可能 A:1 A B:0.99 A’ C:0.99 持ち主によるコインの移動 input output 本物 偽物 output Z input
Bitcoinブロック • ヘッダのハッシュ値が規定値より小さ くなるようNonceを調整(PoW) • Nのヘッダのハッシュ • トランザクションのハッシュ • Nonce
• … 改ざん困難なチェーンの実現 TX TX TX … Height N TX TX TX … Height N+1 000000…01234abcd 000000…020000000 < Nonce=0,1,2…
Sawtoothトランザクション • アプリ開発者が任意に設計 • ValidatorがTransaction Processor に問い合わせ • IntegerKey •
State • {Name:Value} • Transaction • {Verb, Name, Value} ステート変更 N V TP OK S-> S’ My口座 ¥1000 My口座 ¥750 Verb: dec Name: My口座 Value: 250
Sawtoothブロック • 代表ノードが作成 • Nを指すブロックヘッダを署名 • コンセンサスの取れたブロック追加 改ざんには秘密鍵必要 TX TX
TX … Height N TX TX TX … Height N+1
Docker
Docker • コンテナ技術の一種 • ホストのLinuxカーネルを使用して、コンテナ(=プロセス) を実行 • Mac, Windowsでは仮想OSを使用して利用 Linux
HW Virtualization SW Guest OS Virtual HW Linux HW Container 仮想化 Docker
Docker の種類 • 種類 • EE (Enterprise Edition) • CE
(Community Edition) • Windows • Docker for Windows (Hyper-V上のLinux上で動作) • Docker ToolBox (VirtualBox上のLinux上で動作)
準備 • CPUの仮想機能有効化(BIOS) • Hyper-Vの有効化
インストール • Docker for Windowのダウンロード&インストール • https://store.docker.com/editions/community/docker-ce-desktop- windows • 起動後エラー
• ユーザーをdocker-usersグループへ
設定 1. タスクトレイのクジラアイコン右クリック 2. Settingクリック 3. Shared Drives クリック 4.
マウントしたいドライブレターをチェック
動作確認 • コマンドプロンプト C:¥> docker run hello-world
実行方法 Dockerfile docker build . Image docker run Container docker-compose.yaml
Container docker-compose up
Hyperleger Sawtoothを動かす
実行 • Github • https://github.com/hyperledger/sawtooth-core • zipをダウンロード(v1.0.0rc2) • Docker関係のディレクトリ •
https://sawtooth.hyperledger.org/docs/core/releases/latest/app_d evelopers_guide/docker.html • Dockerディレクトリで以下のコマンドを実行 C:¥> docker-compose –f sawtooth-default.yaml up
コンテナ構成 validator shell1 shell2 settings-tp intkey-tp-python xo-tp-python rest-api 8008 4004
4004 sawtooth-default.yaml
◦✕ゲーム • Spec • ステート • <name>,<board>,<game-state>,<player-key-1>,<player-key-2> • トランザクション •
<name>,<action>,<space>
◦✕ゲーム • 遊び方 # sawtooth keygen [ユーザー名] # xo create
--url http://rest-api:8008 --username [ユーザー名] [ゲーム名] # xo list --url http://rest-api:8008 # xo take --url http://rest-api:8008 [ゲーム名] [場所] # xo show --url http://rest-api:8008 [ゲーム名] 1 2 3 4 5 6 7 8 9
コマンドの流れ shell1 shell2 validator xo-tp-python sawtooth keygen xo create sawtooth
keygen STATE: P1-NEXT Signer: Body: game1,create TX, State <<game1>> Player1: Player2: Board: []
コマンドの流れ shell1 shell2 validator xo-tp-python xo take 1 Signer: Body:
game1,take,1 xo take 2 STATE: P2-NEXT STATE: P1-NEXT <<game1>> Player1: Player2: Board: [1] <<game2>> Player1: Player2: Board: [1,2] Signer: Body: game1,take,2 TX, State TX, State STATE: P1-NEXT
コマンドの流れ shell1 shell2 validator xo-tp-python xo take 5 <<game1>> Player1:
Player2: Board: [1,2] Signer: Body: game1,take,5 TX, State STATE: P1-NEXT STATE: P1-NEXT Invalid!!
まとめ • ブロックチェーンはBitcoin発祥 • 様々な実装 • Hyperledger Sawtooth • トランザクションを自由に設計
• Dockerで簡単に動作確認
ありがとうございました