Skip to content

Commit

Permalink
Push version v1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
snaik committed Jun 16, 2019
1 parent 6454c8a commit 02173d5
Show file tree
Hide file tree
Showing 40 changed files with 163 additions and 4,321 deletions.
4 changes: 4 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 61 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))

GOMODCORE := $(GOMODBASE)/zcncore
VERSION_FILE := $(ROOT_DIR)/core/version/version.go
MAJOR_VERSION := "1.0"

PLATFORMOS := $(shell uname | tr "[:upper:]" "[:lower:]")

include _util/printer.mk
include _util/herumi.mk

.PHONY: install-all herumi-all gosdk-all show

default: help show

#GO BUILD SDK
gomod-download:
go mod download -json

gomod-clean:
go clean --modcache

gosdk-clean:
go clean -i -r -x -modcache ./...

gosdk-build: gomod-download
go build -x -v -tags bn256 ./...

gosdk-test:
go test -tags bn256 ./...

gosdk-all: | gosdk-build gosdk-test

getrev:
$(eval VERSION_STR=$(MAJOR_VERSION).$(shell git rev-list --count HEAD))
$(eval VERSION_STR=$(VERSION_STR)-$(shell git describe --tags --dirty --always))
@echo "" > $(VERSION_FILE)
@echo "//====== THIS IS AUTOGENERATED FILE. DO NOT MODIFY ========" >> $(VERSION_FILE)
@echo "" >> $(VERSION_FILE)
@echo "package version" >> $(VERSION_FILE)
@echo const VERSIONSTR = \"$(VERSION_STR)\" >> $(VERSION_FILE)
@echo "" >> $(VERSION_FILE)

install-all: herumi-all gosdk-all

clean:
@rm -rf $(OUTDIR)

show:
@echo "GOPATH=$(GOPATH)"
@echo "GOROOT=$(GOROOT)"
@echo "BLS git branch=$(bls_branch)"
@echo "MCL git branch=$(mcl_branch)"

help:
@echo "Supported commands:"
@ecgo "\tmake show - Display environment and make variables"
@echo "\tmake install-all - Install all build and project dependencies"
@echo "\tmake gosdk-all - Install GO modules and packages"
@echo "\tmake herumi-all - Download, build and install HERUMI packages"
@echo "\tmake clean - Deletes all the built output files"
72 changes: 72 additions & 0 deletions _util/herumi.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
HERUMI_TARGETS:=herumi-clone herumi-checkout herumi-build herumi-install show

#Master having build issues
#$(HERUMI_TARGETS): mcl_branch=master
#$(HERUMI_TARGETS): bls_branch=master

#Success Branch:
$(HERUMI_TARGETS): bls_branch?=b1733a744a2e53a828806b121c4a5cb681c5f94b
$(HERUMI_TARGETS): mcl_branch?=master

HERUMI_DIR?=$(ROOT_DIR)/_herumi
BLS_DIR?=$(HERUMI_DIR)/bls
MCL_DIR?=$(HERUMI_DIR)/mcl
NPROC:=8

herumi-deps: openssl-install gmp-install

openssl-install:
@echo "Installing openssl ..."
brew install openssl
$(shell sudo ln -sf /usr/local/opt/openssl/lib/libcrypto.dylib /usr/local/lib/)

openssl-upgrade:
@echo "Upgrading openssl ..."
brew upgrade openssl
$(shell sudo ln -sf /usr/local/opt/openssl/lib/libcrypto.dylib /usr/local/lib/)

gmp-install:
@echo "Installing gmp ..."
brew install gmp
$(shell sudo ln -sf /usr/local/Cellar/gmp/*/lib /usr/local/lib)

gmp-upgrade:
@echo "Upgrading gmp ..."
brew upgrade gmp
$(shell sudo ln -sf /usr/local/Cellar/gmp/*/lib /usr/local/lib)

.PHONY: herumi-clone herumi-build herumi-install

