【开发记录cmusic(1)】项目建立和model建立

建项目

首先建项目,将model写好(model设计参考数据库设计)。

cielo@cielo-ThinkPad-E550:~/cprogrames$ yo hyperledger-composer

     _-----_     
    |       |    ╭──────────────────────────────────────────╮
    |--(o)--|    │ Update available: 2.0.6 (current: 2.0.5)`---------´   │     Run npm install -g yo to update.     │
    ( _´U`_ )    ╰──────────────────────────────────────────╯
    /___A___\   /
     |  ~  |     
   __'.___.'__   
 ´   `  |° ´ Y ` 

Welcome to the Hyperledger Composer project generator
? Please select the type of project: Business Network
You can run this generator using: 'yo hyperledger-composer:businessnetwork'
Welcome to the business network generator
? Business network name: cmusic
? Description: music first
? Author name:  cielo
? Author email: cielo0@qq.com
? License: Apache-2.0
? Namespace: org.cm.music
? Do you want to generate an empty template network? Yes: generate an empty template network
   create package.json
   create README.md
   create models/org.cm.music.cto
   create permissions.acl
   create .eslintrc.yml
cielo@cielo-ThinkPad-E550:~/cprogrames$ cd cmusic
cielo@cielo-ThinkPad-E550:~/cprogrames/cmusic$ mkdir dist

按照数据库的设计写model

然后写model。
音乐版权交易。
这边写了model之后去playground测试一下能够找到很多问题的。

步骤一:生成bna文件

cielo@cielo-ThinkPad-E550:~$ cd cprogrames
cielo@cielo-ThinkPad-E550:~/cprogrames$ cd cmusic
cielo@cielo-ThinkPad-E550:~/cprogrames/cmusic$ cd distcielo@cielo-ThinkPad-E550:~/cprogrames/cmusic/dist$ composer archive create  --sourceType dir --sourceName ../
Creating Business Network Archive


Looking for package.json of Business Network Definition
        Input directory: ../

Found:
        Description: music first
        Name: cmusic
        Identifier: cmusic@0.0.1

Written Business Network Definition Archive file to 
        Output file: cmusic@0.0.1.bna

Command succeeded

步骤二:在playground中导入

这上面一行是需要card的。有card才能链接。下面那行不用。就是web测试的。
在这里插入图片描述

就是这里,点生成一个。其他的之前有讲过,随便取个名字然后上传bna文件。

在这里插入图片描述
刚进去的时候是admin,它什么权限都有,在admin下面测试一下每个asset生成的时候的参数是可以的,但是如果要测试participant的access control,需要生成一个新的participant后点击右上角,给这个participant issue一下。然后切换到这个新的participant看看他的访问控制做的对不对。还可以测试一下正则表达式什么的。
我通过这种方法发现了不对的地方。然后应该可以写后面的代码了吧。
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值