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
neon-jsで始めるNEO dApps開発入門
Search
GENM
September 30, 2018
Programming
0
450
neon-jsで始めるNEO dApps開発入門
ブロックチェーンNEOの開発をするにあたって、有力な選択肢であるJavascript SDKのneon-jsについて紹介
GENM
September 30, 2018
Tweet
Share
Other Decks in Programming
See All in Programming
メタプログラミングで実現する「コードを仕様にする」仕組み/nikkei-tech-talk43
nikkei_engineer_recruiting
0
200
20260315 AWSなんもわからん🥲
chiilog
2
170
Rで始めるML・LLM活用入門
wakamatsu_takumu
0
190
API Platformを活用したPHPによる本格的なWeb API開発 / api-platform-book-intro
ttskch
1
150
20260313 - Grafana & Friends Taipei #1 - Kubernetes v1.36 的開發雜記:那些困在 Alpha 加護病房太久的 Metrics
tico88612
0
220
PHPのバージョンアップ時にも役立ったAST(2026年版)
matsuo_atsushi
0
220
OTP を自動で入力する裏技
megabitsenmzq
0
120
車輪の再発明をしよう!PHP で実装して学ぶ、Web サーバーの仕組みと HTTP の正体
h1r0
2
250
[PHPerKaigi 2026]PHPerKaigi2025の企画CodeGolfが最高すぎて社内で内製して半年運営して得た内製と運営の知見
ikezoemakoto
0
240
[SF Ruby Feb'26] The Silicon Heel
palkan
0
120
S3ストレージクラスの「見える」「ある」「使える」は全部違う ─ 体験から見た、仕様の深淵を覗く
ya_ma23
0
850
SourceGeneratorのマーカー属性問題について
htkym
0
210
Featured
See All Featured
Bash Introduction
62gerente
615
210k
Abbi's Birthday
coloredviolet
2
5.5k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
240
Imperfection Machines: The Place of Print at Facebook
scottboms
269
14k
Claude Code のすすめ
schroneko
67
220k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.7k
Scaling GitHub
holman
464
140k
RailsConf 2023
tenderlove
30
1.4k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.2k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
380
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
160
Transcript
neon-jsͰ࢝ΊΔdApps։ൃೖ JS SDK for NEO blockchain
NEO Keymakers Japan @genm ࣗݾհ ࠓా େ(23) ܚጯٛक़େֶϝσΟΞσβΠϯݚڀՊ म࢜1 Taisei
Imada ৯ΔΓ NEO Keymakers Japanॴଐ ࡢ·ͰΧϯηϦϯάϩϘοτͷ։ൃ ݱࡏNEOΛத৺ʹϒϩοΫνΣʔϯͷษڧத ిࢠ࡞ Facebook: taisei_imada
NEO Keymakers Japan @genm neon-js: NEO BlockchainͷͨΊͷJavascript SDK ΥϨοτػೳ τϥϯβΫγϣϯ
ͦͷଞศརػೳ neon-js ϥΠτΥϨοτΛ࡞͢Δͷʹेͳػೳ
NEO Keymakers Japan @genm ϥΠτΥϨοτͱϑϧϊʔυͷҧ͍ ϥΠτΥϨοτ ϑϧϊʔυ neo-python ඞཁͳ༰ྔ͕গͳ͍ͷͰεϚϗɺϒϥβͰ͍͍͢ neo-GUI
neo-CLI ϥΠτΥϨοτɺϒϩοΫνΣʔϯͷσʔλΛ࣋ͨͳ͍ ϑϧϊʔυʹґଘ͢ΔΘΓʹ༰ྔগɺػೳγϯϓϧ ϥΠτΥϨοτϑϧϊʔυΛհͯ͠ϒϩοΫνΣʔϯͱΓऔΓΛߦ͏ ϒϩοΫνΣʔϯ طଘϊʔυ
NEO Keymakers Japan @genm Πϯετʔϧ npm i @cityofzion/neon-js <script src="https://unpkg.com/@cityofzion/neon-js"
/> npm ϒϥβ(CDN)
NEO Keymakers Japan @genm neon-js 4.0+ͷߏ Core Module Plugin Module
ɾAPI ɾNEP5 ɾWallet ɾTransactions ɾRPC ɾSmart Contract ɾUtility ɾConstants ɾSettings ɾLogging ϒϩοΫνΣʔϯͱͷΓऔΓʹඞཁͳجຊػೳ ֎෦Ϧιʔεʹґଘ͢Δิॿతͳͷ
NEO Keymakers Japan @genm Core Modules Wallet: wallet import {
wallet } from “@cityofzion/neon-js"; ϓϥΠϕʔτΩʔ͔ΒΥϨοτΛੜͯ͠෮߸Խ const c = new wallet.Account( ɹ“6PYLHmDf6AjF4AsVtosmxHuPYeuyJL3SLuw7J1U8i7HxKAnYNsp61HYRfF” ); // ҉߸Խ͞ΕͨΩʔɾΞυϨεͷදࣔ console.log(c.encrypted); // encrypted key console.log(c.address); // throws error // ύεϫʔυΛೖྗͯ͠ΥϨοτͷ෮߸Խ c.decrypt("city of zion"); console.log(c.address); // ALq7AWrhAueN6mJNqk6FHJjnsEoPRytLdW
NEO Keymakers Japan @genm Core Modules Transactions: tx // τϥϯβΫγϣϯͷੜͱγϦΞϥΠζ
import { tx } from “@cityofzion/neon-js"; let tx = Neon.create.tx({ type: 128 }); const serializedTx = tx.serialize(); RPC: rpc // ΫΤϦΛ࡞ͯ͠ϊʔυʹ໋ྩΛૹ৴͢Δɻ import { rpc } from "@cityofzion/neon-js"; const client = new rpc.rpcClient(URL); let query = Neon.create.query({method: 'custommethod'} client.execute(query)
NEO Keymakers Japan @genm Core Modules Smart Contract: sc Utility:
u // εϚʔτίϯτϥΫτͷςετ(test invoke) import { sc, rpc } from “@cityofzion/neon-js"; const sb = new sc.scriptBuilder() sb.emitAppCall(scriptHash, operation, args[]) rpc.Query.invokeScript(sb.str).execute(nodeURL) // Invoke // จࣈྻΛHEXʹͨ͠ΓɺHEX͔Βจࣈྻʹͨ͠Γ import { u } from “@cityofzion/neon-js"; u.str2hexstring(“normalString”); //string→Hex u.hexstring2str("6e6f726d616c537472696e67"); // Hex→string
NEO Keymakers Japan @genm Core Modules Constants: CONST Settings: settings
Logging: logging // ఆ͕৭ʑೖ͍ͬͯΔ import { CONST } from “@cityofzion/neon-js"; const rpcVersion = CONST.RPC_VERSION // ωοτϫʔΫͷొ import Neon, { settings } from “@cityofzion/neon-js"; const newNet = new Neon.rpc.Network({ name: "NewNet" }); Neon.add.network(newNet); // ϩάͷઃఆ import { logging } from “@cityofzion/neon-js"; logging.logger.setAll('info')
NEO Keymakers Japan @genm Plugin Module ֎෦APIαʔό(neoscan͋Δ͍neonDB)͕ແ͍ͱಈ͔ͳ͍ API NEP5 εϚʔτίϯτϥΫτ͕NEP5ͷن֨ʹͦͬͨߏΛ͍ͯ͠Δඞཁ͕͋Δ
// Balanceͷऔಘ import { api } from “@cityofzion/neon-js”; api.neoscan.getBalance("http://www.neoscan-testnet.io/test_net/v1/", address); // NEP5τʔΫϯͷใऔಘ api.nep5.getTokenInfo("http://seed1.neo.org:20332", rpxScriptHash);
NEO Keymakers Japan @genm neon-jsΛͬͨΞϓϦߏ NEO Blockchain neoscan ΫϥΠΞϯτ PluginModuleܥͷૢ࡞
InvokeɺBalanceͳͲ ϒϩοΫνΣʔϯͷૢ࡞ CoreModuleܥͷૢ࡞ WalletɺTransactionɺRPC
NEO Keymakers Japan @genm neoscanͱ NEO Blockchain neoscan ಉظ άϥϑΟΧϧͳWEBΞϓϦέʔγϣϯ͖ͷAPIαʔό
શͯͷτϥϯβΫγϣϯཤྺ͔ΒͦΕͧΕͷΞΧϯτͷߴΛࢉग़
NEO Keymakers Japan @genm ϓϥΠϕʔτωοτͰָʹ։ൃ͢Δ https://github.com/keymakers/neo-scan-docker NEOSCAN DOCKER $ git
clone https://github.com/keymakers/neo-scan-docker.git $ cd neo-scan-docker $ docker-compose up -d Private net neoscan DockerCompose
NEO Keymakers Japan @genm ऴΘΓʹ neon-jsɺϒϥβElectronͰಈ͔͢ dApps։ൃʹ͓͍ͯݱঢ়࠷༗ྗͳબࢶ
NEO Keymakers Japan @genm ࢀߟࢿྉ 1. neon-js(Github) https://github.com/CityOfZion/neon-js 2. neon-js(Document)
http://cityofzion.io/neon-js/ 3. neon wallet https://neonwallet.com/ 4. neoscan https://neoscan.io/ 5. neoscan docker https://github.com/slipo/neo-scan-docker