Skip to content

Commit

Permalink
Merge Candidate v0.0.5 (#1146)
Browse files Browse the repository at this point in the history
* fix (#906)

return correct error on GetDocument

* fix vet and lint issues (#880)

Fixes the issue from GoreportCard

* take password interactively (#916)

* create new document with embedded Access Token, add test coverage for CoreDocument (#915)

* method

* added some tests

* Adding attributes to models (#901)

* Adding attributes to models

* Partially test

* LGTM

* Review comments

* Upgrade libp2p (#922)

* WIP: Upgrade libp2p

* WIP: Upgrade libp2p

* dep

* protobuf for entity relationship (#919)

* protobuf for entity relations

* better comments

* better naming

* fmt

* new entity handler response

* fmt

* fmt

* fixed entityrelationship model

* formatting

* swagger update

* Remove certs (#928)

Closes #909 

Changes:
- Removed the certificates
- GRPC server will be run on a different port and `127.0.0.1`
- API host is `127.0.0.1` by default but can be changed through `createconfig`

* removing manage ids (#930)

* create file with 600 permission (#931)

Closes #908

* Allow setting Ethereum max gas price (#932)

* Allow setting Ethereum max gas price

* Fix lint

* Review comment and minor

* Entity Relationship Create (Share) service (#905)

* new files

* wip

* added protos

* model

* spacing

* tests

* fix

* fix

* fix

* initial commit

* rm label

* initial

* fix

* wip

* fix

* wip

* wip

* wip

* wip

* fix

* swagger

* test

* spacing

* entity: GET method (#934)

* entity GET method

* moved isCollaborator to coredocument

* Add multiple gas limits (#937)

* dont return error for gas price breach

* Different gas limits for different ops

* Different gas limits for different ops

* Fix tests

* test fix

* cache the keys instead of the opts

* use context.backGround for now

* Revert txopts cache and review comments

* ignore .DS_Store

* Remove config endpoint (#939)

* dont return error for gas price breach

* Different gas limits for different ops

* Different gas limits for different ops

* Fix tests

* test fix

* cache the keys instead of the opts

* use context.backGround for now

* Revert txopts cache and review comments

* ignore .DS_Store

* Remove the unuseful config api

* stuff

* Delete Access Token (#942)

* initial

* entity-relationship: repo + bootstrapper (#938)

* new files

* wip

* added protos

* model

* spacing

* tests

* fix

* fix

* fix

* initial commit

* rm label

* initial

* fix

* wip

* fix

* wip

* wip

* wip

* wip

* fix

* swagger

* test

* spacing

* initial

* added ER repository and bootstrapper

* fmt

* wrapped document.repository

* fix

* spacing

* rm Gopkg.lock

* added request method for document

* fmt

* worker limit + swagger + macos build (#945)

* Fix block not ready in node (#946)

* Fix block no ready in light node

* Fix block no ready in light node

* test

* P2P error masking (#944)

* P2P error masking

* Adjustments

* Adjustments

* Adjustments

* Review comments

* Review comments

* merge

* ethereum key from env (#950)

* updated entity relationship protobuf (#952)

* updated protos

* revert previous commit for bootstrap nodes (#954)

This reverts commit 7f4d726.

* Bts/new (#953)

* ethereum key from env

* New bootstrap peers

* Revert "revert previous commit for bootstrap nodes (#954)" (#955)

This reverts commit 7eca861.

*  Add nft index to api response (#949)

* bindings

* Add nft index to api response

* data

* Latest smart contracts and fixes

* Latest smart contracts and fixes

* Fix tests 1

* Fix testworld

* Review comments

* contracts

* merge

* version change

* Start message for node (#957)

* Remove pb errors

* Add ascii art and messafge

* Fix build

* Disclaimer

* More build fixes

* p2p: getDocumentRequest for entity (#948)

* initial implementation getDocumentRequest

* fixed unit tests

* added todo comments

* added test for p2p

* added granter to entityrelationship

* fixed p2p testworld test

* fixed p2p testworld test with er send/receive

* fmt

* processor bootstrapper no nil check

* fixed p2p testworld test

* fmt

* fmt and selfDID from ctx

* fixed self.DID parameter

* fmt

* fmt

* fmt

* Entity handler: Share and Revoke (#940)

* hex string DB index (#956)

* ethereum key from env

* hex string index

* string trim

* Fix/prefix and develop (#964)

* ethereum key from env

* hex string index

* string trim

* Fix prefix

* Fix prefix

* Fix prefix

* 56bit token ID option (#965)

* Remove unnecessary documentation

* 56bit token ID option

* 56bit token ID option

* 56bit token ID option

* Fix

* Fix

* comment

* add stack traces to error (#963)

Closes #883 

Changes:
- `errors.New` will attach stack trace by default
- Call `errors.StackTrace(err)` to get the stack trace

Note: this will not change the current `error.Error` log behavior. Stack traces should be retrieved and printed explicitly

Example stack trace:
```
github.com/centrifuge/go-centrifuge/errors.TestWithStackTrace
	/Users/vedhavyas/Projects/Go/src/github.com/centrifuge/go-centrifuge/errors/errors_test.go:169
testing.tRunner
	/usr/local/Cellar/go@1.11/1.11.6/libexec/src/testing/testing.go:827
runtime.goexit
	/usr/local/Cellar/go@1.11/1.11.6/libexec/src/runtime/asm_amd64.s:1333
```

* entity: GET EntityWithRelationship  (#961)

* initial implementation getDocumentRequest

* fixed unit tests

* added todo comments

* added test for p2p

* added granter to entityrelationship

* fixed p2p testworld test

* fixed p2p testworld test with er send/receive

* fmt

* processor bootstrapper no nil check

* fixed p2p testworld test

* fmt

* fmt and selfDID from ctx

* fixed self.DID parameter

* fmt

* fmt

* fmt

* added Get Relationship entpoint

* implemented RequestEntityWithRelationship method in service

* validator for received doc

* added testworld test for get entpoint

* added validator after recieving doc from p2p

* fmt

* fmt

* fmt

* fixed lock file

* fixed cmd package

* added swagger

* fixed linting"
"

* return entity from database if it is the latest

* better variable naming

* fmt

* protobuf documentService renamed to entityService

* fixed new protobuf handler name

* fixed entityService naming

* swagger API service naming update (#966)

* Added embarcadero boot nodes (#968)

* Added embarcadero boot nodes

* add embarcadero mainnet

* GET relationship: correct endpoint + db store (#973)

* updated entity service for new get endpoint

* adopted testworld test

* added store to db after received on p2p

* removed boostrapper closure for processor

* fmt

* fmt

* better err handling

* refactor to jobs (#974)

closes #926

* added latestDocumentValidator to PostAnchoredValidator (#967)

* added valdiator

* fmt

* improved latestDocumentValidator with additional error checks

* revert processor test

* fixed processor unit tests

* fixed unit tests

* GetEntityByRelationship uses only latestDocumentValidator

* update swagger (#976)

* Minor things (#977)

* fix p2p return errors (#981)

* fix p2p return errors

* fix p2p return errors

* fix p2p return errors

* entity service unit test for relationship requests (#982)

* added unit test draft

* added setup method for unit tests

* added unit test for entity p2p request

* add mock processor

* added an additional unit test

* Ropsten address (#985)

* Ropsten address

* format

* Testworld coverage for Entity/EntityRelationship (#962)

* Low entropy token ID with 999999999999999 max (#987)

* Low entropy token ID with 999999999999999 max (#987) (#990)

* Cleanup jobs refactor (#994)

Closes #983

* Add a config to enable debug logging (#996)

* Add a config to enable debug logging

* fix test

* set used anchor repo (#998)

* set used anchor repo

* omprove test coverage

* update lock

* New big int type (#999)

* previous review comments

* Added new int256 type

* Review comments and more tests

* more testst

* Validators (#1000)

* update GetAnchorData

* add current version validator

* add version check for signature validator group

* fix tests

* add anchor repo address validator

* fix integration tests

* fix unit tests

* missing test

* review changes

* minor changes

* Custom Attr - Client protobufs (#1010)

* Custom Attr - Client protobufs

* Implement text marshalling/unmarshalling for AttrKey

* Fix conversions

* :|

* Add minimum response time to p2p calls (#1013)

* Add p2p delay

* Add p2p delay

* Add p2p delay

* Attributes: Client API to Model conversion (#1011)

* Custom Attr - Client protobufs

* Implement text marshalling/unmarshalling for AttrKey

* Fix conversions

* :|

* Attributes: Client API to Model conversion (without tests)

* More tests

* add tests


Co-authored-by: Vedhavyas Singareddi <vedhavyas.singareddi@gmail.com>

* Feat/coredo model attrs (#1016)

* Custom Attr - Client protobufs

* Implement text marshalling/unmarshalling for AttrKey

* Fix conversions

* :|

* Attributes: Client API to Model conversion (without tests)

* More tests

* add tests

* add converters

* conversion from coredoc to p2p

* add model functions

* fix tests

* update dep


Co-authored-by: Vimukthi <vimukthi@centrifuge.io>

*  Adjustable p2p delay (#1017)

* Adjustable p2p delay

* remove darwin

* add check

* add test

* Fix init value (#1019)

* fix init value

* fix test

* Enable notification on Job completion (#1020)

* wip

* wip

* job notification

* fix

* gen

* tests

* tests

* tests

* update proto

* add attribute testworld tests cases (#1021)

* add tests cases

* add test case for int256

* move the marshall logic to core doc

* revert to previous marshall

* move both marshal and unmarshal to coredoc

* fix linting

* funding: create + get (#1015)

* create funding protobuf

* created protobuf

* added PrepareNewVersionWithExistingData to model

* fmt

* fmt

* added new prepareVersion method to other model implementations

* added support for creating attribute keys

* added get values from struct

* fmt

* err handlingi

* added attribute idx

* fmt

* fmt

* fmt

* fmt

* fmt

* swagger

* added GET protobuf definition

* added fundingData struct

* added index as int256

* create response from model

* added get method in handler

* added type from tag

* fmt

* better iteration in finding

* fmt

* refactored: labelToJSON

* added days as integer

* fmt

* fmt

* better method names

* lint exclude uppercase

* only add attributes if not empty

* fixed protobuf

* protobuf created and fmt

* fmt

* whitespaces

* added int256 checks

* feat: funding GET list (#1024)

* create funding protobuf

* created protobuf

* added PrepareNewVersionWithExistingData to model

* fmt

* fmt

* added new prepareVersion method to other model implementations

* added support for creating attribute keys

* added get values from struct

* fmt

* err handlingi

* added attribute idx

* fmt

* fmt

* fmt

* fmt

* fmt

* swagger

* added GET protobuf definition

* added fundingData struct

* added index as int256

* create response from model

* added get method in handler

* added type from tag

* fmt

* better iteration in finding

* fmt

* refactored: labelToJSON

* added days as integer

* fmt

* fmt

* better method names

* lint exclude uppercase

* only add attributes if not empty

* fixed protobuf

* created protobuf for list

* added serive method for GET list

* fmt

* fmt

* better errors

* improved code readablity

* fmt

* added swagger

* changed funding urls

* swagger

* Feat/signed attrs (#1023)

* add signed attr

* add convertor

* refactor service name and add validator

* add signature validation

* add to validator group

* update dep to origin

* Feat/funding aggrement handler (#1029)

* register handler

* return signer identity for signed type

* feat: funding getVersion and getListVersion (#1026)

* create funding protobuf

* created protobuf

* added PrepareNewVersionWithExistingData to model

* fmt

* fmt

* added new prepareVersion method to other model implementations

* added support for creating attribute keys

* added get values from struct

* fmt

* err handlingi

* added attribute idx

* fmt

* fmt

* fmt

* fmt

* fmt

* swagger

* added GET protobuf definition

* added fundingData struct

* added index as int256

* create response from model

* added get method in handler

* added type from tag

* fmt

* better iteration in finding

* fmt

* refactored: labelToJSON

* added days as integer

* fmt

* fmt

* better method names

* lint exclude uppercase

* only add attributes if not empty

* fixed protobuf

* created protobuf for list

* added serive method for GET list

* fmt

* fmt

* better errors

* protobuf get version

* improved code readablity

* fmt

* added get version

* fmt

* added swagger

* swagger

* fmt

* changed funding urls

* swagger

* fmt

* better errors

* fmt

* feat: funding update (#1027)

* create funding protobuf

* created protobuf

* added PrepareNewVersionWithExistingData to model

* fmt

* fmt

* added new prepareVersion method to other model implementations

* added support for creating attribute keys

* added get values from struct

* fmt

* err handlingi

* added attribute idx

* fmt

* fmt

* fmt

* fmt

* fmt

* swagger

* added GET protobuf definition

* added fundingData struct

* added index as int256

* create response from model

* added get method in handler

* added type from tag

* fmt

* better iteration in finding

* fmt

* refactored: labelToJSON

* added days as integer

* fmt

* fmt

* better method names

* lint exclude uppercase

* only add attributes if not empty

* fixed protobuf

* created protobuf for list

* added serive method for GET list

* fmt

* fmt

* better errors

* protobuf get version

* improved code readablity

* fmt

* added get version

* fmt

* added swagger

* swagger

* fmt

* protobuf added for update

* changed funding urls

* swagger

* fmt

* better errors

* added update funcs to service

* added update tests

* fmt

* handler unit test

* fmt

* fmt

* refactoring fill attributes

* better comments

* protobufs update

* use next_version (#1033)

* Fix/enable fields (#1034)

* use next+_version

* enable disabled fields

* Remove txpool access (#1036)

* Remove txpool access

* review comments

* feat: funding sign service + handler (#1032)

* create funding protobuf

* created protobuf

* added PrepareNewVersionWithExistingData to model

* fmt

* fmt

* added new prepareVersion method to other model implementations

* added support for creating attribute keys

* added get values from struct

* fmt

* err handlingi

* added attribute idx

* fmt

* fmt

* fmt

* fmt

* fmt

* swagger

* added GET protobuf definition

* added fundingData struct

* added index as int256

* create response from model

* added get method in handler

* added type from tag

* fmt

* better iteration in finding

* fmt

* refactored: labelToJSON

* added days as integer

* fmt

* fmt

* better method names

* lint exclude uppercase

* only add attributes if not empty

* fixed protobuf

* created protobuf for list

* added serive method for GET list

* fmt

* fmt

* better errors

* protobuf get version

* improved code readablity

* fmt

* added get version

* fmt

* added swagger

* swagger

* fmt

* protobuf added for update

* changed funding urls

* swagger

* fmt

* better errors

* added update funcs to service

* added update tests

* fmt

* handler unit test

* fmt

* fmt

* refactoring fill attributes

* better comments

* create sign endpoint

* refactored getLatestIndex

* protobufs update

* added Sign method to Service

* added createSignAttrs method

* unit tests for sign

* improved tests

* unit tests for sign handler method

* fmt

* fmt

* swagger

* fmt

* fmt

* fmt

* Readme file updated with go installation prerequisites.  (#1045)

* Readme file added with go prerequisite

* updated readme file with go installation commands

* feat: GET Signatures + testworld tests (#1041)

* create funding protobuf

* created protobuf

* added PrepareNewVersionWithExistingData to model

* fmt

* fmt

* added new prepareVersion method to other model implementations

* added support for creating attribute keys

* added get values from struct

* fmt

* err handlingi

* added attribute idx

* fmt

* fmt

* fmt

* fmt

* fmt

* swagger

* added GET protobuf definition

* added fundingData struct

* added index as int256

* create response from model

* added get method in handler

* added type from tag

* fmt

* better iteration in finding

* fmt

* refactored: labelToJSON

* added days as integer

* fmt

* fmt

* better method names

* lint exclude uppercase

* only add attributes if not empty

* fixed protobuf

* created protobuf for list

* added serive method for GET list

* fmt

* fmt

* better errors

* protobuf get version

* improved code readablity

* fmt

* added get version

* fmt

* added swagger

* swagger

* fmt

* protobuf added for update

* changed funding urls

* swagger

* fmt

* better errors

* added update funcs to service

* added update tests

* fmt

* handler unit test

* fmt

* fmt

* refactoring fill attributes

* better comments

* create sign endpoint

* refactored getLatestIndex

* protobufs update

* added Sign method to Service

* added createSignAttrs method

* unit tests for sign

* improved tests

* unit tests for sign handler method

* fmt

* added derive signatures

* split signature service methods

* fmt

* swagger

* added unit test

* added signatures to list return

* fixed tests for signature list

* fixed tests for signature list

* added verify method to account

* added signature verify

* added unit test for sign verify

* fmt

* better error handling

* fmt

* fmt

* removed account method

* swagger

* fmt

* fmt

* validate only value

* fmt

* fmt

* fmt

* fmt

* private attr payload msg

* fmt

* fmt

* added collaborators to addAttributes

* better protobuf list naming

* resolved merge conflict

* added basic funding testworld test

* fixed context in handler

* added sign testworld test

* added list testworld test

* fixed update testworld test

* added prepareNewVersion flag to deleteAttribute

* fmt

* fixed add new collaborator

* swagger

* changed funding package to fun

* fixed attribute collaborator pointer

* better error handling

* comments

* fmt

* swagger new version

* changed rest endpoints to documents and fundings

* AddAttributes with document prefix

* added documentPrefix to deleteAttributes

* Webhook bugfix and testworld webhook tests (#1056)

* Webhook bugfix and integration tests

* readem

* Fix test

* Review comments and integration test fix

* Ping API (#1037)

* initial setup

* add tests

* fix testworld

* review comments

* Fix multi account wrong local collaborator bug (#1060)

* Fix multi account wrong local collaborator bug

* fix test

* fix typo (#1063)

* fix typo

* add period

* Feat/inv data (#1059)

* add hex bytes

* add inv data and coversions

* add invoice data type

* add tests

* add data retriever

* fix empty collabs (#1064)

* Fix/swagger tags (#1065)

* add tags

* bump version

* Feat/migration (#1061)

* wip

* Cleanup

* Add tests

* lint + test

* lint + test

* migrate at startup

* gen

* add asset check as test

* comments

* comments

* removed data

* removed jobs

* removed comment

* fix test

* Migrate/keys (#1067)

* wip

* Cleanup

* Add tests

* lint + test

* lint + test

* migrate at startup

* gen

* add asset check as test

* comments

* comments

* removed data

* removed jobs

* removed comment

* fix test

* Add key migration

* comments

* add service functions for Invoice (#1068)

* add service functions

* load json tests

* tests for model functions

* add service tests

* Fix for DHT KValue=20 issue (#1066)

* remove dht dead code and minor fix

* test

* test

* test

* test

* remove FindProvider

* Review comments

* add service methods (#1075)

* add service methods

* add service tests

* add core api service

* typo

* Feat/coreapi handler (#1080)

* add core api handler

* add types test

* review changes

* add middleware tests

* working api

* add test world test

* update tests

* fix testworld

* remove middleware

* add accounts to header rule

* added funder and borrower id (#1084)

* Feat/coreapi update (#1087)

* add update endpoint

* add testworld case

* fix testworld

* feat: nft tokenTransfer and ownerOf support (#1085)

* added protobuf for transfer from

* renamed unpaidInvoice to service in nft package

* added transferFromJob

* added transferFrom service method

* added TokenTransfer handler method

* added mock for transferFrom

* added integration test for nftTransfer

* added fail transactionFrom integration test

* added handler unit tests

* handler unit test

* fmt

* fmt

* clean up

* increased gas for transferFrom

* swagger

* better gaslimit for transferFrom

* added protobuf for ownerOf

* added handler for ownerOf

* fixed handler ownerOf

* added handler test for owner of

* better ownerOf response

* added testworld test for nftTransfer

* added testworld test owner of

* fmt

* change to new nft rest api paths

* fixed spacing

* fmt

*  Incorrect Protocol Messages Testcases #837 (#1083)

* add incorrect node version, incorrect body tests

* remove unnecessary test function in incorrect_proto_test

* use updated peer interface to getPeerID

* removed oskar

* renamed messenger_testworld file

* add linting

* Revert "add linting"
fix linting issue
This reverts commit 8d85b3d.

* linting fix

* remove local account check

* lint fix

* lint fix

* add message over max size test

* lint fix

* add specific assertions

* new mint url (#1090)

* Jobs and Get Document API (#1089)

* add update endpoint

* add testworld case

* fix testworld

* migrate jobs to rest

* migrate jobs to rest

* fix unit tests

* add get and get version

* update swagger

* update testworld tests

* Feat/proofs api (#1095)

* add update endpoint

* add testworld case

* fix testworld

* migrate jobs to rest

* migrate jobs to rest

* fix unit tests

* add get and get version

* update swagger

* update testworld tests

* add proofs endpoints

* add proofs endpoints

* update testworld tests

* better test coverage

* Add PO to generic documents API (#1102)

* add data object

* add required model methods

* enable po for generic apis

* add test world test case

* lint check

* update swagger

* replace url path params with constants

* nft_logs (#1103)

* set range for webhook http status code job log (#1104)

* range for webhook http status code job log
* added test

* Add Entity to CoreAPIs (#1105)

* entity data

* add model methods

* add entity to the core apis

* add converters tests

* add test world cases

* fix testworld

* Feat/nfts api (#1108)

* entity data

* add model methods

* add entity to the core apis

* add converters tests

* add test world cases

* fix testworld

* migrate min nft

* migrate transfer nft

* migrate owner nft

* fix unit tests

* fix test world

* fix nft tests

* fix unit and tes world tests

* add accounts sign api (#1114)

* Byzantine fault behaviour tests 1 #876 (#1077)

* add Byzantine test

* add client signature verification

* adjust unit test according changed function signature

* adjust unit test

* adjust unit test

* goimports

* fix signing root calculating

* adjust server_testworld test

* Adjust TestHost_RevokedSigningKey

* add another two signature test

* adjust TestHost_RevokedSigningKey

* no content, force a CI build, it is ok on my site

* add print information for debugging

* change according to comments

* adjust format

* increase timeout limit to 30 min

* Feat/api versionning (#1117)

* version accounts

* funding service apis

* invoices and nft

* pos

* Byzantine fault behaviour tests 1 #876 (#1077)

* add Byzantine test

* add client signature verification

* adjust unit test according changed function signature

* adjust unit test

* adjust unit test

* goimports

* fix signing root calculating

* adjust server_testworld test

* Adjust TestHost_RevokedSigningKey

* add another two signature test

* adjust TestHost_RevokedSigningKey

* no content, force a CI build, it is ok on my site

* add print information for debugging

* change according to comments

* adjust format

* increase timeout limit to 30 min

* fix testworlds

* move collaborators up

* migrate attributes

* fix tests

* api todos

* rename nfts

* fix tests

* update swagger routes

* add debug

* fix tests


Co-authored-by: null <zy_frank@hotmail.com>

* change file permissions (#1123)

* Feat/generic (#1122)

* add generic doc service

* add testworkd tests

* add update to service

* update deps

* change deps

* remove duplicate auth (#1133)

* Fix repo panic (#1139)

* TransferDetails Pt1: Generic attribute util functions, funding related changes (#1135)

* TransferDetails Pt2: TD service, Bootstrapper (#1136)

* TransferDetails Pt3: userAPI/handler (#1140)

* add doc/job prefix (#1141) (#1143)

* add doc/job prefix

* add doc/job prefix
  • Loading branch information
mikiquantum committed Jun 26, 2019
1 parent d851434 commit 489c55b
Show file tree
Hide file tree
Showing 306 changed files with 22,627 additions and 6,019 deletions.
115 changes: 111 additions & 4 deletions Gopkg.lock

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

24 changes: 22 additions & 2 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
# go-tests = true
# unused-packages = true

required = ["github.com/centrifuge/centrifuge-ethereum-contracts", "github.com/roboll/go-vendorinstall", "github.com/golang/protobuf/protoc-gen-go", "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway", "golang.org/x/tools/cmd/goimports"]
required = ["github.com/centrifuge/centrifuge-ethereum-contracts", "github.com/roboll/go-vendorinstall", "github.com/golang/protobuf/protoc-gen-go", "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway", "golang.org/x/tools/cmd/goimports", "github.com/swaggo/swag", "github.com/urfave/cli"]

[[constraint]]
name = "github.com/centrifuge/centrifuge-protobufs"
revision = "ca463c9d7b09f63722524ce3e53f7dee9808f704"
revision = "7d846bc3247e93446882acde5edc23767cb12824"

[[override]]
name = "github.com/centrifuge/centrifuge-ethereum-contracts"
Expand Down Expand Up @@ -304,3 +304,23 @@ required = ["github.com/centrifuge/centrifuge-ethereum-contracts", "github.com/r
[[constraint]]
branch = "master"
name = "github.com/common-nighthawk/go-figure"

[[constraint]]
name = "github.com/go-chi/chi"
version = "4.0.2"

[[constraint]]
name = "github.com/go-chi/render"
version = "1.0.1"

[[constraint]]
name = "github.com/swaggo/swag"
version = "1.5.0"

[[prune.project]]
name = "github.com/swaggo/swag"
unused-packages = false

[[constraint]]
name = "github.com/urfave/cli"
version = "1.20.0"
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ install-deps: ## Install Dependencies
@mv ./bin/* $(GOPATH)/bin/; rm -rf ./bin

lint-check: ## runs linters on go code
@gometalinter --exclude=anchors/service.go --disable-all --enable=golint --enable=goimports --enable=vet --enable=nakedret \
@gometalinter --exclude=anchors/service.go --disable-all --enable=golint --enable=goimports --enable=vet --enable=nakedret \
--enable=staticcheck --vendor --skip=resources --skip=testingutils --skip=protobufs --deadline=1m ./...;

format-go: ## formats go code
Expand All @@ -54,8 +54,12 @@ proto-gen-go: ## generates the go bindings

proto-all: ## runs prototool all
$(PROTOTOOL_BIN) all protobufs
@goimports -w ./protobufs/gen/

gen-swagger: ## generates the swagger documentation
swag init -g ./httpapi/router.go -o ./protobufs/gen/swagger/api
rm -rf ./protobufs/gen/swagger/api/docs.go ./protobufs/gen/swagger/api/swagger.yaml
mv ./protobufs/gen/swagger/api/swagger.json ./protobufs/gen/swagger/api/api.swagger.json
npm --prefix ./build run build_swagger

generate: ## autogenerate go files for config
Expand All @@ -67,6 +71,7 @@ vendorinstall: ## Installs all protobuf dependencies with go-vendorinstall
go-vendorinstall github.com/golang/protobuf/protoc-gen-go
go-vendorinstall github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
go-vendorinstall golang.org/x/tools/cmd/goimports
go-vendorinstall github.com/swaggo/swag/cmd/swag
go get -u github.com/jteeuwen/go-bindata/...

abigen-install: ## Installs ABIGEN from vendor
Expand Down
31 changes: 25 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,26 @@
## Installing pre-requisites
### Linux
```bash
# Install Go

sudo apt-get update
sudo apt-get -y upgrade

#download go using this command
wget https://dl.google.com/go/go1.11.4.linux-amd64.tar.gz

#extract the archive and move it to /usr/local folder
sudo tar -xvf go1.11.4.linux-amd64.tar.gz
sudo mv go /usr/local

#cd to ~/.profile and add the following lines to the end.
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH

# execute this command to use go in the current shell.
source ~/.profile

# install jq
sudo apt-get install jq

Expand Down Expand Up @@ -75,16 +95,15 @@ Make sure you have docker-compose installed, usually comes bundled with Mac OS D

Build & install the Centrifuge OS Node
```bash
cd $GOPATH/src/github.com/centrifuge/go-centrifuge
mkdir -p $GOPATH/src/github.com/centrifuge/go-centrifuge/
cd $GOPATH/src/github.com/centrifuge/
git clone git@github.com:centrifuge/go-centrifuge.git $GOPATH/src/github.com/centrifuge/go-centrifuge
cd go-centrifuge
make install
```
Check whether everything is fine by running tests

## Install
```bash
mkdir -p $GOPATH/src/github.com/centrifuge/go-centrifuge/
git clone git@github.com:centrifuge/go-centrifuge.git $GOPATH/src/github.com/centrifuge/go-centrifuge

# You can already run unit/integration tests
go test --tags="unit" ./...
go test --tags="integration" ./...
```
Expand Down
6 changes: 0 additions & 6 deletions anchors/anchor_repository_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ func TestPreCommitAnchor_Integration(t *testing.T) {
t.Parallel()
anchorID := utils.RandomSlice(32)
signingRoot := utils.RandomSlice(32)

anchorIDTyped, err := anchors.ToAnchorID(anchorID)
assert.NoError(t, err)
preCommitAnchor(t, anchorID, signingRoot)
Expand Down Expand Up @@ -110,11 +109,8 @@ func commitAnchor(t *testing.T, anchorID, documentRoot []byte, documentProof [32

ctx := testingconfig.CreateAccountContext(t, cfg)
done, err := anchorRepo.CommitAnchor(ctx, anchorIDTyped, docRootTyped, documentProof)

isDone := <-done

assert.True(t, isDone, "isDone should be true")

assert.Nil(t, err)
}

Expand All @@ -125,9 +121,7 @@ func preCommitAnchor(t *testing.T, anchorID, documentRoot []byte) {

ctx := testingconfig.CreateAccountContext(t, cfg)
done, err := anchorRepo.PreCommitAnchor(ctx, anchorIDTyped, docRootTyped)

isDone := <-done

assert.True(t, isDone, "isDone should be true")
assert.Nil(t, err)
}
Expand Down
2 changes: 0 additions & 2 deletions anchors/anchor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@ import (
)

var ctx = map[string]interface{}{}
var cfg Config

func TestMain(m *testing.M) {
ibootstappers := []bootstrap.TestBootstrapper{
&config.Bootstrapper{},
}
bootstrap.RunTestBootstrappers(ibootstappers, ctx)
cfg = ctx[bootstrap.BootstrappedConfig].(Config)
result := m.Run()
bootstrap.RunTestTeardown(ibootstappers)
os.Exit(result)
Expand Down

0 comments on commit 489c55b

Please sign in to comment.