Skip to content

Commit

Permalink
实现一键部署
Browse files Browse the repository at this point in the history
  • Loading branch information
zoujh committed Apr 26, 2021
1 parent 31ad7f3 commit 6bc227b
Show file tree
Hide file tree
Showing 2,483 changed files with 2,825 additions and 742,677 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.vscode
.idea
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM golang:1.14

ENV GO111MODULE=on
ENV GOPROXY=https://goproxy.cn,direct

RUN mkdir -p /root/blockchain-real-estate
RUN apt update \
&& apt-get -y install nodejs npm

COPY application /root/blockchain-real-estate/application
COPY deploy/crypto-config /root/blockchain-real-estate/crypto-config

WORKDIR /root/blockchain-real-estate/application/vue
RUN npm config set registry "https://registry.npm.taobao.org/" \
&& npm i node-sass --sass_binary_site="https://npm.taobao.org/mirrors/node-sass/" \
&& npm install
RUN npm run build:prod
RUN mv ./dist ../

WORKDIR /root/blockchain-real-estate/application
RUN go build -o "app" .

EXPOSE 8000
ENTRYPOINT ["./app"]
14 changes: 4 additions & 10 deletions application/blockchain/sdk.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
/**
* @Author: 夜央 Oh oh oh oh oh oh (https://github.com/togettoyou)
* @Email: [email protected]
* @Date: 2020/3/4 4:21 下午
* @Description: fabric-sdk-go的封装
*/
package blockchain

import (
Expand All @@ -19,10 +13,10 @@ var (
ChainCodeName = "blockchain-real-estate" // 链码名称
Org = "org1" // 组织名称
User = "Admin" // 用户
ConfigPath = "blockchain/config.yaml" // 配置文件路径
ConfigPath = "conf/config.yaml" // 配置文件路径
)

// 初始化
// Init 初始化
func Init() {
var err error
// 通过配置文件初始化SDK
Expand All @@ -32,7 +26,7 @@ func Init() {
}
}

// 区块链交互
// ChannelExecute 区块链交互
func ChannelExecute(fcn string, args [][]byte) (channel.Response, error) {
// 创建客户端,表明在通道的身份
ctx := SDK.ChannelContext(ChannelName, fabsdk.WithOrg(Org), fabsdk.WithUser(User))
Expand All @@ -53,7 +47,7 @@ func ChannelExecute(fcn string, args [][]byte) (channel.Response, error) {
return resp, nil
}

// 区块链查询
// ChannelQuery 区块链查询
func ChannelQuery(fcn string, args [][]byte) (channel.Response, error) {
// 创建客户端,表明在通道的身份
ctx := SDK.ChannelContext(ChannelName, fabsdk.WithOrg(Org), fabsdk.WithUser(User))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ client:

# MSP证书的根路径
cryptoconfig:
path: ${GOPATH}/src/github.com/togettoyou/blockchain-real-estate/deploy/crypto-config
path: /blockchain-real-estate/crypto-config

# 默认即可,以下都是可选(optional)的配置
credentialStore:
Expand Down Expand Up @@ -71,7 +71,7 @@ organizations:
mspid: Org1MSP

# 这个组织的MSP证书路径
cryptoPath: peerOrganizations/org1.blockchainrealestate.com/users/{username}@org1.blockchainrealestate.com/msp
cryptoPath: peerOrganizations/org1.blockchainrealestate.com/users/{username}@org1.blockchainrealestate.com/msp

# 这个组织下属的节点
peers:
Expand Down
1 change: 0 additions & 1 deletion application/dist/index.html

This file was deleted.

1 change: 0 additions & 1 deletion application/dist/static/css/app.f42c865f.css

This file was deleted.

1 change: 0 additions & 1 deletion application/dist/static/css/chunk-1352d423.6b0e4613.css

This file was deleted.

1 change: 0 additions & 1 deletion application/dist/static/css/chunk-4c8124f6.9b8ba4c7.css

This file was deleted.

1 change: 0 additions & 1 deletion application/dist/static/css/chunk-573f6888.b282e82c.css

This file was deleted.

Loading

0 comments on commit 6bc227b

Please sign in to comment.