Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Docker (Windows) でブロックチェーン
Search
yochi
December 01, 2017
Technology
2.1k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Docker (Windows) でブロックチェーン
【ブロックチェーン技術に興味のあるエンジニア対象】bitFlyer Drink Meetup! #9 の発表資料です。
yochi
December 01, 2017
Other Decks in Technology
See All in Technology
WasmをRustにする
sansantech
PRO
0
250
会社説明資料
persolserverworks
0
9.8k
『SAR衛星データ解析入門』のご紹介とその応用
syuchimu
0
120
AIがコードを書く時代に、エンジニアは何で自分の価値を証明するのか / In an era where AI writes code how do engineers prove their value
carta_engineering
3
1.1k
AIにシークレットを見せない、WSL2で安全な開発環境
yazm
0
300
Webの常識が通じないHTMLメールのダークモード
teamlab
PRO
0
120
"優秀な誰か"の下位互換にならないために
yut0naga1_fa
1
1.8k
AI駆動で「他アプリの音を加工できる」アプリを作った
satomasahiro2005
0
150
二歩目のフロントエンド・ウェブアクセシビリティ
camiha
2
570
LambdaWebFunctionsを試してみた / exploring-lambda-web-functions
koukihosaka
1
330
Temporal 最高!でも改めて「日付」について調べたら人類の負債すぎる件
riyaamemiya
0
140
Kiro Crewをはじめよう
kizawa2020
1
160
Featured
See All Featured
Navigating Weather and Climate Data
rabernat
0
560
Building Adaptive Systems
keathley
44
3.2k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
How to Talk to Developers About Accessibility
jct
2
580
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
850
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
630
Docker and Python
trallard
47
4.2k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
560
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
800
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
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で簡単に動作確認
ありがとうございました