diff --git a/README.md b/README.md index c4e17ece2..da994a191 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,6 @@ ## Dev Environment Setup - ``` export GOPATH=$HOME/ diff --git a/services/explorer/service.go b/api/services/explorer/service.go similarity index 100% rename from services/explorer/service.go rename to api/services/explorer/service.go diff --git a/services/explorer/storage.go b/api/services/explorer/storage.go similarity index 100% rename from services/explorer/storage.go rename to api/services/explorer/storage.go diff --git a/services/explorer/structs.go b/api/services/explorer/structs.go similarity index 100% rename from services/explorer/structs.go rename to api/services/explorer/structs.go diff --git a/services/explorer/test2/main.go b/api/services/explorer/test2/main.go similarity index 69% rename from services/explorer/test2/main.go rename to api/services/explorer/test2/main.go index 28848617c..a0fdf9339 100644 --- a/services/explorer/test2/main.go +++ b/api/services/explorer/test2/main.go @@ -1,6 +1,6 @@ package main -import "github.com/harmony-one/harmony/services/explorer" +import "github.com/harmony-one/harmony/api/services/explorer" func main() { service := &explorer.Service{ diff --git a/services/syncing/downloader/client.go b/api/services/syncing/downloader/client.go similarity index 95% rename from services/syncing/downloader/client.go rename to api/services/syncing/downloader/client.go index a31b10986..7caecd625 100644 --- a/services/syncing/downloader/client.go +++ b/api/services/syncing/downloader/client.go @@ -6,7 +6,7 @@ import ( "log" "time" - pb "github.com/harmony-one/harmony/services/syncing/downloader/proto" + pb "github.com/harmony-one/harmony/api/services/syncing/downloader/proto" "google.golang.org/grpc" ) diff --git a/services/syncing/downloader/errors.go b/api/services/syncing/downloader/errors.go similarity index 100% rename from services/syncing/downloader/errors.go rename to api/services/syncing/downloader/errors.go diff --git a/services/syncing/downloader/gen.sh b/api/services/syncing/downloader/gen.sh similarity index 100% rename from services/syncing/downloader/gen.sh rename to api/services/syncing/downloader/gen.sh diff --git a/services/syncing/downloader/interface.go b/api/services/syncing/downloader/interface.go similarity index 80% rename from services/syncing/downloader/interface.go rename to api/services/syncing/downloader/interface.go index de2cfb97a..ec9e5f8cb 100644 --- a/services/syncing/downloader/interface.go +++ b/api/services/syncing/downloader/interface.go @@ -1,7 +1,7 @@ package downloader import ( - pb "github.com/harmony-one/harmony/services/syncing/downloader/proto" + pb "github.com/harmony-one/harmony/api/services/syncing/downloader/proto" ) // DownloadInterface is the interface for downloader package. diff --git a/services/syncing/downloader/proto/downloader.pb.go b/api/services/syncing/downloader/proto/downloader.pb.go similarity index 100% rename from services/syncing/downloader/proto/downloader.pb.go rename to api/services/syncing/downloader/proto/downloader.pb.go diff --git a/services/syncing/downloader/proto/downloader.proto b/api/services/syncing/downloader/proto/downloader.proto similarity index 100% rename from services/syncing/downloader/proto/downloader.proto rename to api/services/syncing/downloader/proto/downloader.proto diff --git a/services/syncing/downloader/server.go b/api/services/syncing/downloader/server.go similarity index 94% rename from services/syncing/downloader/server.go rename to api/services/syncing/downloader/server.go index 741b004ec..30c8c5ebe 100644 --- a/services/syncing/downloader/server.go +++ b/api/services/syncing/downloader/server.go @@ -7,7 +7,7 @@ import ( "google.golang.org/grpc" - pb "github.com/harmony-one/harmony/services/syncing/downloader/proto" + pb "github.com/harmony-one/harmony/api/services/syncing/downloader/proto" ) // Constants for downloader server. diff --git a/services/syncing/errors.go b/api/services/syncing/errors.go similarity index 100% rename from services/syncing/errors.go rename to api/services/syncing/errors.go diff --git a/services/syncing/interface.go b/api/services/syncing/interface.go similarity index 100% rename from services/syncing/interface.go rename to api/services/syncing/interface.go diff --git a/services/syncing/syncing.go b/api/services/syncing/syncing.go similarity index 99% rename from services/syncing/syncing.go rename to api/services/syncing/syncing.go index 29dcdfe34..756de6352 100644 --- a/services/syncing/syncing.go +++ b/api/services/syncing/syncing.go @@ -2,16 +2,17 @@ package syncing import ( "bytes" - "github.com/harmony-one/harmony/core" "reflect" "sort" "sync" "time" + "github.com/harmony-one/harmony/core" + "github.com/Workiva/go-datastructures/queue" + "github.com/harmony-one/harmony/api/services/syncing/downloader" "github.com/harmony-one/harmony/log" "github.com/harmony-one/harmony/p2p" - "github.com/harmony-one/harmony/services/syncing/downloader" ) // Constants for syncing. diff --git a/consensus/consensus_leader.go b/consensus/consensus_leader.go index 607ca81be..4db00449f 100644 --- a/consensus/consensus_leader.go +++ b/consensus/consensus_leader.go @@ -12,13 +12,13 @@ import ( "github.com/ethereum/go-ethereum/rlp" consensus_proto "github.com/harmony-one/harmony/api/consensus" + "github.com/harmony-one/harmony/api/services/explorer" "github.com/harmony-one/harmony/core/types" "github.com/harmony-one/harmony/crypto" "github.com/harmony-one/harmony/internal/profiler" "github.com/harmony-one/harmony/log" "github.com/harmony-one/harmony/p2p" "github.com/harmony-one/harmony/p2p/host" - "github.com/harmony-one/harmony/services/explorer" ) const ( diff --git a/node/node.go b/node/node.go index b4096bd93..661fa7c06 100644 --- a/node/node.go +++ b/node/node.go @@ -19,6 +19,10 @@ import ( "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rlp" proto_node "github.com/harmony-one/harmony/api/proto/node" + "github.com/harmony-one/harmony/api/services/explorer" + "github.com/harmony-one/harmony/api/services/syncing" + "github.com/harmony-one/harmony/api/services/syncing/downloader" + downloader_pb "github.com/harmony-one/harmony/api/services/syncing/downloader/proto" "github.com/harmony-one/harmony/client" clientService "github.com/harmony-one/harmony/client/service" bft "github.com/harmony-one/harmony/consensus" @@ -31,10 +35,6 @@ import ( "github.com/harmony-one/harmony/node/worker" "github.com/harmony-one/harmony/p2p" "github.com/harmony-one/harmony/p2p/host" - "github.com/harmony-one/harmony/services/explorer" - "github.com/harmony-one/harmony/services/syncing" - "github.com/harmony-one/harmony/services/syncing/downloader" - downloader_pb "github.com/harmony-one/harmony/services/syncing/downloader/proto" ) // State is a state of a node.