Viual Studio

Visual Studio を使って、ブロックチェーン開発環境の構築

5/25 のde:code day 2 の最後のセッション「FinTechだけじゃモッタイ無い!ブロックチェーン とクラウドが作る未来」のセッションを受けた自分の復習的なメモです。

セッション内容を正しく理解したい方は、de:code のセッション動画と資料をご覧ください。

■動画
https://channel9.msdn.com/Events/de-code/2016/DOO-012

■スライド
https://docs.com/decode2016/5987

 


 

Microsoft Azure では、Blockchain as a Service というサイトもたっているみたいです。
https://azure.microsoft.com/ja-jp/solutions/blockchain/

開発者には、Solidity が提供されています。
https://visualstudiogallery.msdn.microsoft.com/96221853-33c4-4531-bdd5-d2ea5acc479

 

ちなみに、Solidity とは、EVM(イーサリアム仮想マシン) で動く Java Script に似た言語らしい。
https://github.com/ethereum/wiki/blob/master/%5BJapanese%5D-Solidity-Tutorial.md

 


 

やってみたこと

Visual Studio にSolidity をインストールし、チュートリアルにかいてあることを試してみました。

 

まずは、Visual Studioに「ツール」→「拡張機能と更新プログラム」より、Solidity をインストールします。

 

インストールするとプロジェクト作成時にテンプレートに、Solidity が出てきます。
今回は、「Smart Contract Project」にしました。

 

プロジェクトができるとこんな感じ。
README.html を見ながら、ローカルで動く環境を作っていきます。

 

作業フォルダは、d:\solidity_20160728 にしました。
まずは、blockapps-bloc のインストールから。
チュートリアルには -g はついてなかったのですが、de:code のask the speaker で教えて頂いて、-g つけました。
こっちでも、-gつけてるしねー。
https://www.npmjs.com/package/blockapps-bloc

C:\Windows\system32>cd /d D:\solidity_20160728

