Git Product home page Git Product logo

Comments (6)

shohu avatar shohu commented on August 29, 2024

以下2案で迷った結果、SSRで試してみる。たぶんプロトタイプには向いてるはず、何かと。

案1. SSR

スクリーンショット 2019-06-05 9 58 32

案2. SPA

スクリーンショット 2019-06-05 10 35 00

  1. ブロックチェーンにアクセスするためのfabric-api サーバーを作成する
  2. 1のapiサーバーをreactで呼び出す

from estate-sample.

shohu avatar shohu commented on August 29, 2024

SSRでの進め方

  1. fabric-sampleのcommercial-paperのmagnetcorp構成をコピーしてつくる
  2. applicationの部分をおそらくAdonisJsのプロジェクトに置き換えてしまえばOKな感じか。

一旦、AdonisJsはいれないで、以下のestate, estate owner history, owner を データ登録できるようなscriptを作成してみる。

スクリーンショット 2019-06-05 10 43 25

from estate-sample.

shohu avatar shohu commented on August 29, 2024

commercial-paperのmagnetcorpをコピーして一旦動かす

issue.js までやってみる。

base network

$ cd basic-network/
$ ./start.sh

monitor起動

以下はずっと起動しっぱなしになる。

$ cd estate/configuration/cli/
$ ./monitordocker.sh net_basic

fabric-toolsの起動

hyperledgerとコミュニケーション取るためのもの

$ cd estate/configuration/cli
$ docker-compose -f docker-compose.yml up -d cliMagnetoCorp
Creating cliMagnetoCorp ... done

chaincodeのインストール

peer chaincode install を cliMagnetoCorp で実行する

$ docker exec cliMagnetoCorp peer chaincode install -n papercontract -v 0 -p /opt/gopath/src/github.com/contract -l node
2019-06-05 02:33:58.626 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2019-06-05 02:33:58.627 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2019-06-05 02:33:58.735 UTC [chaincodeCmd] install -> INFO 003 Installed remotely response:<status:200 payload:"OK" >

chaincodeのinstantiate

chaincodeを動かすためのdockerコンテナをたちあげる

スクリーンショット 2019-06-05 11 43 19
peer chaincode instantiate を cliMagnetoCorpで実施する。

docker exec cliMagnetoCorp peer chaincode instantiate -n papercontract -v 0 -l node -c '{"Args":["org.papernet.commercialpaper:instantiate"]}' -C mychannel -P "AND ('Org1MSP.member')"

issue.js 動かす

$ cd estate/application
$ npm install

wallet追加

$ node addToWallet.js
done

issue.js実行

$ node issue.js
Connect to Fabric gateway.
Use network channel: mychannel.
Use org.papernet.commercialpaper smart contract.
Submit commercial paper issue transaction.
Process issue transaction response.
MagnetoCorp commercial paper : 00001 successfully issued for value 5000000
Transaction complete.
Disconnect from Fabric gateway.
Issue program complete.

次は smartcontractを変更して、
estate, estate-owner-history, owner
のデータ定義をして、それぞれを登録するsampleを作成してみる。

from estate-sample.

shohu avatar shohu commented on August 29, 2024

wallet作成について

commercial-paperのwalletは、2つのaddToWallet.js で追加されている。
digibank と magnetcorp それぞれのディレクトリで。
事前にidentifyファイル作成されているのをそのまま使っている。

ただ、これらを使えば2ユーザーのwalletが一旦できる。

from estate-sample.

shohu avatar shohu commented on August 29, 2024

commercial-paperのスマコン解説
https://hyperledger-fabric.readthedocs.io/en/latest/developapps/smartcontract.html?highlight=createCompositeKey

from estate-sample.

shohu avatar shohu commented on August 29, 2024

以下のblockchain部分を1つのスキーマにする。

スクリーンショット 2019-06-06 10 34 30

イメージは以下

key: "EST-XXXXX"
{
  name: "test property 1",
  category: "hotel",
  price: 10,000,000 YEN,
  partisionsNumber: 100,
  devideTerm: 6,
  histories [{
    usercode: 12,
    amount: 10000,
    purchasedAt: "2018-01-01"
  },
  {
    usercode: 15,
    amount: 2000,
    purchasedAt: "2018-01-01"
  }]
}

from estate-sample.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.