herumi-clone:
@echo Deleting directories: [$(BLS_DIR) $(MCL_DIR)]
@rm -rf $(BLS_DIR) $(MCL_DIR)
git clone http://github.com/herumi/mcl.git $(MCL_DIR)
git clone http://github.com/herumi/bls.git $(BLS_DIR)

herumi-checkout:
@echo Checking out BLS: branch=$(bls_branch)
cd $(BLS_DIR); git checkout $(bls_branch)
@echo Checking out MCL: branch=$(mcl_branch)
cd $(MCL_DIR); git checkout $(mcl_branch)

herumi-build:
@$(PRINT_MAG)
@echo "Building BLS: branch=$(bls_branch)"
@$(PRINT_NON)
$(MAKE) -C $(BLS_DIR) -j $(NPROC) lib/libbls256.a
@$(PRINT_MAG)
@echo "Building MCL: branch=$(mcl_branch)"
@$(PRINT_NON)
$(MAKE) -C $(MCL_DIR) -j $(NPROC) lib/libmclbn256.a

herumi-install:
@$(PRINT_MAG)
@echo "Installing BLS: branch=$(bls_branch)"
@$(PRINT_NON)
@sudo $(MAKE) -C $(MCL_DIR) install
@$(PRINT_MAG)
@echo "Installing BLS: branch=$(bls_branch)"
@$(PRINT_NON)
@sudo $(MAKE) -C $(BLS_DIR) install

herumi-all: | herumi-clone herumi-checkout herumi-deps herumi-build herumi-install
14 changes: 14 additions & 0 deletions _util/printer.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
COL_RED := "\033[1;31m"
COL_GRN := "\033[1;32m"
COL_YEL := "\033[1;33m"
COL_BLU := "\033[1;34m"
COL_MAG := "\033[1;35m"
COL_CYN := "\033[1;36m"
COL_NON := "\033[0m"
PRINT_RED := printf $(COL_RED)
PRINT_GRN := printf $(COL_GRN)
PRINT_YEL := printf $(COL_YEL)
PRINT_BLU := printf $(COL_BLU)
PRINT_MAG := printf $(COL_MAG)
PRINT_CYN := printf $(COL_CYN)
PRINT_NON := printf $(COL_NON)
62 changes: 0 additions & 62 deletions core/encryption/encryption_test.go

This file was deleted.

8 changes: 4 additions & 4 deletions core/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,25 +85,25 @@ func (l *Logger) SetLogFile(logFile io.Writer, verbose bool) {

func (l *Logger) Debug(v ...interface{}) {
if l.lvl >= DEBUG {
l.logDebug.Output(2, fmt.Sprint(v))
// l.logDebug.Output(2, fmt.Sprint(v...))
}
}

func (l *Logger) Info(v ...interface{}) {
if l.lvl >= INFO {
l.logInfo.Output(2, fmt.Sprint(v))
l.logInfo.Output(2, fmt.Sprint(v...))
}
}

func (l *Logger) Error(v ...interface{}) {
if l.lvl >= ERROR {
l.logError.Output(2, fmt.Sprint(v)+cReset)
l.logError.Output(2, fmt.Sprint(v...)+cReset)
}
}

func (l *Logger) Fatal(v ...interface{}) {
if l.lvl >= FATAL {
l.logFatal.Output(2, fmt.Sprint(v)+cReset)
l.logFatal.Output(2, fmt.Sprint(v...)+cReset)
}
}

Expand Down
3 changes: 2 additions & 1 deletion core/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
//====== THIS IS AUTOGENERATED FILE. DO NOT MODIFY ========

package version
const VERSIONSTR = "1.0.134-v1.0.1-dirty"
const VERSIONSTR = "1.0.3"


62 changes: 0 additions & 62 deletions encryption/encryption_test.go

This file was deleted.

60 changes: 0 additions & 60 deletions encryption/hash.go

This file was deleted.

Loading

0 comments on commit 02173d5

Please sign in to comment.