Share
Embed
ブロックチェーンゲームMyCryptoHeroesの作り方 / Architecture of My Crypto Heroes
AWS Summit Tokyo Startup Architecture Of The Year 2019
Ryo Manzoku
June 13, 2019
Transcript
19 slides
-
S U M M I T © 2019, Amazon Web
Services, Inc. or its affiliates. All rights reserved. ϒϩοΫνΣʔϯήʔϜ ͷ࡞Γํ ຬ ྄ ϦʔυΤϯδχΞ double jump.tokyoגࣜձࣾ -
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. S U M M I T My Crypto Heroesͱ • ʮήʔϜʹ͔͚͓ͨ࣌ؒۚɺ͋ͳͨͷࢿ࢈ͱͳΔੈքʯ • ྺ্࢙ͷώʔϩʔΛूΊɺΞΠςϜΛ֫ಘ͠ɺότϧ͢ΔϒϩοΫνΣ ʔϯRPGήʔϜ • ϒϩοΫνΣʔϯEthereum͓ΑͼࢄετϨʔδIPFSΛར༻͠ɺήʔ Ϝࢿ࢈ͷඇதԝूݖੑΛ࣮ݱ • ϒϩοΫνΣʔϯͷ՝Ͱ͋ΔεέʔϥϏϦςΟͱUXͷղܾͷͨΊήʔ Ϝͱͯ͠ͷػೳAWS্ʹߏங -
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. S U M M I T My Crypto Heroesͱ -
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. S U M M I T ͳͥϒϩοΫνΣʔϯΛ͏ͷʁ • ϒϩοΫνΣʔϯͷήʔϜࢿ࢈ͷʮॴ༗ใʯϢʔβʔͷͷ • ࣗ༝ʹऔҾɺৡ͕Մೳ • ήʔϜͷΛඈͼӽ͑ͯʮॴ༗ใʯΛ׆༻Ͱ͖Δ • ೝূɺܾࡁͷϓϥοτϑΥʔϜ͕खྉͳ͠Ͱར༻Ͱ͖Δ • Ձͷ͋ΓํΛม͑ΔʮϒϩοΫνΣʔϯٕज़ʯΛ༻͍ͯήʔϜͷະདྷ ΛϦϏϧυ͢Δͱ͍͏ձࣾͷϛογϣϯ -
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. S U M M I T &UIFSFVN 6TFS ϢʔβʔECDSAॺ໊༻ͷൿີ伴ͱ ରʹͳΔΞυϨεΛॴ༗ ήʔϜࢿ࢈ɺEthereum্Λਖ਼ͱͯ͠ཧ ॴ༗ใɺϢʔβʔͷΞυϨεʹ͋Δ ॴ༗ใΛ֬ೝ ήʔϜࢿ࢈Λ༻͍ͯήʔϜͰ༡Ϳ ࢿ࢈ΛҭͯΔ MyCryotoHeroesͰ ɾήʔϜࢿ࢈Λͬͨ༡ͼͷఏڙ ɾETHʹΑΓήʔϜ௨՟Λൢച ɾ৽͍͠ήʔϜࢿ࢈ͷ༩ɺൢച ɾήʔϜࢿ࢈ΞʔτΛ༩ My Crypto Heroesͷߏཁૉ -
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. S U M M I T γεςϜΞʔΩςΫνϟ 6QMPBEUP*1'4 4 &UIFSFVN *1'4 *NBHFVQMPBE 8FC "VSPSB /-# 6TFS #BUDI 71$ 1SPYZ 4FOEUY .POJUPSJOH &UI $%/ 4FOEUY 4UBUJDEBUB 0MEEBUB 1SPYZ -
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. S U M M I T γεςϜΞʔΩςΫνϟ User ʢWebΞϓϦʣ Web Nginx ɾTLS-termination ɾgRPC-Web proxy ɾL7 Routing SPA ɾNuxt.js ɾWeb3.js ɾgRPC-Web ɾCore-service (Go/gRPC) ɾAuth-service (Go/echo) ɾUploader-service (Go/echo) ɾEth-proxy-service (Go/echo) ɾAmazon S3 Microservices (Systemd) -
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. S U M M I T ͜ͷΞʔΩςΫνϟΛ࠾༻͍ͯ͠Δཧ༝ • ϒϩοΫνΣʔϯɺgRPCͱ͍͏৽نྖҬʹඈͼࠐΉʹ͋ͨΓɺͦΕҎ֎ ࣮ͱ৴པͷ͋ΔAWSΛ͏͜ͱͰ৽نྖҬʹूத͕Ͱ͖Δ • AuroraɺS3ɺLambdaܦݧ্ɺ৴པͱ࣮͕͋ͬͨ • SPAΛ࠾༻ͨ͜͠ͱόοΫΤϯυͷଟ༷ͳॲཧΛҰݩཧ͢ΔͨΊɺ NLBΛར༻͠ɺNginxΛL7ϧʔλͱͯ͠࠷େݶ׆༻͍ͯ͠Δ • Nginx͔ΒόοΫΤϯυͷ௨৴ͷෆ҆ཁૉΛۃྗΒͨ͢Ίɺίϯς φͳͲར༻ͤͣಉҰΠϯελϯεʹඞཁͳαʔϏεΛͯ͢ىಈ ͍ͤͯ͞Δ -
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. S U M M I T Well Architected ͳ 5 ͭͷϙΠϯτ • ৴པੑ: ՝ۚ෦ͯ͢ϒϩοΫνΣʔϯ্Ͱܾࡁ • ηΩϡϦςΟ: ެ։伴҉߸ΛͬͨFIDOΛ࣮ݱ • ӡ༻্ͷ༏लੑ: AuroraετϨʔδͷࣗಈ֦ுʹΑΔ҆৺ײ/ෛ୲ͷܰݮ • αʔόίετ࠷దԽ: ૿Ճ͠ଓ͚ΔҰ෦ϩάσʔλʹؔͯ͠Aurora͔Β S3ʹίϐʔ͠ɺΞϓϦέʔγϣϯ͔ΒS3Λࢀর • ։ൃίετ࠷దԽ: ϑϩϯτΤϯυͱόοΫΤϯυProtobuf͔Βੜ͞ ΕͨϥΠϒϥϦΛ௨ͯ͡௨৴ -
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. S U M M I T Well ArchitectedͳύϑΥʔϚϯε • gRPC-WebΛ࠾༻ͨ͜͠ͱͰHTTP/2Λ࠷େݶར༻ͨ͠ฒྻΞΫηε • ProtobufΛͦͷ··JSONܕʹอଘɺΠϯσοΫε͕ඞཁͳσʔλͷΈ ݸผͷΧϥϜΛ࡞ • ΞϓϦέʔγϣϯ͔ΒDBͷJOINΫΤϦҰͳ͠ • কདྷͷεέʔϦϯάࢹʹ • ֎෦ཁૉͰ͋ΔIPFSͷը૾ΞοϓϩʔυɺS3 PutEventΛτϦΨʔ ʹLambdaͰඇಉظॲཧ • ETHͷΞΫηεΛҰ෦αʔόͰϓϩΩγ͢Δ͜ͱͰUXվળ -
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. S U M M I T gRPC-WebʹΑΔฒྻΞΫηε -
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. S U M M I T ΞΫηεϨΠςϯγ -
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. S U M M I T DBʹ͓͚ΔSelect Latency -
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. S U M M I T ΞʔΩςΫνϟʹΑΔϏδωεͷߩݙ • ݱΞʔΩςΫνϟ͓Αͦ2ϲ݄Ͱߏஙɺ201811݄30ϦϦʔεɻ • ྦྷܭϢʔβʔ5ສਓɺ6,000DAUɺ3,000ϢʔβʔτϥϯβΫγϣϯ • ྦྷܭച্ֹ 6ϲ݄Ͱ12,000ETH • EthereumΛͬͨੈքҰͷϒϩοΫνΣʔϯήʔϜ • ੈքͰগͳ͍gRPC-WebͷϓϩμΫγϣϯࣄྫ • S3ɺAuroraΛ࢝ΊAWSશମͷ҆৺ײ͔ΒϒϩοΫνΣʔϯgRPCͳͲ ৽نྖҬͷٕज़શྗͰ౿ΈࠐΉ͜ͱ͕Ͱ͖Δ -
S U M M I T © 2019, Amazon Web
Services, Inc. or its affiliates. All rights reserved. ͍͞͝ʹɺɺ -
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. S U M M I T γεςϜΞʔΩςΫνϟ 6QMPBEUP*1'4 4 &UIFSFVN *1'4 *NBHFVQMPBE 8FC "VSPSB /-# 6TFS #BUDI 71$ 1SPYZ 4FOEUY .POJUPSJOH &UI $%/ 4FOEUY 4UBUJDEBUB 0MEEBUB 1SPYZ -
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. S U M M I T γεςϜΞʔΩςΫνϟ 6QMPBEUP*1'4 4 &UIFSFVN *1'4 *NBHFVQMPBE 8FC "VSPSB /-# 6TFS #BUDI 71$ 1SPYZ 4FOEUY .POJUPSJOH &UI $%/ 4FOEUY 4UBUJDEBUB 0MEEBUB 1SPYZ VPCʹߏங͍ͨ͠ͷͰ Managed BlockchainʢEthereumʣ ΛͪΘͼ͓ͯΓ·͢ʂ -
Thank you! S U M M I T © 2019,
Amazon Web Services, Inc. or its affiliates. All rights reserved. ຬ ྄ʢManzoku Ryoʣ [email protected] / twitter@rmanzoku