[Core] Restructure repo to follow industry golang standards#412
[Core] Restructure repo to follow industry golang standards#412Gustavobelfort wants to merge 5 commits intomainfrom
Conversation
Olshansk
left a comment
There was a problem hiding this comment.
Definitely a hard change to review.
I'm not the biggest fan of everything but open to having the discussion.
-
Left some comments around naming decisions.
-
We started committing mocked files and generated files that we did not before
-
When I tried to run the tests it did not work for me. Did it pass for you?
-
This library isn't exactly an SDK, so is there really a reason to have 90% of the codebase under
internaljust because that's what the best practices say? Have you looked at how other blockchain Go projects (Cosmos, Tendermint, Flow, Celestia, et al) do it?
| .PHONY: client_connect | ||
| client_connect: docker_check ## Connect to the running client debugging daemon | ||
| docker exec -it client /bin/bash -c "go run -tags=debug app/client/*.go debug" | ||
| docker exec -it client /bin/bash -c "go run -tags=debug cmd/p1/*.go debug" |
There was a problem hiding this comment.
I'm not so sure about renaming app/client to cmd/p1.
Is this the golang standard?
p1 is the binary name we selected, but what if we choose to rename it? E.g. after v0 is deprecated and v1 is live, we might name it pocket instead. I felt like client was general enough.
| @@ -1,22 +1,11 @@ | |||
| include build.mk | |||
| include scripts/build.mk | |||
There was a problem hiding this comment.
Big fan of this but just not that you might hit some merge conflicts soon. Shouldn't be an issue but just FYI
| @@ -0,0 +1,546 @@ | |||
| // Package rpc provides primitives to interact with the openapi HTTP API. | |||
There was a problem hiding this comment.
Did we include this file in main before this change?
| "github.com/pokt-network/pocket/app" | ||
| "github.com/pokt-network/pocket/shared/codec" | ||
| typesUtil "github.com/pokt-network/pocket/utility/types" | ||
| app "github.com/pokt-network/pocket/cmd" |
There was a problem hiding this comment.
This seems a bit weird.
If app is a good semantic name for it, then I'd argue we shouldn't rename cmd to app.
Why the change?
| var ( | ||
| _ modules.RPCModule = &rpcModule{} | ||
| ) | ||
| var _ modules.RPCModule = &rpcModule{} |
There was a problem hiding this comment.
Do you really think rpc should be under internal?
| @@ -0,0 +1,7 @@ | |||
| syntax = "proto3"; | |||
There was a problem hiding this comment.
Do you know why git didn't treat this as a mv while it did for most of the others?
| @@ -0,0 +1,188 @@ | |||
| // Code generated by MockGen. DO NOT EDIT. | |||
There was a problem hiding this comment.
Why did we start committing mocked files now?
We did not do so before and shouldn't start doing it now.
|
Summarised some comments here for whoever picks this up in the future. |

Description
This refactors the codebase to follow the standards outlined in https://github.com/golang-standards/project-layout.
Additionally some changes on the Makefile were applied to make it mode readable and maintainable.
Issue
Fixes #379
Type of change
Please mark the relevant option(s):
List of changes
./scriptsTesting
make develop_testREADMERequired Checklist
If Applicable Checklist
shared/docs/*if I updatedshared/*README(s)