# Hello Plugin **Repository Path**: luyu-community/hello-plugin ## Basic Information - **Project Name**: Hello Plugin - **Description**: 插件Demo - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 3 - **Created**: 2021-04-13 - **Last Updated**: 2023-03-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ![](https://gitee.com/luyu-community/luyu-cross-chain-protocol/raw/master/doc/img/logo_nor.svg) # 陆羽跨链协议 区块链插件Demo 请配合[《 开发区块链插件》](https://gitee.com/luyu-community/luyu-cross-chain-protocol/blob/master/doc/develop.md#%E5%BC%80%E5%8F%91%E5%8C%BA%E5%9D%97%E9%93%BE%E6%8F%92%E4%BB%B6)指导学习如何实现区块链插件。 **原理** 本项目给出了完整的区块链插件Demo,编译出的插件可直接放入router下作为真实的插件使用,插件内集成了一条demo区块链,会不断部署资源。通过router日志可查看不断部署的资源。 **编译** ``` bash bash gradlew assemble ``` 在`dist/apps`下生成插件 ``` bash hello-plugin1-1.0.0.jar ``` **配置** 将插件放入`router`的`plugin`目录 ``` bash cp dist/apps/hello-plugin1-1.0.0.jar xxxxx/routers/127.0.0.1-8250-25500/ ``` 生成链配置目录 ``` bash cd xxxxx/routers/127.0.0.1-8250-25500/conf/chains # cd 到路由的链配置目录 mkdir hello # 指定链名字为hello cd hello ``` 生成三个文件: 1. plugin.toml ``` toml [common] name = 'hello' # 与链名一致,即所属的目录名,当前为:hello type = 'Hello1.0' # 本插件名,让路由加载本链时用本插件 ``` 2. driver.toml ``` toml # 空文件 ``` 3. connection.toml ``` toml # 空文件 ``` 三个文件在hello目录下: ``` bash . ├── connection.toml ├── driver.toml └── plugin.toml ``` **启动** ``` bash cd xxxxx/routers/127.0.0.1-8250-25500/ # cd 到路由的根目录 bash start.sh ``` **查看日志** ``` bash tail -f logs/info.log |grep "active resources" ``` 每隔一段时间会刷出一行(插件内会不断模拟进行资源的部署,资源数量不断增加) ``` Current active resources: payment.hello.contract-1636974062339, payment.hello.contract-1636974095558 ``` **停止** ``` bash stop.sh # 停止路由 # 删除已部署的hello链(若需要) rm -rf conf/chains/hello ``` ## License 开源协议为Apache License 2.0,详情参考[LICENSE](./LICENSE)。