D:\solidity_20160728>npm install -g blockapps-bloc
npm WARN engine blockapps-js@3.1.2: wanted: {"node":"^5.0.0"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN deprecated graceful-fs@3.0.8: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated secp256k1-browserify@0.0.0: secp256k1 now inculdes browser compentents
C:\Users\吾郷由知\AppData\Roaming\npm\bloc -> C:\Users\吾郷由知\AppData\Roaming\npm\node_modules\blockapps-bloc\bin\main.js
blockapps-bloc@1.2.1 C:\Users\吾郷由知\AppData\Roaming\npm\node_modules\blockapps-bloc
├── deepmerge@0.2.10
├── map-stream@0.0.6
├── pkginfo@0.4.0
├── cookie-parser@1.4.3 (cookie-signature@1.0.6, cookie@0.3.1)
├── mustache@2.2.1
├── chalk@1.1.3 (escape-string-regexp@1.0.5, supports-color@2.0.0, ansi-styles@2.2.1, strip-ansi@3.0.1, has-ansi@2.0.0)
├── enum@2.3.0
├── minimatch@3.0.2 (brace-expansion@1.1.6)
├── mkdirp@0.5.1 (minimist@0.0.8)
├── bignumber.js@2.4.0
├── event-stream@3.3.4 (duplexer@0.1.1, stream-combiner@0.0.4, from@0.1.3, pause-stream@0.0.11, map-stream@0.1.0, split@0.3.3, through@2.3.8)
├── morgan@1.7.0 (on-headers@1.0.1, basic-auth@1.0.4, depd@1.1.0, on-finished@2.3.0, debug@2.2.0)
├── express-session@1.14.0 (cookie-signature@1.0.6, on-headers@1.0.1, utils-merge@1.0.0, parseurl@1.3.1, cookie@0.3.1, depd@1.1.0, crc@3.4.0, uid-safe@2.1.1, debug@2.2.0)
├── through2@2.0.1 (xtend@4.0.1, readable-stream@2.0.6)
├── yargs@3.32.0 (decamelize@1.2.0, camelcase@2.1.1, y18n@3.2.1, window-size@0.1.4, cliui@3.2.0, string-width@1.0.1, os-locale@1.4.0)
├── readdirp@2.1.0 (set-immediate-shim@1.0.1, graceful-fs@4.1.5, readable-stream@2.1.4)
├── bluebird@2.10.2
├── express@4.14.0 (escape-html@1.0.3, utils-merge@1.0.0, cookie-signature@1.0.6, array-flatten@1.1.1, methods@1.1.2, merge-descriptors@1.0.1, vary@1.1.0, fresh@0.3.0, parseurl@1.3.1, content-type@1.0.2, range-parser@1.2.0, etag@1.7.0, path-to-regexp@0.1.7, encodeurl@1.0.1, cookie@0.3.1, content-disposition@0.5.1, serve-static@1.11.1, depd@1.1.0, on-finished@2.3.0, finalhandler@0.5.0, debug@2.2.0, qs@6.2.0, proxy-addr@1.1.2, send@0.14.1, type-is@1.6.13, accepts@1.3.3)
├── body-parser@1.15.2 (bytes@2.4.0, content-type@1.0.2, depd@1.1.0, on-finished@2.3.0, raw-body@2.1.7, http-errors@1.5.0, debug@2.2.0, qs@6.2.0, type-is@1.6.13, iconv-lite@0.4.13)
├── vinyl-fs@2.4.3 (merge-stream@1.0.0, object-assign@4.1.0, vali-date@1.0.0, is-valid-glob@0.3.0, graceful-fs@4.1.5, lodash.isequal@4.3.0, lazystream@1.0.0, strip-bom-stream@1.0.0, strip-bom@2.0.0, through2-filter@2.0.0, gulp-sourcemaps@1.6.0, vinyl@1.1.1, duplexify@3.4.5, readable-stream@2.1.4, glob-stream@5.3.2)
├── js-yaml@3.6.1 (esprima@2.7.2, argparse@1.0.7)
├── prompt@0.2.14 (revalidator@0.1.8, read@1.0.7, utile@0.2.1, winston@0.8.3)
├── request@2.74.0 (is-typedarray@1.0.0, aws-sign2@0.6.0, oauth-sign@0.8.2, forever-agent@0.6.1, tunnel-agent@0.4.3, caseless@0.11.0, stringstream@0.0.5, isstream@0.1.2, json-stringify-safe@5.0.1, extend@3.0.0, aws4@1.4.1, node-uuid@1.4.7, combined-stream@1.0.5, qs@6.2.1, mime-types@2.1.11, tough-cookie@2.3.1, form-data@1.0.0-rc4, bl@1.1.2, http-signature@1.1.1, har-validator@2.0.6, hawk@3.1.3)
├── blockapps-js@3.1.2 (randombytes@2.0.3, mnemonic@1.0.1, js-sha3@0.5.2, rlp@1.1.2, bn.js@4.11.5, elliptic@6.3.1)
├── ethereumjs-util@2.0.3 (rlp@2.0.0, bn.js@3.3.0, browserify-sha3@0.0.0, elliptic@5.2.1)
├── ethereumjs-tx@0.6.7 (browserify-sha3@0.0.2, ethereum-common@0.0.10, secp256k1-browserify@0.0.0)
├── express-handlebars@2.0.1 (graceful-fs@3.0.8, promise@6.1.0, object.assign@1.1.1, glob@5.0.15, handlebars@3.0.3)
├── insight@0.7.0 (object-assign@4.1.0, lodash.debounce@3.1.1, async@1.5.2, configstore@1.4.0, tough-cookie@2.3.1, os-name@1.0.3, inquirer@0.10.1)
├── eslint@2.13.1 (path-is-absolute@1.0.0, path-is-inside@1.0.1, ignore@3.1.3, imurmurhash@0.1.4, pluralize@1.2.1, strip-json-comments@1.0.4, progress@1.1.8, globals@9.9.0, estraverse@4.2.0, text-table@0.2.0, esutils@2.0.2, user-home@2.0.0, is-resolvable@1.0.0, debug@2.2.0, json-stable-stringify@1.0.1, levn@0.3.0, glob@7.0.5, optionator@0.8.1, require-uncached@1.0.2, doctrine@1.2.2, concat-stream@1.5.1, shelljs@0.6.0, is-my-json-valid@2.13.1, inquirer@0.12.0, file-entry-cache@1.2.4, espree@3.1.6, table@3.7.8, es6-map@0.1.4, escope@3.6.0, lodash@4.14.0)
└── eth-lightwallet@0.1.0 (rlp@1.1.2, bignumber.js@2.0.7, bitcore-mnemonic@0.13.2, elliptic@3.1.0, crypto-js@3.1.6, web3@0.13.0, bitcore@0.13.5)

 

続いて、「bloc init」を実行!!

D:\solidity_20160728>bloc init
? ==========================================================================
We're constantly looking for ways to make blockapps-bloc better!
May we anonymously report usage statistics to improve the tool over time?
More info: https://github.com/blockapps/bloc & http://blockapps.net
========================================================================== (Y/n)
    ____  __           __   ___
   / __ )/ /___  _____/ /__/   |  ____  ____  _____
  / __  / / __ \/ ___/ //_/ /| | / __ \/ __ \/ ___/
 / /_/ / / /_/ / /__/ ,< / ___ |/ /_/ / /_/ (__  )
