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
Blockchain x Slack botでピアボーナス
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
ryo0301
August 21, 2020
Technology
290
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Blockchain x Slack botでピアボーナス
ryo0301
August 21, 2020
More Decks by ryo0301
See All by ryo0301
Quorum on AWS
ryo0301
0
650
国交省のデータをSolrで検索
ryo0301
3
1.3k
Other Decks in Technology
See All in Technology
【AG-UI × A2UI × MCP Apps】Generative UIをやさしく解説する
nrinetcom
PRO
1
120
Digitization部 紹介資料
sansan33
PRO
2
7.7k
LanceDB入門
mocobeta
7
490
Sets in Go
ramalho
1
490
クラウドセキュリティ入門 ~安全なクラウド利用のための基礎知識~
lhazy
13
8.7k
修正PRを食べてレビュースキルが賢くなる:Claude Codeによる自己改善サイクル
yuyaumetsu
6
1.5k
第3回しろおびセキュリティスポンサーセッション
log0417
0
180
Flutterをカメラで動かしたかった話
sony
1
140
Service Connect 上のサービスに ECS Service の外側から到達できなかった話
ota1022
1
240
制約理論(ToC)入門 2026版
recruitengineers
PRO
8
2.2k
事業価値と Engineering 2026年度版
recruitengineers
PRO
49
23k
Software Supply Chain Attackからクラウド環境を守るためにできること
lhazy
2
260
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
201
75k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
45k
Thoughts on Productivity
jonyablonski
76
5.3k
Unsuck your backbone
ammeep
672
58k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
790
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
650
Java REST API Framework Comparison - PWX 2021
mraible
34
9.6k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
200
Building Adaptive Systems
keathley
44
3.2k
Agile that works and the tools we love
rasmusluckow
331
22k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
320
Transcript
Blockchain x Slack bot で ピアボーナス
自己紹介 ❏ 物件検索エンジン ❏ AWS移行 ❏ 不動産情報コンソーシアム ADRE ❏ 社内通貨
LIFULL COIN 株式会社 LIFULL 秀野 亮 (@ryo0301)
目次 ❏ 社内通貨 LIFULL COIN ❏ 在宅勤務での課題 ❏ Slackでのピアボーナス機能 ❏
ブロックチェーンの送金の仕組み ❏ ピアボーナスの仕組み ❏ 余談:自作リバースプロキシ
社内通貨 LIFULL COIN
社内通貨 LIFULL COIN ❏ LIFULL COIN Wallet(口座管理アプリ) ❏ 残高の確認 ❏
送金と取引履歴 ❏ ベーシックインカム ❏ 投票(投げ銭)
動機:在宅勤務が始まって
在宅勤務でのコミュニケーション課題 ❏ コロナ禍で待望の在宅勤務が始まった ❏ コミュニケーションにまつわる課題 ❏ 周りが何やってるのかよくわからない ❏ 社会適合者の方々の精神が不安定に ピアボーナスとしてLIFULL
COINを送り合い、 状況の共有や、いいねができる仕組みを用意した
ピアボーナス
ピアボーナスの仕組み リアクション LIFULL COIN Bot リリース完了! (カチャカチャ..ターンッ イイネ
ブロックチェーンの送金の仕組み 秘密鍵 公開鍵 アカウント アドレス 0x123AbC… 0x123AbC… 署名 トランザクション (誰が/誰に/いくら)
0xZyx098…
スマートコントラクト
システム構成図
UI:アプリのホームタブ&メッセージタブ
UI:未登録者勧誘メッセージ&プロフィール登録モーダル
@slack/bolt 起動サンプル const options = { signingSecret: process.env.SLACK_SIGNING_SECRET, clientId: process.env.SLACK_CLIENT_ID,
clientSecret: process.env.SLACK_CLIENT_SECRET, stateSecret: process.env.SLACK_STATE_SECRET, scopes: require("../config/bot_scopes.json"), installationStore: new DynamoDBInstallationStore(), }; const app = new App(options); app.receiver.app.get("/", (_, res) => res.sendStatus(200)); app.event("reaction_added", reactionAddedListener); (async () => await app.start(3000))();
web3.js 送金サンプル const rawTx = { from: this.#account.address, to: this.#contract.options.address,
data: this.#contract.methods.proxyTransfer(to, val).encodeABI(), }; rawTx.gas = await this.#web3.eth.estimateGas(rawTx); const signedTx = await this.#account.signTransaction(rawTx); this.#web3.eth.sendSignedTransaction(signedTx.rawTransaction);
余談:開発用リバースプロキシ
ローカルでの開発にリバースプロキシは必須 ❏ ローカルのSlackアプリとSlack botの通信をどうするか? ❏ Slackアプリ → Slackサーバー → Slack
bot ❏ リバースプロキシ+リモートポートフォワーディング ❏ リバースプロキシサービス ❏ ngrok, serveo, localhost.runなどあるが社内の情報を流したくない ❏ serveo 止まってる・・・ ❏ 外部サービス利用申請だすのが面倒くさい&許可おりる気がしない AWS VPC上にリバースプロキシを立てることにした
気軽に立てて、気軽に死んで欲しい ❏ 機能 ❏ 自動DNS登録 ❏ 自動HTTPS ❏ 自動シャットダウン ❏
指定した上流ポートにプロキシ ❏ ホスト名/ドメイン名やシャットダウン待機時間は .env に設定 ❏ ワンライナーで起動できる $ yarn -s generate 2> /dev/null | aws ec2 run-instances --launch-template LaunchTemplateName=dev-reverse-proxy --user-data file:///dev/stdin
リモートポートフォワーディング ❏ EC2 Instance Connect ❏ 公開鍵を送信すると60秒間だけログインできる機能 ❏ Session Manager
❏ WebSocketをトンネルしてSSHできる機能 ❏ VPC Endpoint for Session Manager ❏ Basionサーバー不要でSSH接続できる ❏ ワンライナーで接続できるようにした $ saw ssm start-ssh-session --forward remote
None