NOTE: This DApp has been tested on Ubuntu 18.04 and on Windows 10 with WSL and Golang 1.18 was used.
👀 CodeReviewComments 👀
Param | Description | default value |
---|---|---|
APIDocIP | IP to expose the api (unused) | 127.0.0.1 |
DappPort | app PORT | 7001 |
CronEnabled | active the cron job | true |
EveryTime | time interval (in seconds) that the cron task is executed | 300 seconds (every 5 minutes) |
Download the github.template-fabric.dapp-go project and move to root of project:
git clone https://github.com/ic-matcom/academic_certificate.dapp-go.git && cd academic_certificate.dapp-go
Run:
go mod download
go mod vendor
If you make changes to the Endpoint you must generate Swagger API Spec:
Build:
go build -o dapp
The environment variable is exported with the location of the server configuration file.
If you have 🐧Linux or 🍎Dash, run:
source ./setenv.sh
but if it's the windows cmd, run:
source ./setenv.cmd
Dapp config file:
cp conf/conf.sample.unix.yaml conf/conf.yaml
Network profile:
cp conf/cpp.sample.unix.yaml conf/cpp.yaml
Modify the crypto-config paths in conf/cpp.yaml file, in our case it is /home/user/fabric-folder/fabric-testnet-nano-without-syschannel
Before it is recommended that you read more about the server configuration file in the section 👉🏾 .
Run the server:
./dapp
and visit the swagger docs:
You can then authenticate and test the remaining endpoints.
Run:
go test -v
This project has 3 layer :
- Controller Layer (Presentation)
- Service Layer (Business)
- Repository Layer (Persistence)
Tag | Path | Layer |
---|---|---|
Auth | end_auth.go | Controller |
Dapp | end_dapp.go | Controller |
Auth | svc_authentication.go | Service |
Dapp | svc_dapp.go | Service |
Dapp | repo_dapp.go | Repository |