/_____/_/\____/\___/_/|_/_/  |_/ .___/ .___/____/
                              /_/   /_/
prompt: Enter the name of your app:  testapp
prompt: Enter your name:  testappadmin
prompt: Enter your email so BlockApps can reach you:  y0.ag0u3@gmail.com
prompt: apiURL:  (http://strato-dev4.blockapps.net)
prompt: Enter the blockchain profile you wish to use.  Options: strato-dev, ethereum:  (strato-dev)
report obj: {"initName":"testappadmin","initEmail":"y0.ag0u3@gmail.com","initTimestamp":"1469639710"}
Wrote: D:\solidity_20160728\testapp\.bowerrc
Wrote: D:\solidity_20160728\testapp\app.js
Wrote: D:\solidity_20160728\testapp\bower.json
Wrote: D:\solidity_20160728\testapp\gulpfile.js
Wrote: D:\solidity_20160728\testapp\marko-taglib.json
Wrote: D:\solidity_20160728\testapp\package.json
Wrote: D:\solidity_20160728\testapp\test\common.js
Wrote: D:\solidity_20160728\testapp\test\top.js
Wrote: D:\solidity_20160728\testapp\app\contracts\Greeter.sol
Wrote: D:\solidity_20160728\testapp\app\contracts\MultiContract.sol
Wrote: D:\solidity_20160728\testapp\app\contracts\Payout.sol
Wrote: D:\solidity_20160728\testapp\app\contracts\SimpleDataFeed.sol
Wrote: D:\solidity_20160728\testapp\app\contracts\SimpleMultiSig.sol
Wrote: D:\solidity_20160728\testapp\app\contracts\SimpleStorage.sol
Wrote: D:\solidity_20160728\testapp\app\contracts\Stake.sol
Wrote: D:\solidity_20160728\testapp\app\contracts\template.marko
Wrote: D:\solidity_20160728\testapp\app\lib\abi.js
Wrote: D:\solidity_20160728\testapp\app\lib\analytics.js
Wrote: D:\solidity_20160728\testapp\app\lib\cmd.js
Wrote: D:\solidity_20160728\testapp\app\lib\codegen.js
Wrote: D:\solidity_20160728\testapp\app\lib\compile.js
Wrote: D:\solidity_20160728\testapp\app\lib\contract-helpers.js
Wrote: D:\solidity_20160728\testapp\app\lib\icon.js
Wrote: D:\solidity_20160728\testapp\app\lib\keygen.js
Wrote: D:\solidity_20160728\testapp\app\lib\prompt-schema.js
Wrote: D:\solidity_20160728\testapp\app\lib\scaffold.js
Wrote: D:\solidity_20160728\testapp\app\lib\upload.js
Wrote: D:\solidity_20160728\testapp\app\lib\yaml-config.js
Wrote: D:\solidity_20160728\testapp\app\routes\addresses.js
Wrote: D:\solidity_20160728\testapp\app\routes\contract.js
Wrote: D:\solidity_20160728\testapp\app\routes\examples.js
Wrote: D:\solidity_20160728\testapp\app\routes\home.js
Wrote: D:\solidity_20160728\testapp\app\routes\users.js
Wrote: D:\solidity_20160728\testapp\test\config\config.test.js
Wrote: D:\solidity_20160728\testapp\test\contract\contract.test.js
Wrote: D:\solidity_20160728\testapp\test\keygen\keygen.test.js
Wrote: D:\solidity_20160728\testapp\test\multi\multi.test.js
Wrote: D:\solidity_20160728\testapp\app\components\contractFunctionsCall\template.marko
Wrote: D:\solidity_20160728\testapp\app\components\contractFunctions\template.marko
Wrote: D:\solidity_20160728\testapp\app\components\contractNameList\template.marko
Wrote: D:\solidity_20160728\testapp\app\components\contractJS\template.marko
Wrote: D:\solidity_20160728\testapp\app\components\contractStatus\template.marko
Wrote: D:\solidity_20160728\testapp\app\components\contracts\template.marko
Wrote: D:\solidity_20160728\testapp\app\components\globalKeystore\template.marko
Wrote: D:\solidity_20160728\testapp\app\components\header\template.marko
Wrote: D:\solidity_20160728\testapp\app\components\keyModal\template.marko
Wrote: D:\solidity_20160728\testapp\app\components\home\home.marko
Wrote: D:\solidity_20160728\testapp\app\components\keyStatus\template.marko
Wrote: D:\solidity_20160728\testapp\app\components\login\template.marko
Wrote: D:\solidity_20160728\testapp\app\components\loginStatus\template.marko
Wrote: D:\solidity_20160728\testapp\app\components\navTemplate\template.marko
Wrote: D:\solidity_20160728\testapp\app\components\selectUser\template.marko
Wrote: D:\solidity_20160728\testapp\app\static\css\styles.css
project initiated!
now type `cd testapp && npm install`
thanks for registering with BlockApps!

 

チュートリアルで、「cd app_name && npm install」の箇所です。
自分は、testapp と適当な名前を付けました。

D:\solidity_20160728>cd testapp && npm install
npm WARN package.json testapp@1.0.0 No description
npm WARN package.json testapp@1.0.0 No repository field.
npm WARN package.json testapp@1.0.0 No README data
npm WARN engine blockapps-js@3.1.2: wanted: {"node":"^5.0.0"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN deprecated graceful-fs@3.0.8: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated lodash@1.0.2: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0. / > gulp-express@0.3.5 install D:\solidity_20160728\testapp\node_modules\gulp-express
> echo "*** Please use [gulp-live-server] instead! *** "

"*** Please use [gulp-live-server] instead! *** "
npm WARN deprecated to-iso-string@0.0.2: to-iso-string has been deprecated, use @segment/to-iso-string instead.
npm WARN deprecated jade@0.26.3: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN optional dep failed, continuing fsevents@1.0.14
npm WARN deprecated secp256k1-browserify@0.0.0: secp256k1 now inculdes browser compentents
-
> testapp@1.0.0 postinstall D:\solidity_20160728\testapp
> node node_modules/bower/bin/bower install

bower jquery#~1.10.2        not-cached https://github.com/jquery/jquery-dist.git#~1.10.2
bower jquery#~1.10.2           resolve https://github.com/jquery/jquery-dist.git#~1.10.2
bower underscore#~1.8.3     not-cached https://github.com/jashkenas/underscore.git#~1.8.3
bower underscore#~1.8.3        resolve https://github.com/jashkenas/underscore.git#~1.8.3
bower bootstrap#~3.1.1      not-cached https://github.com/twbs/bootstrap.git#~3.1.1
bower bootstrap#~3.1.1         resolve https://github.com/twbs/bootstrap.git#~3.1.1
bower jquery#~1.10.2          checkout 1.10.2
bower underscore#~1.8.3       checkout 1.8.3
bower bootstrap#~3.1.1        checkout v3.1.1
bower jquery#~1.10.2          resolved https://github.com/jquery/jquery-dist.git#1.10.2
bower underscore#~1.8.3       resolved https://github.com/jashkenas/underscore.git#1.8.3
bower bootstrap#~3.1.1    invalid-meta The "main" field cannot contain font, image, audio, or video files
bower bootstrap#~3.1.1    invalid-meta The "main" field cannot contain font, image, audio, or video files
bower bootstrap#~3.1.1    invalid-meta The "main" field cannot contain font, image, audio, or video files
bower bootstrap#~3.1.1    invalid-meta The "main" field cannot contain font, image, audio, or video files
bower bootstrap#~3.1.1        resolved https://github.com/twbs/bootstrap.git#3.1.1
bower jquery#~1.10.2           install jquery#1.10.2
bower underscore#~1.8.3        install underscore#1.8.3
bower bootstrap#~3.1.1         install bootstrap#3.1.1

jquery#1.10.2 app\static\bower_components\jquery

underscore#1.8.3 app\static\bower_components\underscore

bootstrap#3.1.1 app\static\bower_components\bootstrap
└── jquery#1.10.2
mocha-steps@1.0.1 node_modules\mocha-steps

deepmerge@0.2.10 node_modules\deepmerge

map-stream@0.0.6 node_modules\map-stream

cookie-parser@1.4.3 node_modules\cookie-parser
├── cookie-signature@1.0.6
└── cookie@0.3.1

underscore@1.8.3 node_modules\underscore

traverse@0.6.6 node_modules\traverse

cors@2.7.1 node_modules\cors
└── vary@1.1.0

chalk@1.1.3 node_modules\chalk
├── escape-string-regexp@1.0.5
├── supports-color@2.0.0
├── ansi-styles@2.2.1
├── has-ansi@2.0.0 (ansi-regex@2.0.0)
└── strip-ansi@3.0.1 (ansi-regex@2.0.0)

event-stream@3.3.4 node_modules\event-stream
├── stream-combiner@0.0.4
├── duplexer@0.1.1
├── from@0.1.3
├── pause-stream@0.0.11
├── map-stream@0.1.0
├── split@0.3.3
└── through@2.3.8

mkdirp@0.5.1 node_modules\mkdirp
└── minimist@0.0.8

express-session@1.14.0 node_modules\express-session
├── utils-merge@1.0.0
├── cookie-signature@1.0.6
├── on-headers@1.0.1
├── parseurl@1.3.1
├── cookie@0.3.1
├── depd@1.1.0
├── crc@3.4.0
├── uid-safe@2.1.1 (base64-url@1.2.2, random-bytes@1.0.0)
└── debug@2.2.0 (ms@0.7.1)

morgan@1.7.0 node_modules\morgan
├── on-headers@1.0.1
├── basic-auth@1.0.4
├── depd@1.1.0
├── on-finished@2.3.0 (ee-first@1.1.1)
└── debug@2.2.0 (ms@0.7.1)

fs-promise@0.4.1 node_modules\fs-promise
└── any-promise@1.3.0

rimraf@2.5.4 node_modules\rimraf
└── glob@7.0.5 (path-is-absolute@1.0.0, inherits@2.0.1, fs.realpath@1.0.0, inflight@1.0.5, once@1.3.3, minimatch@3.0.2)

del@2.2.1 node_modules\del
├── is-path-cwd@1.0.0
├── object-assign@4.1.0
├── pify@2.3.0
├── pinkie-promise@2.0.1 (pinkie@2.0.4)
├── is-path-in-cwd@1.0.0 (is-path-inside@1.0.0)
└── globby@5.0.0 (arrify@1.0.1, array-union@1.0.2, glob@7.0.5)

readdirp@2.1.0 node_modules\readdirp
├── set-immediate-shim@1.0.1
├── graceful-fs@4.1.5
├── minimatch@3.0.2 (brace-expansion@1.1.6)
└── readable-stream@2.1.4 (buffer-shims@1.0.0, inherits@2.0.1, process-nextick-args@1.0.7, util-deprecate@1.0.2, string_decoder@0.10.31, isarray@1.0.0, core-util-is@1.0.2)

body-parser@1.15.2 node_modules\body-parser
├── content-type@1.0.2
├── bytes@2.4.0
├── depd@1.1.0
├── on-finished@2.3.0 (ee-first@1.1.1)
├── raw-body@2.1.7 (unpipe@1.0.0)
├── http-errors@1.5.0 (setprototypeof@1.0.1, inherits@2.0.1, statuses@1.3.0)
├── debug@2.2.0 (ms@0.7.1)
├── qs@6.2.0
├── type-is@1.6.13 (media-typer@0.3.0, mime-types@2.1.11)
└── iconv-lite@0.4.13

express@4.14.0 node_modules\express
├── escape-html@1.0.3
├── utils-merge@1.0.0
├── cookie-signature@1.0.6
├── array-flatten@1.1.1
├── merge-descriptors@1.0.1
├── fresh@0.3.0
├── methods@1.1.2
├── vary@1.1.0
├── parseurl@1.3.1
├── encodeurl@1.0.1
├── range-parser@1.2.0
├── content-type@1.0.2
├── etag@1.7.0
├── path-to-regexp@0.1.7
├── cookie@0.3.1
├── content-disposition@0.5.1
├── serve-static@1.11.1
├── depd@1.1.0
├── on-finished@2.3.0 (ee-first@1.1.1)
├── finalhandler@0.5.0 (unpipe@1.0.0, statuses@1.3.0)
├── debug@2.2.0 (ms@0.7.1)
├── qs@6.2.0
├── proxy-addr@1.1.2 (forwarded@0.1.0, ipaddr.js@1.1.1)
├── send@0.14.1 (destroy@1.0.4, ms@0.7.1, statuses@1.3.0, mime@1.3.4, http-errors@1.5.0)
├── accepts@1.3.3 (negotiator@0.6.1, mime-types@2.1.11)
└── type-is@1.6.13 (media-typer@0.3.0, mime-types@2.1.11)

vinyl-fs@2.4.3 node_modules\vinyl-fs
├── merge-stream@1.0.0
├── vali-date@1.0.0
├── is-valid-glob@0.3.0
├── object-assign@4.1.0
├── graceful-fs@4.1.5
├── lodash.isequal@4.3.0
├── lazystream@1.0.0
├── strip-bom-stream@1.0.0 (first-chunk-stream@1.0.0)
├── strip-bom@2.0.0 (is-utf8@0.2.1)
├── through2-filter@2.0.0 (xtend@4.0.1)
├── gulp-sourcemaps@1.6.0 (convert-source-map@1.3.0)
├── vinyl@1.1.1 (clone-stats@0.0.1, replace-ext@0.0.1, clone@1.0.2)
├── duplexify@3.4.5 (inherits@2.0.1, stream-shift@1.0.0, end-of-stream@1.0.0)
├── readable-stream@2.1.4 (buffer-shims@1.0.0, inherits@2.0.1, process-nextick-args@1.0.7, util-deprecate@1.0.2, string_decoder@0.10.31, isarray@1.0.0, core-util-is@1.0.2)
├── through2@2.0.1 (xtend@4.0.1, readable-stream@2.0.6)
└── glob-stream@5.3.2 (extend@3.0.0, ordered-read-streams@0.3.0, to-absolute-glob@0.1.1, glob-parent@2.0.0, unique-stream@2.2.1, through2@0.6.5, glob@5.0.15, micromatch@2.3.11)

bluebird@3.4.1 node_modules\bluebird

tiny-lr@0.2.1 node_modules\tiny-lr
├── parseurl@1.3.1
├── debug@2.2.0 (ms@0.7.1)
├── qs@5.1.0
├── livereload-js@2.2.2
├── faye-websocket@0.10.0 (websocket-driver@0.6.5)
└── body-parser@1.14.2 (bytes@2.2.0, content-type@1.0.2, depd@1.1.0, on-finished@2.3.0, http-errors@1.3.1, raw-body@2.1.7, qs@5.2.0, type-is@1.6.13, iconv-lite@0.4.13)

gulp-express@0.3.5 node_modules\gulp-express
├── debug@2.2.0 (ms@0.7.1)
├── event-stream@3.2.2 (stream-combiner@0.0.4, duplexer@0.1.1, from@0.1.3, pause-stream@0.0.11, map-stream@0.1.0, split@0.3.3, through@2.3.8)
└── tiny-lr@0.0.9 (parseurl@1.3.1, debug@0.8.1, qs@0.6.6, noptify@0.0.3, faye-websocket@0.7.3)

js-yaml@3.6.1 node_modules\js-yaml
├── esprima@2.7.2
└── argparse@1.0.7 (sprintf-js@1.0.3)

socket.io@1.4.8 node_modules\socket.io
├── has-binary@0.1.7 (isarray@0.0.1)
├── debug@2.2.0 (ms@0.7.1)
├── socket.io-parser@2.2.6 (isarray@0.0.1, component-emitter@1.1.2, json3@3.3.2, benchmark@1.0.0)
├── engine.io@1.6.11 (base64id@0.1.0, engine.io-parser@1.2.4, ws@1.1.0, accepts@1.1.4)
├── socket.io-adapter@0.4.0 (socket.io-parser@2.2.2)
└── socket.io-client@1.4.8 (to-array@0.1.4, indexof@0.0.1, component-emitter@1.2.0, component-bind@1.0.0, backo2@1.0.2, object-component@0.0.3, parseuri@0.0.4, engine.io-client@1.6.11)

gulp@3.9.1 node_modules\gulp
├── pretty-hrtime@1.0.2
├── interpret@1.0.1
├── deprecated@0.0.1
├── archy@1.0.0
├── tildify@1.2.0 (os-homedir@1.0.1)
├── minimist@1.2.0
├── v8flags@2.0.11 (user-home@1.1.1)
├── orchestrator@0.3.7 (stream-consume@0.1.0, sequencify@0.0.7, end-of-stream@0.1.5)
├── semver@4.3.6
├── liftoff@2.2.5 (rechoir@0.6.2, extend@3.0.0, flagged-respawn@0.3.2, resolve@1.1.7, findup-sync@0.4.2)
├── gulp-util@3.0.7 (array-differ@1.0.0, array-uniq@1.0.3, object-assign@3.0.0, lodash._reescape@3.0.0, lodash._reevaluate@3.0.0, lodash._reinterpolate@3.0.0, beeper@1.1.0, replace-ext@0.0.1, has-gulplog@0.1.0, fancy-log@1.2.0, vinyl@0.5.3, gulplog@1.0.0, lodash.template@3.6.2, through2@2.0.1, multipipe@0.1.2, dateformat@1.0.12)
└── vinyl-fs@0.3.14 (graceful-fs@3.0.8, strip-bom@1.0.0, defaults@1.0.3, vinyl@0.4.6, through2@0.6.5, glob-stream@3.1.18, glob-watcher@0.0.6)

mocha@2.5.3 node_modules\mocha
├── escape-string-regexp@1.0.2
├── supports-color@1.2.0
├── to-iso-string@0.0.2
├── growl@1.9.2
├── commander@2.3.0
├── diff@1.4.0
├── debug@2.2.0 (ms@0.7.1)
├── glob@3.2.11 (inherits@2.0.1, minimatch@0.3.0)
└── jade@0.26.3 (commander@0.6.1, mkdirp@0.3.0)

gulp-nodemon@2.1.0 node_modules\gulp-nodemon
├── colors@1.1.2
└── nodemon@1.10.0 (ignore-by-default@1.0.1, undefsafe@0.0.3, ps-tree@1.1.0, debug@2.2.0, es6-promise@3.2.1, minimatch@3.0.2, touch@1.0.0, lodash.defaults@3.1.2, update-notifier@0.5.0, chokidar@1.6.0)

express-handlebars@2.0.1 node_modules\express-handlebars
├── graceful-fs@3.0.8
├── promise@6.1.0 (asap@1.0.0)
├── object.assign@1.1.1 (object-keys@1.0.11)
├── glob@5.0.15 (path-is-absolute@1.0.0, inherits@2.0.1, once@1.3.3, inflight@1.0.5, minimatch@3.0.2)
└── handlebars@3.0.3 (optimist@0.6.1, source-map@0.1.43, uglify-js@2.3.6)

blockapps-js@3.1.2 node_modules\blockapps-js
├── randombytes@2.0.3
├── mnemonic@1.0.1
├── js-sha3@0.5.2
├── rlp@1.1.2
├── bn.js@4.11.5
├── enum@2.3.0
├── bignumber.js@2.4.0
├── elliptic@6.3.1 (inherits@2.0.1, brorand@1.0.5, hash.js@1.0.3)
├── bluebird@2.10.2
└── request@2.74.0 (is-typedarray@1.0.0, aws-sign2@0.6.0, oauth-sign@0.8.2, forever-agent@0.6.1, tunnel-agent@0.4.3, caseless@0.11.0, stringstream@0.0.5, isstream@0.1.2, json-stringify-safe@5.0.1, extend@3.0.0, aws4@1.4.1, node-uuid@1.4.7, combined-stream@1.0.5, qs@6.2.1, mime-types@2.1.11, tough-cookie@2.3.1, form-data@1.0.0-rc4, bl@1.1.2, har-validator@2.0.6, http-signature@1.1.1, hawk@3.1.3)

marko@2.10.1 node_modules\marko
├── resolve-from@1.0.1
├── raptor-regexp@1.0.1
├── try-require@1.2.1
├── raptor-strings@1.0.2
├── browser-refresh-client@1.1.4
├── property-handlers@1.1.1
├── raptor-json@1.1.0
├── char-props@0.1.5
├── raptor-args@1.0.3
├── app-module-path@1.1.0
├── async-writer@1.4.2
├── raptor-util@1.0.10
├── events@1.1.1
├── raptor-polyfill@1.0.2
├── minimatch@0.2.14 (sigmund@1.0.1, lru-cache@2.7.3)
├── raptor-promises@1.0.3 (q@1.4.1)
├── raptor-logging@1.1.2 (raptor-stacktraces@1.0.1)
├── marko-layout@2.0.2 (raptor-dust@1.1.12)
├── marko-async@2.2.2 (raptor-dust@1.1.12, raptor-async@1.1.3)
├── htmlparser2@3.9.1 (domelementtype@1.3.0, inherits@2.0.1, entities@1.1.1, domhandler@2.3.0, domutils@1.5.1, readable-stream@2.1.4)
├── sax@0.6.1
├── raptor-modules@1.3.2 (app-root-dir@1.0.2, through@2.3.8, raptor-async@1.1.3)
└── jsonminify@0.2.3

request-promise@2.0.1 node_modules\request-promise
├── bluebird@2.10.2
├── request@2.74.0 (is-typedarray@1.0.0, aws-sign2@0.6.0, oauth-sign@0.8.2, forever-agent@0.6.1, tunnel-agent@0.4.3, caseless@0.11.0, stringstream@0.0.5, isstream@0.1.2, json-stringify-safe@5.0.1, extend@3.0.0, aws4@1.4.1, combined-stream@1.0.5, node-uuid@1.4.7, qs@6.2.1, mime-types@2.1.11, tough-cookie@2.3.1, form-data@1.0.0-rc4, bl@1.1.2, har-validator@2.0.6, http-signature@1.1.1, hawk@3.1.3)
└── lodash@4.14.0

eth-lightwallet@0.1.0 node_modules\eth-lightwallet
├── rlp@1.1.2
├── bignumber.js@2.0.7
├── elliptic@3.1.0 (brorand@1.0.5, inherits@2.0.1, hash.js@1.0.3, bn.js@2.2.0)
├── bitcore-mnemonic@0.13.2 (unorm@1.4.1)
├── crypto-js@3.1.6
├── web3@0.13.0 (utf8@2.1.1, xmlhttprequest@1.8.0)
├── ethereumjs-tx@0.6.7 (browserify-sha3@0.0.2, ethereum-common@0.0.10, secp256k1-browserify@0.0.0, ethereumjs-util@2.0.3)
└── bitcore@0.13.5 (inherits@2.0.1, buffer-compare@1.0.0, bs58@2.0.0, hash.js@1.0.2, sha512@0.0.1, bn.js@2.0.4, elliptic@3.0.3, lodash@3.10.1)

bower@1.7.9 node_modules\bower

 

Key をジェネレートします。
なんかエラーでたのですが、今回は特に気にしません。

D:\solidity_20160728\testapp>bloc genkey
prompt: Enter a high entropy password. You will need this to sign transactions.:
wrote app\users\admin\89d90496e3f64dffe1f17f66bd52c06cbc9ecc9b.json
Unhandled rejection Error: faucet: HTTPQuery: undefined is not a function
    at Object.ensureErrorObject (C:\Users\吾郷由知\AppData\Roaming\npm\node_modules\blockapps-bloc\node_modules\bluebird\js\main\util.js:261:20)
    at Promise._rejectCallback (C:\Users\吾郷由知\AppData\Roaming\npm\node_modules\blockapps-bloc\node_modules\bluebird\js\main\promise.js:469:22)
    at Promise._settlePromiseFromHandler (C:\Users\吾郷由知\AppData\Roaming\npm\node_modules\blockapps-bloc\node_modules\bluebird\js\main\promise.js:513:17)
    at Promise._settlePromiseAt (C:\Users\吾郷由知\AppData\Roaming\npm\node_modules\blockapps-bloc\node_modules\bluebird\js\main\promise.js:581:18)
    at Promise._settlePromises (C:\Users\吾郷由知\AppData\Roaming\npm\node_modules\blockapps-bloc\node_modules\bluebird\js\main\promise.js:697:14)
    at Async._drainQueue (C:\Users\吾郷由知\AppData\Roaming\npm\node_modules\blockapps-bloc\node_modules\bluebird\js\main\async.js:123:16)
    at Async._drainQueues (C:\Users\吾郷由知\AppData\Roaming\npm\node_modules\blockapps-bloc\node_modules\bluebird\js\main\async.js:133:10)
    at Immediate.Async.drainQueues [as _onImmediate] (C:\Users\吾郷由知\AppData\Roaming\npm\node_modules\blockapps-bloc\node_modules\bluebird\js\main\async.js:15:14)
    at processImmediate [as _immediateCallback] (timers.js:358:17)
    ...waiting for transaction to be mined
    ...waiting for transaction to be mined
    ...waiting for transaction to be mined
    ...waiting for transaction to be mined
    ...waiting for transaction to be mined
    ...waiting for transaction to be mined
    ...waiting for transaction to be mined
    ...waiting for transaction to be mined
    ...waiting for transaction to be mined
    ...waiting for transaction to be mined
    ...waiting for transaction to be mined
    ...waiting for transaction to be mined
^Cバッチ ジョブを終了しますか (Y/N)? Y

 

んじゃー。ローカルで動かしましょー。
URL が腐ってますけど、気にしませんw。

D:\solidity_20160728\testapp>bloc start
bloc is listening on http://0.0.0.0:8000

api is pointed to http://strato-dev4.blockapps.net with profile strato-dev

 

 

これで、ローカルにデプロイする環境ができた(はず)なので、build して Deploy しちゃいましょー。
今回は、「Payout.sol」を選択し、「Compile Smart Contract」を選びます。

 

んで、「Deploy Smart Contract」を実行して、でぷろーい!!

 

なんか、動きました。

 


 

ブロックチェーンは、分散元帳として利用できることから、今後、いろんな形で応用して利用できるんじゃないかなって思ってます。
今回は、そのさわり部分の開発環境の準備的な部分を書きました。

今後もう少し深堀して行きたいと思っています。

-Viual Studio
-,