diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8c6b54f8f..000000000 --- a/.travis.yml +++ /dev/null @@ -1,53 +0,0 @@ -language: go - -matrix: - include: - - name: "Ubuntu 20.04 (Focal Fossa)" - os: linux - dist: focal - - name: "MacOS X" - os: osx - -go: - - 1.16.x - -before_install: - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then go get -t github.com/codeclimate/test-reporter; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install --reinstall ca-certificates; fi - -install: - - make all polaris colaris - -before_script: - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then test-reporter before-build; fi - -script: - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then make cover-check; fi - -after_script: - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi - -before_deploy: - - AERGO_VERSION="${TRAVIS_TAG:1}" - - mkdir -p release - - mkdir -p aergo/${AERGO_VERSION}/bin - - mkdir -p aergo/${AERGO_VERSION}/lib - - mv bin/{aergocli,aergoluac,aergosvr,brick} aergo/${AERGO_VERSION}/bin - - cp libtool/lib/libgmp* aergo/${AERGO_VERSION}/lib - - tar -zcvf release/aergo-${AERGO_VERSION}.${TRAVIS_OS_NAME}.tar.gz aergo/${AERGO_VERSION} - - mkdir -p polaris/${AERGO_VERSION}/bin - - mkdir -p polaris/${AERGO_VERSION}/lib - - mv bin/{polaris,colaris} polaris/${AERGO_VERSION}/bin - - cp libtool/lib/libgmp* polaris/${AERGO_VERSION}/lib - - tar -zcvf release/polaris-${AERGO_VERSION}.${TRAVIS_OS_NAME}.tar.gz polaris/${AERGO_VERSION} - -deploy: - provider: releases - api_key: - secure: uGFdnqc23aUqoZD9bZqQsGl4KiHAH6WkUrH9mrdgzsb5sXaChhX0J9klJcDEbYOKG19HUeoBHSorwSKl6Bsg+eOqf8E+blNQLNq7CoPcceGkpXBrfmGe3zgXKjrEGDbsEBuR7oA4GcJAYKw+tJEXZ7z4jy6kuJFxn5j3MZqvz0XIKM6/dUiF/0N1sfLrDWWpdBrW2yJt9yHaeqXhhA/IiHVrlj79KYxTU0UFwdBW6CjxLpOoQWaFwW3X94l5/UpKrDXFpwjjCOhceBpm8dHBxbYujDtop/n/R0VdhtVXtdyx/I877e/d5z3fDL6xTuAMnDYbJdqhVVbBoAukbOpYzhksJ7+1dFFEcku6pFfYPMnxjhxNs9AN5b/qAdxauUe167a/XVUOyOUFoZlptZsGO5i9HXCAnLOgyyTMpeeo3ELIJvSQAK5J9l/wz1g0cJboRsu1rM0LmNqynzScJja2MWaH1vXKlFA56Lr0ZtY/N3T7pg+BPucFp4Fp8hedoEIqRZbqWDAlfX4aY8u6BWTS5929ThrXT9Y5PRZplLAW9QdlmHewWZpevCSm5HA60SF7Qz9tUAVTyKzx/GLvLBNyI82M9JggHwK0gVe/fU0NtKewZnwNaJ4uM5LZvJxq6h0+/N6BLBZsLmBbUC3BgodMSdxb9y0rG8ipAWi9dZhEYd0= - file_glob: true - file: release/* - skip_cleanup: true - draft: true - on: - tags: true diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index f5a79b901..000000000 --- a/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM golang:1.12.5-alpine3.9 as builder -RUN apk update && apk add git cmake build-base m4 -COPY . aergo -RUN cd aergo && make aergosvr - -FROM alpine:3.9 -RUN apk add libgcc -COPY --from=builder /go/aergo/bin/aergosvr /usr/local/bin/ -COPY --from=builder /go/aergo/libtool/lib/* /usr/local/lib/ -COPY --from=builder /go/aergo/Docker/conf/* /aergo/ -ENV LD_LIBRARY_PATH="/usr/local/lib:${LD_LIBRARY_PATH}" -WORKDIR /aergo/ -CMD ["aergosvr", "--home", "/aergo"] -EXPOSE 7845 7846 6060 diff --git a/Dockerfile.polaris b/Dockerfile.polaris deleted file mode 100644 index 3b649f567..000000000 --- a/Dockerfile.polaris +++ /dev/null @@ -1,10 +0,0 @@ -FROM golang:1.12.5-alpine3.9 as builder -RUN apk update && apk add git cmake build-base m4 -COPY . aergo -RUN cd aergo && make polaris colaris - -FROM alpine:3.9 -RUN apk add libgcc -COPY --from=builder go/aergo/bin/?olaris /usr/local/bin/ -WORKDIR /tools/ -CMD ["polaris"] diff --git a/Dockerfile.tools b/Dockerfile.tools deleted file mode 100644 index adb64d6f9..000000000 --- a/Dockerfile.tools +++ /dev/null @@ -1,13 +0,0 @@ -FROM golang:1.12.5-alpine3.9 as builder -RUN apk update && apk add git cmake build-base m4 -COPY . aergo -RUN cd aergo && make aergocli aergoluac brick - -FROM alpine:3.9 -RUN apk add libgcc -COPY --from=builder /go/aergo/bin/* /usr/local/bin/ -COPY --from=builder /go/aergo/cmd/brick/arglog.toml /tools/arglog.toml -COPY --from=builder /go/aergo/libtool/lib/* /usr/local/lib/ -ENV LD_LIBRARY_PATH="/usr/local/lib:${LD_LIBRARY_PATH}" -WORKDIR /tools/ -CMD ["aergocli"] diff --git a/account/accountservice.go b/account/accountservice.go index 41f13add9..030179c5c 100644 --- a/account/accountservice.go +++ b/account/accountservice.go @@ -8,10 +8,10 @@ import ( "github.com/aergoio/aergo/v2/account/key" cfg "github.com/aergoio/aergo/v2/config" "github.com/aergoio/aergo/v2/contract/name" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/pkg/component" "github.com/aergoio/aergo/v2/state" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" ) type AccountService struct { diff --git a/account/signer.go b/account/signer.go index d65f17442..4325b5975 100644 --- a/account/signer.go +++ b/account/signer.go @@ -3,7 +3,7 @@ package account import ( "github.com/aergoio/aergo-actor/actor" "github.com/aergoio/aergo/v2/account/key" - "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/types/message" ) type Signer struct { diff --git a/chain/chainhandle.go b/chain/chainhandle.go index 4691b73f7..df526505f 100644 --- a/chain/chainhandle.go +++ b/chain/chainhandle.go @@ -21,9 +21,9 @@ import ( "github.com/aergoio/aergo/v2/fee" "github.com/aergoio/aergo/v2/internal/enc/base58" "github.com/aergoio/aergo/v2/internal/enc/proto" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/state" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" ) var ( diff --git a/chain/chainservice.go b/chain/chainservice.go index 7b4b0aaea..a9631001b 100644 --- a/chain/chainservice.go +++ b/chain/chainservice.go @@ -25,11 +25,11 @@ import ( "github.com/aergoio/aergo/v2/contract/system" "github.com/aergoio/aergo/v2/fee" "github.com/aergoio/aergo/v2/internal/enc/base58" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/pkg/component" "github.com/aergoio/aergo/v2/state" "github.com/aergoio/aergo/v2/types" "github.com/aergoio/aergo/v2/types/dbkey" + "github.com/aergoio/aergo/v2/types/message" lru "github.com/hashicorp/golang-lru" ) diff --git a/chain/chainverifier.go b/chain/chainverifier.go index 811edc8ea..3f7b42768 100644 --- a/chain/chainverifier.go +++ b/chain/chainverifier.go @@ -7,9 +7,9 @@ import ( "github.com/aergoio/aergo-actor/actor" "github.com/aergoio/aergo/v2/internal/enc/base58" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/pkg/component" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" ) type ChainVerifier struct { diff --git a/chain/reorg.go b/chain/reorg.go index c4107c634..7f3f3f867 100644 --- a/chain/reorg.go +++ b/chain/reorg.go @@ -9,9 +9,9 @@ import ( "github.com/aergoio/aergo/v2/consensus" "github.com/aergoio/aergo/v2/contract/system" "github.com/aergoio/aergo/v2/internal/enc/base58" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/state" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" ) const ( diff --git a/chain/signVerifier.go b/chain/signVerifier.go index 6240e88bf..a9ce80512 100644 --- a/chain/signVerifier.go +++ b/chain/signVerifier.go @@ -8,10 +8,10 @@ import ( "github.com/aergoio/aergo/v2/account/key" "github.com/aergoio/aergo/v2/contract/name" "github.com/aergoio/aergo/v2/internal/enc/base58" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/pkg/component" "github.com/aergoio/aergo/v2/state" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" ) type SignVerifier struct { diff --git a/chain/stubchain.go b/chain/stubchain.go index 5f5904768..587a508bd 100644 --- a/chain/stubchain.go +++ b/chain/stubchain.go @@ -6,8 +6,8 @@ import ( "math/big" "time" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" ) // StubSyncer receive Syncer, P2P, Chain Service actor message diff --git a/cmd/aergosvr/aergosvr.go b/cmd/aergosvr/aergosvr.go index ebafc3cb4..65af3d471 100644 --- a/cmd/aergosvr/aergosvr.go +++ b/cmd/aergosvr/aergosvr.go @@ -11,6 +11,7 @@ import ( "github.com/aergoio/aergo-lib/log" "github.com/aergoio/aergo/v2/account" "github.com/aergoio/aergo/v2/chain" + polarisclient "github.com/aergoio/aergo/v2/cmd/polaris/client" "github.com/aergoio/aergo/v2/config" "github.com/aergoio/aergo/v2/consensus" "github.com/aergoio/aergo/v2/consensus/impl" @@ -19,7 +20,6 @@ import ( "github.com/aergoio/aergo/v2/p2p" "github.com/aergoio/aergo/v2/p2p/p2pkey" "github.com/aergoio/aergo/v2/pkg/component" - polarisclient "github.com/aergoio/aergo/v2/polaris/client" "github.com/aergoio/aergo/v2/rpc" "github.com/aergoio/aergo/v2/syncer" "github.com/spf13/cobra" diff --git a/cmd/colaris/cmd/config.go b/cmd/colaris/cmd/config.go index 75750f28e..54e32885a 100644 --- a/cmd/colaris/cmd/config.go +++ b/cmd/colaris/cmd/config.go @@ -7,7 +7,7 @@ package cmd import ( "github.com/aergoio/aergo-lib/config" - "github.com/aergoio/aergo/v2/polaris/common" + "github.com/aergoio/aergo/v2/cmd/polaris/common" ) const ( diff --git a/polaris/client/polarisconnect.go b/cmd/polaris/client/polarisconnect.go similarity index 98% rename from polaris/client/polarisconnect.go rename to cmd/polaris/client/polarisconnect.go index 58c85b729..6f2c238df 100644 --- a/polaris/client/polarisconnect.go +++ b/cmd/polaris/client/polarisconnect.go @@ -13,15 +13,15 @@ import ( "github.com/aergoio/aergo-actor/actor" "github.com/aergoio/aergo-lib/log" + "github.com/aergoio/aergo/v2/cmd/polaris/common" "github.com/aergoio/aergo/v2/config" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2pkey" "github.com/aergoio/aergo/v2/p2p/p2putil" v030 "github.com/aergoio/aergo/v2/p2p/v030" "github.com/aergoio/aergo/v2/pkg/component" - "github.com/aergoio/aergo/v2/polaris/common" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "github.com/libp2p/go-libp2p-core/network" ) diff --git a/polaris/client/polarisconnect_test.go b/cmd/polaris/client/polarisconnect_test.go similarity index 98% rename from polaris/client/polarisconnect_test.go rename to cmd/polaris/client/polarisconnect_test.go index c45a71b46..c782c111e 100644 --- a/polaris/client/polarisconnect_test.go +++ b/cmd/polaris/client/polarisconnect_test.go @@ -9,12 +9,12 @@ import ( "errors" "testing" + "github.com/aergoio/aergo/v2/cmd/polaris/common" "github.com/aergoio/aergo/v2/config" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2pmock" "github.com/aergoio/aergo/v2/p2p/p2putil" "github.com/aergoio/aergo/v2/pkg/component" - "github.com/aergoio/aergo/v2/polaris/common" "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" ) @@ -37,7 +37,7 @@ func (dntc *dummyNTC) GenesisChainID() *types.ChainID { } var ( - pmapDummyCfg = &config.Config{P2P: &config.P2PConfig{}, Polaris: &config.PolarisConfig{GenesisFile: "../../examples/genesis.json"}} + pmapDummyCfg = &config.Config{P2P: &config.P2PConfig{}, Polaris: &config.PolarisConfig{GenesisFile: "../examples/genesis.json"}} pmapDummyNTC = &dummyNTC{chainID: &types.ChainID{}} ) diff --git a/polaris/common/consts.go b/cmd/polaris/common/consts.go similarity index 100% rename from polaris/common/consts.go rename to cmd/polaris/common/consts.go diff --git a/polaris/common/message.go b/cmd/polaris/common/message.go similarity index 100% rename from polaris/common/message.go rename to cmd/polaris/common/message.go diff --git a/polaris/common/polarisprotocol.go b/cmd/polaris/common/polarisprotocol.go similarity index 100% rename from polaris/common/polarisprotocol.go rename to cmd/polaris/common/polarisprotocol.go diff --git a/examples/component/main.go b/cmd/polaris/examples/component/main.go similarity index 85% rename from examples/component/main.go rename to cmd/polaris/examples/component/main.go index d532688a6..7d919df6c 100644 --- a/examples/component/main.go +++ b/cmd/polaris/examples/component/main.go @@ -10,9 +10,9 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/v2/examples/component/message" - "github.com/aergoio/aergo/v2/examples/component/server" - "github.com/aergoio/aergo/v2/examples/component/service" + "github.com/aergoio/aergo/v2/cmd/polaris/examples/component/message" + "github.com/aergoio/aergo/v2/cmd/polaris/examples/component/server" + "github.com/aergoio/aergo/v2/cmd/polaris/examples/component/service" "github.com/aergoio/aergo/v2/pkg/component" ) diff --git a/examples/component/message/componentmsg.go b/cmd/polaris/examples/component/message/componentmsg.go similarity index 100% rename from examples/component/message/componentmsg.go rename to cmd/polaris/examples/component/message/componentmsg.go diff --git a/examples/component/server/server.go b/cmd/polaris/examples/component/server/server.go similarity index 90% rename from examples/component/server/server.go rename to cmd/polaris/examples/component/server/server.go index 36e217c29..c21297107 100644 --- a/examples/component/server/server.go +++ b/cmd/polaris/examples/component/server/server.go @@ -7,7 +7,7 @@ package server import ( "github.com/aergoio/aergo-actor/actor" - "github.com/aergoio/aergo/v2/examples/component/message" + "github.com/aergoio/aergo/v2/cmd/polaris/examples/component/message" "github.com/aergoio/aergo/v2/pkg/component" ) diff --git a/examples/component/service/service.go b/cmd/polaris/examples/component/service/service.go similarity index 93% rename from examples/component/service/service.go rename to cmd/polaris/examples/component/service/service.go index 31d2784fe..19c72a41a 100644 --- a/examples/component/service/service.go +++ b/cmd/polaris/examples/component/service/service.go @@ -10,7 +10,7 @@ import ( "github.com/aergoio/aergo-actor/actor" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/v2/examples/component/message" + "github.com/aergoio/aergo/v2/cmd/polaris/examples/component/message" "github.com/aergoio/aergo/v2/pkg/component" ) diff --git a/examples/genesis.json b/cmd/polaris/examples/genesis.json similarity index 100% rename from examples/genesis.json rename to cmd/polaris/examples/genesis.json diff --git a/cmd/polaris/polaris.go b/cmd/polaris/polaris.go index 0cae723cd..edab71c92 100644 --- a/cmd/polaris/polaris.go +++ b/cmd/polaris/polaris.go @@ -10,12 +10,12 @@ import ( "github.com/aergoio/aergo-actor/actor" "github.com/aergoio/aergo-lib/log" + common2 "github.com/aergoio/aergo/v2/cmd/polaris/common" + "github.com/aergoio/aergo/v2/cmd/polaris/server" "github.com/aergoio/aergo/v2/config" "github.com/aergoio/aergo/v2/internal/common" "github.com/aergoio/aergo/v2/p2p/p2pkey" "github.com/aergoio/aergo/v2/pkg/component" - common2 "github.com/aergoio/aergo/v2/polaris/common" - "github.com/aergoio/aergo/v2/polaris/server" "github.com/spf13/cobra" ) diff --git a/cmd/polaris/polaris_test.go b/cmd/polaris/polaris_test.go index 3a5213617..76fa93fae 100644 --- a/cmd/polaris/polaris_test.go +++ b/cmd/polaris/polaris_test.go @@ -3,8 +3,8 @@ package main import ( "testing" + "github.com/aergoio/aergo/v2/cmd/polaris/common" "github.com/aergoio/aergo/v2/config" - "github.com/aergoio/aergo/v2/polaris/common" ) func Test_arrangeDefaultCfgForPolaris(t *testing.T) { diff --git a/polaris/server/actormsg.go b/cmd/polaris/server/actormsg.go similarity index 100% rename from polaris/server/actormsg.go rename to cmd/polaris/server/actormsg.go diff --git a/polaris/server/example-blacklist.json b/cmd/polaris/server/example-blacklist.json similarity index 100% rename from polaris/server/example-blacklist.json rename to cmd/polaris/server/example-blacklist.json diff --git a/polaris/server/genesisreader.go b/cmd/polaris/server/genesisreader.go similarity index 100% rename from polaris/server/genesisreader.go rename to cmd/polaris/server/genesisreader.go diff --git a/polaris/server/genesisreader_test.go b/cmd/polaris/server/genesisreader_test.go similarity index 79% rename from polaris/server/genesisreader_test.go rename to cmd/polaris/server/genesisreader_test.go index 13bbe8a43..d9cd9cd63 100644 --- a/polaris/server/genesisreader_test.go +++ b/cmd/polaris/server/genesisreader_test.go @@ -23,9 +23,9 @@ func Test_readGenesis(t *testing.T) { wantRet *types.Genesis wantErr bool }{ - {"Tsucc", args{"../../examples/genesis.json"}, sampleGenesis, false}, - {"TNotExist", args{"../../examples/genesis.notjson"}, nil, true}, - {"TNotGenesis", args{"../../examples/component/main.go"}, nil, true}, + {"Tsucc", args{"../examples/genesis.json"}, sampleGenesis, false}, + {"TNotExist", args{"../examples/genesis.notjson"}, nil, true}, + {"TNotGenesis", args{"../examples/component/main.go"}, nil, true}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/polaris/server/healthcheck.go b/cmd/polaris/server/healthcheck.go similarity index 97% rename from polaris/server/healthcheck.go rename to cmd/polaris/server/healthcheck.go index 0e073787e..6a7fc09fc 100644 --- a/polaris/server/healthcheck.go +++ b/cmd/polaris/server/healthcheck.go @@ -10,8 +10,8 @@ import ( "time" "github.com/aergoio/aergo-lib/log" + "github.com/aergoio/aergo/v2/cmd/polaris/common" "github.com/aergoio/aergo/v2/p2p/p2pcommon" - "github.com/aergoio/aergo/v2/polaris/common" ) type HealthCheckManager interface { diff --git a/polaris/server/healthcheck_test.go b/cmd/polaris/server/healthcheck_test.go similarity index 100% rename from polaris/server/healthcheck_test.go rename to cmd/polaris/server/healthcheck_test.go diff --git a/polaris/server/listmanager.go b/cmd/polaris/server/listmanager.go similarity index 100% rename from polaris/server/listmanager.go rename to cmd/polaris/server/listmanager.go diff --git a/polaris/server/listmanager_test.go b/cmd/polaris/server/listmanager_test.go similarity index 100% rename from polaris/server/listmanager_test.go rename to cmd/polaris/server/listmanager_test.go diff --git a/polaris/server/litentcontainer.go b/cmd/polaris/server/litentcontainer.go similarity index 99% rename from polaris/server/litentcontainer.go rename to cmd/polaris/server/litentcontainer.go index 9772ffd7e..66b03992a 100644 --- a/polaris/server/litentcontainer.go +++ b/cmd/polaris/server/litentcontainer.go @@ -16,13 +16,13 @@ import ( "github.com/aergoio/aergo/v2/config" "github.com/aergoio/aergo/v2/consensus" "github.com/aergoio/aergo/v2/internal/network" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2pkey" "github.com/aergoio/aergo/v2/p2p/p2putil" "github.com/aergoio/aergo/v2/p2p/transport" "github.com/aergoio/aergo/v2/pkg/component" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" ) // P2P is actor component for p2p diff --git a/polaris/server/mapservice.go b/cmd/polaris/server/mapservice.go similarity index 99% rename from polaris/server/mapservice.go rename to cmd/polaris/server/mapservice.go index b1ad0ad0e..74a1f8fef 100644 --- a/polaris/server/mapservice.go +++ b/cmd/polaris/server/mapservice.go @@ -15,13 +15,13 @@ import ( "github.com/aergoio/aergo-actor/actor" "github.com/aergoio/aergo-lib/log" + "github.com/aergoio/aergo/v2/cmd/polaris/common" "github.com/aergoio/aergo/v2/config" "github.com/aergoio/aergo/v2/internal/network" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2putil" v030 "github.com/aergoio/aergo/v2/p2p/v030" "github.com/aergoio/aergo/v2/pkg/component" - "github.com/aergoio/aergo/v2/polaris/common" "github.com/aergoio/aergo/v2/types" "github.com/gofrs/uuid" ) diff --git a/polaris/server/mapservice_test.go b/cmd/polaris/server/mapservice_test.go similarity index 99% rename from polaris/server/mapservice_test.go rename to cmd/polaris/server/mapservice_test.go index a810e8670..9a242ecbe 100644 --- a/polaris/server/mapservice_test.go +++ b/cmd/polaris/server/mapservice_test.go @@ -13,13 +13,13 @@ import ( "testing" "time" + "github.com/aergoio/aergo/v2/cmd/polaris/common" "github.com/aergoio/aergo/v2/config" "github.com/aergoio/aergo/v2/internal/enc/proto" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2pmock" "github.com/aergoio/aergo/v2/p2p/p2putil" "github.com/aergoio/aergo/v2/pkg/component" - "github.com/aergoio/aergo/v2/polaris/common" "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" "github.com/libp2p/go-libp2p-core/network" @@ -44,7 +44,7 @@ func (dntc *dummyNTC) GenesisChainID() *types.ChainID { } var ( - pmapDummyCfg = &config.Config{P2P: &config.P2PConfig{}, Polaris: &config.PolarisConfig{GenesisFile: "../../examples/genesis.json"}, + pmapDummyCfg = &config.Config{P2P: &config.P2PConfig{}, Polaris: &config.PolarisConfig{GenesisFile: "../examples/genesis.json"}, Auth: &config.AuthConfig{EnableLocalConf: false}} pmapDummyNTC = &dummyNTC{chainID: &types.ChainID{}} ) diff --git a/polaris/server/peerstate.go b/cmd/polaris/server/peerstate.go similarity index 98% rename from polaris/server/peerstate.go rename to cmd/polaris/server/peerstate.go index c256c942a..9421bc260 100644 --- a/polaris/server/peerstate.go +++ b/cmd/polaris/server/peerstate.go @@ -12,10 +12,10 @@ import ( "sync/atomic" "time" + "github.com/aergoio/aergo/v2/cmd/polaris/common" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2putil" v030 "github.com/aergoio/aergo/v2/p2p/v030" - "github.com/aergoio/aergo/v2/polaris/common" "github.com/aergoio/aergo/v2/types" ) diff --git a/polaris/server/peerstate_test.go b/cmd/polaris/server/peerstate_test.go similarity index 100% rename from polaris/server/peerstate_test.go rename to cmd/polaris/server/peerstate_test.go diff --git a/polaris/server/prpc.go b/cmd/polaris/server/prpc.go similarity index 99% rename from polaris/server/prpc.go rename to cmd/polaris/server/prpc.go index 8c1451aeb..c67cc39cd 100644 --- a/polaris/server/prpc.go +++ b/cmd/polaris/server/prpc.go @@ -17,10 +17,10 @@ import ( "github.com/aergoio/aergo-actor/actor" "github.com/aergoio/aergo-lib/log" "github.com/aergoio/aergo/v2/config" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/pkg/component" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc" "github.com/opentracing/opentracing-go" "github.com/soheilhy/cmux" diff --git a/consensus/chain/block.go b/consensus/chain/block.go index 01b712d22..093a60273 100644 --- a/consensus/chain/block.go +++ b/consensus/chain/block.go @@ -8,10 +8,10 @@ import ( "github.com/aergoio/aergo/v2/chain" "github.com/aergoio/aergo/v2/internal/enc/base58" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/pkg/component" "github.com/aergoio/aergo/v2/state" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" ) var ( diff --git a/consensus/chain/tx.go b/consensus/chain/tx.go index a9af96d20..4197c94df 100644 --- a/consensus/chain/tx.go +++ b/consensus/chain/tx.go @@ -14,10 +14,10 @@ import ( "github.com/aergoio/aergo/v2/chain" "github.com/aergoio/aergo/v2/contract" "github.com/aergoio/aergo/v2/internal/enc/proto" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/pkg/component" "github.com/aergoio/aergo/v2/state" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" ) var ( diff --git a/consensus/impl/raftv2/cluster.go b/consensus/impl/raftv2/cluster.go index 21b68c6b2..fb0408169 100644 --- a/consensus/impl/raftv2/cluster.go +++ b/consensus/impl/raftv2/cluster.go @@ -15,9 +15,9 @@ import ( "github.com/aergoio/aergo/v2/cmd/aergocli/util" "github.com/aergoio/aergo/v2/consensus" "github.com/aergoio/aergo/v2/internal/enc/base58" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/pkg/component" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" raftlib "github.com/aergoio/etcd/raft" "github.com/aergoio/etcd/raft/raftpb" ) diff --git a/consensus/impl/raftv2/config.go b/consensus/impl/raftv2/config.go index 0d807e716..78d32ed9f 100644 --- a/consensus/impl/raftv2/config.go +++ b/consensus/impl/raftv2/config.go @@ -9,9 +9,9 @@ import ( "github.com/aergoio/aergo/v2/chain" "github.com/aergoio/aergo/v2/config" "github.com/aergoio/aergo/v2/consensus" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pkey" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" ) var ( diff --git a/consensus/impl/raftv2/p2p.go b/consensus/impl/raftv2/p2p.go index 1bad4f8ea..515135c51 100644 --- a/consensus/impl/raftv2/p2p.go +++ b/consensus/impl/raftv2/p2p.go @@ -4,9 +4,9 @@ import ( "errors" "time" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/pkg/component" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" ) var ( diff --git a/consensus/impl/raftv2/raftserver.go b/consensus/impl/raftv2/raftserver.go index f514d6465..b859ee3be 100644 --- a/consensus/impl/raftv2/raftserver.go +++ b/consensus/impl/raftv2/raftserver.go @@ -31,10 +31,10 @@ import ( "github.com/aergoio/aergo/v2/chain" "github.com/aergoio/aergo/v2/consensus" "github.com/aergoio/aergo/v2/internal/enc/proto" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/pkg/component" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "github.com/aergoio/etcd/etcdserver/stats" etcdtypes "github.com/aergoio/etcd/pkg/types" raftlib "github.com/aergoio/etcd/raft" diff --git a/mempool/mempool.go b/mempool/mempool.go index f99c05dcf..6f0e3bafe 100644 --- a/mempool/mempool.go +++ b/mempool/mempool.go @@ -30,10 +30,10 @@ import ( "github.com/aergoio/aergo/v2/internal/common" "github.com/aergoio/aergo/v2/internal/enc/base58" "github.com/aergoio/aergo/v2/internal/enc/proto" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/pkg/component" "github.com/aergoio/aergo/v2/state" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" ) const ( diff --git a/mempool/txverifier.go b/mempool/txverifier.go index 4380692ad..b947748c5 100644 --- a/mempool/txverifier.go +++ b/mempool/txverifier.go @@ -3,8 +3,8 @@ package mempool import ( "github.com/aergoio/aergo-actor/actor" "github.com/aergoio/aergo/v2/internal/enc/base58" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" ) type TxVerifier struct { diff --git a/p2p/actorwork.go b/p2p/actorwork.go index d7075b696..e651ab9c3 100644 --- a/p2p/actorwork.go +++ b/p2p/actorwork.go @@ -12,10 +12,10 @@ import ( "github.com/aergoio/aergo-actor/actor" "github.com/aergoio/aergo/v2/internal/enc/base58" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2putil" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "github.com/aergoio/etcd/raft/raftpb" ) diff --git a/p2p/actorwork_test.go b/p2p/actorwork_test.go index f05f61dd1..78bd85e9b 100644 --- a/p2p/actorwork_test.go +++ b/p2p/actorwork_test.go @@ -10,11 +10,11 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2pmock" "github.com/aergoio/aergo/v2/pkg/component" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "github.com/aergoio/etcd/raft/raftpb" "github.com/golang/mock/gomock" ) diff --git a/p2p/ancestorreceiver.go b/p2p/ancestorreceiver.go index 3c2c2c1ad..aca9c4e2a 100644 --- a/p2p/ancestorreceiver.go +++ b/p2p/ancestorreceiver.go @@ -8,9 +8,9 @@ package p2p import ( "time" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" ) // BlocksChunkReceiver is send p2p getBlocksRequest to target peer and receive p2p responses till all requests blocks are received diff --git a/p2p/ancestorreceiver_test.go b/p2p/ancestorreceiver_test.go index c0acc5cbc..caeddabf9 100644 --- a/p2p/ancestorreceiver_test.go +++ b/p2p/ancestorreceiver_test.go @@ -9,10 +9,10 @@ import ( "testing" "time" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2pmock" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" ) diff --git a/p2p/blkreceiver.go b/p2p/blkreceiver.go index 10fa63bfe..a416a5610 100644 --- a/p2p/blkreceiver.go +++ b/p2p/blkreceiver.go @@ -10,9 +10,9 @@ import ( "time" "github.com/aergoio/aergo/v2/chain" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" ) // BlocksChunkReceiver is send p2p getBlocksRequest to target peer and receive p2p responses till all requests blocks are received diff --git a/p2p/blkreceiver_test.go b/p2p/blkreceiver_test.go index 94860e879..1a98126fd 100644 --- a/p2p/blkreceiver_test.go +++ b/p2p/blkreceiver_test.go @@ -10,10 +10,10 @@ import ( "time" "github.com/aergoio/aergo/v2/chain" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2pmock" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" ) diff --git a/p2p/certmanager.go b/p2p/certmanager.go index 4712b7fb0..20883f5ca 100644 --- a/p2p/certmanager.go +++ b/p2p/certmanager.go @@ -6,11 +6,11 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2pkey" "github.com/aergoio/aergo/v2/p2p/p2putil" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "github.com/btcsuite/btcd/btcec" ) diff --git a/p2p/certmanager_test.go b/p2p/certmanager_test.go index 5d654d347..910d63dfc 100644 --- a/p2p/certmanager_test.go +++ b/p2p/certmanager_test.go @@ -6,11 +6,11 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2pmock" "github.com/aergoio/aergo/v2/p2p/p2putil" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "github.com/golang/mock/gomock" "github.com/libp2p/go-libp2p-core/crypto" "github.com/libp2p/go-libp2p-peerstore/test" diff --git a/p2p/hashbynoreceiver.go b/p2p/hashbynoreceiver.go index c217ac6be..81dfdbf4e 100644 --- a/p2p/hashbynoreceiver.go +++ b/p2p/hashbynoreceiver.go @@ -8,9 +8,9 @@ package p2p import ( "time" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" ) // BlocksChunkReceiver is send p2p getBlocksRequest to target peer and receive p2p responses till all requests blocks are received diff --git a/p2p/hashbynoreceiver_test.go b/p2p/hashbynoreceiver_test.go index d07788bfb..d3b546ce9 100644 --- a/p2p/hashbynoreceiver_test.go +++ b/p2p/hashbynoreceiver_test.go @@ -9,10 +9,10 @@ import ( "testing" "time" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2pmock" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" ) diff --git a/p2p/hashreceiver.go b/p2p/hashreceiver.go index 5b8ad0ca3..bd263f6ec 100644 --- a/p2p/hashreceiver.go +++ b/p2p/hashreceiver.go @@ -8,9 +8,9 @@ package p2p import ( "time" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" ) // BlockHashesReceiver is send p2p GetHashesRequest to target peer and receive p2p responses till all requested hashes are received diff --git a/p2p/hashreceiver_test.go b/p2p/hashreceiver_test.go index bd69d0a84..a98fd4991 100644 --- a/p2p/hashreceiver_test.go +++ b/p2p/hashreceiver_test.go @@ -11,10 +11,10 @@ import ( "github.com/aergoio/aergo/v2/chain" "github.com/aergoio/aergo/v2/internal/enc/base58" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2pmock" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "github.com/funkygao/golib/rand" "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" diff --git a/p2p/p2p.go b/p2p/p2p.go index 901efc617..04c37518c 100644 --- a/p2p/p2p.go +++ b/p2p/p2p.go @@ -17,7 +17,6 @@ import ( "github.com/aergoio/aergo/v2/config" "github.com/aergoio/aergo/v2/consensus" "github.com/aergoio/aergo/v2/internal/network" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/list" "github.com/aergoio/aergo/v2/p2p/metric" "github.com/aergoio/aergo/v2/p2p/p2pcommon" @@ -28,6 +27,7 @@ import ( "github.com/aergoio/aergo/v2/p2p/transport" "github.com/aergoio/aergo/v2/pkg/component" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "github.com/rs/zerolog" ) diff --git a/p2p/p2p_test.go b/p2p/p2p_test.go index a4bc06edf..0f5fa5571 100644 --- a/p2p/p2p_test.go +++ b/p2p/p2p_test.go @@ -11,12 +11,12 @@ import ( "testing" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/list" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2pmock" "github.com/aergoio/aergo/v2/pkg/component" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "github.com/golang/mock/gomock" ) diff --git a/p2p/p2pcommon/peermanager.go b/p2p/p2pcommon/peermanager.go index 23172398b..6dfe4121e 100644 --- a/p2p/p2pcommon/peermanager.go +++ b/p2p/p2pcommon/peermanager.go @@ -7,8 +7,8 @@ package p2pcommon import ( - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" ) // PeerManager is internal service that provide peer management diff --git a/p2p/p2pmock/mock_peermanager.go b/p2p/p2pmock/mock_peermanager.go index 271b12b08..0a499dd69 100644 --- a/p2p/p2pmock/mock_peermanager.go +++ b/p2p/p2pmock/mock_peermanager.go @@ -5,7 +5,7 @@ package p2pmock import ( - message "github.com/aergoio/aergo/v2/message" + message "github.com/aergoio/aergo/v2/types/message" p2pcommon "github.com/aergoio/aergo/v2/p2p/p2pcommon" types "github.com/aergoio/aergo/v2/types" gomock "github.com/golang/mock/gomock" diff --git a/p2p/p2putil/util.go b/p2p/p2putil/util.go index 8eed9bf9a..ff0f398d3 100644 --- a/p2p/p2putil/util.go +++ b/p2p/p2putil/util.go @@ -14,8 +14,8 @@ import ( "strings" "github.com/aergoio/aergo/v2/internal/enc/base58" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "github.com/gofrs/uuid" ) diff --git a/p2p/peerfinder.go b/p2p/peerfinder.go index a35ccfd0c..3da28df48 100644 --- a/p2p/peerfinder.go +++ b/p2p/peerfinder.go @@ -9,10 +9,10 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2putil" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" ) const ( diff --git a/p2p/peermanager.go b/p2p/peermanager.go index bfe018777..32ebae9f3 100644 --- a/p2p/peermanager.go +++ b/p2p/peermanager.go @@ -11,12 +11,12 @@ import ( "github.com/aergoio/aergo-actor/actor" "github.com/aergoio/aergo-lib/log" cfg "github.com/aergoio/aergo/v2/config" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/metric" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2pkey" "github.com/aergoio/aergo/v2/p2p/p2putil" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "github.com/libp2p/go-libp2p-core/protocol" ) diff --git a/p2p/peermanager_test.go b/p2p/peermanager_test.go index bd5b50891..b5ffd9ceb 100644 --- a/p2p/peermanager_test.go +++ b/p2p/peermanager_test.go @@ -10,12 +10,12 @@ import ( "github.com/aergoio/aergo-lib/log" cfg "github.com/aergoio/aergo/v2/config" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2pkey" "github.com/aergoio/aergo/v2/p2p/p2pmock" "github.com/aergoio/aergo/v2/p2p/p2putil" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "github.com/golang/mock/gomock" "github.com/libp2p/go-libp2p-core/crypto" "github.com/pkg/errors" diff --git a/p2p/pi_test.go b/p2p/pi_test.go index 2599df075..d9fde925f 100644 --- a/p2p/pi_test.go +++ b/p2p/pi_test.go @@ -10,10 +10,10 @@ import ( "github.com/aergoio/aergo-lib/log" "github.com/aergoio/aergo/v2/config" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pkey" "github.com/aergoio/aergo/v2/pkg/component" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" ) const ( diff --git a/p2p/raftsupport/clusterreceiver.go b/p2p/raftsupport/clusterreceiver.go index 12af9e1cc..970cd214d 100644 --- a/p2p/raftsupport/clusterreceiver.go +++ b/p2p/raftsupport/clusterreceiver.go @@ -11,9 +11,9 @@ import ( "time" "github.com/aergoio/aergo/v2/internal/enc/proto" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "github.com/pkg/errors" ) diff --git a/p2p/raftsupport/clusterreceiver_test.go b/p2p/raftsupport/clusterreceiver_test.go index 8de5a8d4d..4e55cbfbf 100644 --- a/p2p/raftsupport/clusterreceiver_test.go +++ b/p2p/raftsupport/clusterreceiver_test.go @@ -11,10 +11,10 @@ import ( "testing" "time" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2pmock" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "github.com/golang/mock/gomock" ) diff --git a/p2p/raftsupport/concclusterreceiver.go b/p2p/raftsupport/concclusterreceiver.go index 0ff67c134..75e271b16 100644 --- a/p2p/raftsupport/concclusterreceiver.go +++ b/p2p/raftsupport/concclusterreceiver.go @@ -12,10 +12,10 @@ import ( "github.com/aergoio/aergo-lib/log" "github.com/aergoio/aergo/v2/internal/enc/proto" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2putil" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "github.com/pkg/errors" ) diff --git a/p2p/raftsupport/concclusterreceiver_test.go b/p2p/raftsupport/concclusterreceiver_test.go index 8ca72bdec..52a92884e 100644 --- a/p2p/raftsupport/concclusterreceiver_test.go +++ b/p2p/raftsupport/concclusterreceiver_test.go @@ -13,11 +13,11 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2pmock" "github.com/aergoio/aergo/v2/p2p/p2putil" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "github.com/golang/mock/gomock" ) diff --git a/p2p/rolemanager.go b/p2p/rolemanager.go index a9d31b4b5..131fad2eb 100644 --- a/p2p/rolemanager.go +++ b/p2p/rolemanager.go @@ -12,10 +12,10 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2putil" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" ) type RaftRoleManager struct { diff --git a/p2p/rolemanager_test.go b/p2p/rolemanager_test.go index 78cb307ed..00026cbf5 100644 --- a/p2p/rolemanager_test.go +++ b/p2p/rolemanager_test.go @@ -11,10 +11,10 @@ import ( "testing" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2pmock" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "github.com/golang/mock/gomock" ) diff --git a/p2p/subproto/block.go b/p2p/subproto/block.go index 00da901f6..dbcb7e588 100644 --- a/p2p/subproto/block.go +++ b/p2p/subproto/block.go @@ -8,10 +8,10 @@ package subproto import ( "github.com/aergoio/aergo-lib/log" "github.com/aergoio/aergo/v2/internal/enc/base58" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2putil" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" ) type getBlockHeadersRequestHandler struct { diff --git a/p2p/subproto/bp.go b/p2p/subproto/bp.go index 3937949e9..33a483044 100644 --- a/p2p/subproto/bp.go +++ b/p2p/subproto/bp.go @@ -8,10 +8,10 @@ package subproto import ( "github.com/aergoio/aergo-lib/log" "github.com/aergoio/aergo/v2/internal/enc/base58" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2putil" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" ) type blockProducedNoticeHandler struct { diff --git a/p2p/subproto/getblock_test.go b/p2p/subproto/getblock_test.go index c4e2a13df..f1f0298d3 100644 --- a/p2p/subproto/getblock_test.go +++ b/p2p/subproto/getblock_test.go @@ -11,10 +11,10 @@ import ( "github.com/aergoio/aergo-lib/log" "github.com/aergoio/aergo/v2/internal/enc/base58" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2pmock" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" ) diff --git a/p2p/subproto/tx.go b/p2p/subproto/tx.go index f3ef230cd..5af1215f1 100644 --- a/p2p/subproto/tx.go +++ b/p2p/subproto/tx.go @@ -8,10 +8,10 @@ package subproto import ( "github.com/aergoio/aergo-lib/log" "github.com/aergoio/aergo/v2/internal/enc/base58" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2putil" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" ) type txRequestHandler struct { diff --git a/p2p/subproto/tx_test.go b/p2p/subproto/tx_test.go index 8b3e09aba..fa8973314 100644 --- a/p2p/subproto/tx_test.go +++ b/p2p/subproto/tx_test.go @@ -11,9 +11,9 @@ import ( "github.com/aergoio/aergo-lib/log" "github.com/aergoio/aergo/v2/internal/enc/base58" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pmock" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "github.com/gofrs/uuid" "github.com/golang/mock/gomock" ) diff --git a/p2p/syncmanager.go b/p2p/syncmanager.go index c5d481501..f73728a2f 100644 --- a/p2p/syncmanager.go +++ b/p2p/syncmanager.go @@ -10,10 +10,10 @@ import ( "github.com/aergoio/aergo-lib/log" "github.com/aergoio/aergo/v2/chain" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2putil" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" lru "github.com/hashicorp/golang-lru" ) diff --git a/p2p/syncmanager_test.go b/p2p/syncmanager_test.go index 65ef98614..db63a888d 100644 --- a/p2p/syncmanager_test.go +++ b/p2p/syncmanager_test.go @@ -11,10 +11,10 @@ import ( "github.com/aergoio/aergo-lib/log" "github.com/aergoio/aergo/v2/chain" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2pmock" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "github.com/golang/mock/gomock" "github.com/stretchr/testify/mock" ) diff --git a/p2p/synctx.go b/p2p/synctx.go index 6eeda2708..52526fedd 100644 --- a/p2p/synctx.go +++ b/p2p/synctx.go @@ -9,11 +9,11 @@ import ( "github.com/aergoio/aergo-lib/log" "github.com/aergoio/aergo/v2/internal/enc/proto" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2putil" "github.com/aergoio/aergo/v2/p2p/subproto" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" lru "github.com/hashicorp/golang-lru" ) diff --git a/p2p/synctx_test.go b/p2p/synctx_test.go index 5e79a27f6..fdcaf5c14 100644 --- a/p2p/synctx_test.go +++ b/p2p/synctx_test.go @@ -9,11 +9,11 @@ import ( "github.com/aergoio/aergo-lib/log" "github.com/aergoio/aergo/v2/internal/enc/base58" - "github.com/aergoio/aergo/v2/message" - "github.com/aergoio/aergo/v2/message/messagemock" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2pmock" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" + "github.com/aergoio/aergo/v2/types/message/messagemock" "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" ) diff --git a/p2p/transport/networktransport_test.go b/p2p/transport/networktransport_test.go index 0209773c8..87ea35e7a 100644 --- a/p2p/transport/networktransport_test.go +++ b/p2p/transport/networktransport_test.go @@ -13,11 +13,11 @@ import ( "github.com/aergoio/aergo/v2/config" cfg "github.com/aergoio/aergo/v2/config" "github.com/aergoio/aergo/v2/internal/enc/hex" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2pkey" "github.com/aergoio/aergo/v2/p2p/p2pmock" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "github.com/golang/mock/gomock" ) diff --git a/p2p/txreceiver.go b/p2p/txreceiver.go index 47f77f498..2f4d22fab 100644 --- a/p2p/txreceiver.go +++ b/p2p/txreceiver.go @@ -11,10 +11,10 @@ import ( "github.com/aergoio/aergo-lib/log" "github.com/aergoio/aergo/v2/internal/enc/base58" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2putil" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" ) // GetTxsReceiver is send p2p getTXsRequest to target peer and receive p2p responses till all requests transactions are received diff --git a/p2p/txreceiver_test.go b/p2p/txreceiver_test.go index 8957db1dd..2c94e208e 100644 --- a/p2p/txreceiver_test.go +++ b/p2p/txreceiver_test.go @@ -9,10 +9,10 @@ import ( "testing" "time" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2pmock" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" ) diff --git a/rpc/admin.go b/rpc/admin.go index 064243f3f..31c29ab58 100644 --- a/rpc/admin.go +++ b/rpc/admin.go @@ -9,9 +9,9 @@ import ( "github.com/aergoio/aergo-lib/log" "github.com/aergoio/aergo/v2/config" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/pkg/component" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc" "github.com/opentracing/opentracing-go" "google.golang.org/grpc" diff --git a/rpc/grpcserver.go b/rpc/grpcserver.go index 554efcfe4..f2917e2ac 100644 --- a/rpc/grpcserver.go +++ b/rpc/grpcserver.go @@ -22,11 +22,11 @@ import ( "github.com/aergoio/aergo/v2/chain" "github.com/aergoio/aergo/v2/consensus" "github.com/aergoio/aergo/v2/internal/common" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/metric" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/pkg/component" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "github.com/golang/protobuf/ptypes/timestamp" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/rpc/grpcserver_test.go b/rpc/grpcserver_test.go index f0aad80b9..25f611f7d 100644 --- a/rpc/grpcserver_test.go +++ b/rpc/grpcserver_test.go @@ -15,12 +15,12 @@ import ( "github.com/aergoio/aergo/v2/internal/enc/base58" "github.com/aergoio/aergo/v2/internal/enc/base64" "github.com/aergoio/aergo/v2/internal/enc/hex" - "github.com/aergoio/aergo/v2/message" - "github.com/aergoio/aergo/v2/message/messagemock" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2pmock" "github.com/aergoio/aergo/v2/pkg/component" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" + "github.com/aergoio/aergo/v2/types/message/messagemock" "github.com/golang/mock/gomock" ) diff --git a/rpc/rpc.go b/rpc/rpc.go index 0e885c7cd..37f5626dc 100644 --- a/rpc/rpc.go +++ b/rpc/rpc.go @@ -24,12 +24,12 @@ import ( "github.com/aergoio/aergo/v2/consensus" "github.com/aergoio/aergo/v2/contract/enterprise" "github.com/aergoio/aergo/v2/internal/network" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/aergo/v2/p2p/p2pkey" "github.com/aergoio/aergo/v2/pkg/component" "github.com/aergoio/aergo/v2/types" aergorpc "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc" "github.com/improbable-eng/grpc-web/go/grpcweb" "github.com/opentracing/opentracing-go" diff --git a/rpc/txputter.go b/rpc/txputter.go index b5521a8a2..88db2d207 100644 --- a/rpc/txputter.go +++ b/rpc/txputter.go @@ -8,10 +8,10 @@ import ( "github.com/aergoio/aergo-actor/actor" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2putil" "github.com/aergoio/aergo/v2/pkg/component" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/rpc/txputter_test.go b/rpc/txputter_test.go index 2baf54d77..eae31beed 100644 --- a/rpc/txputter_test.go +++ b/rpc/txputter_test.go @@ -7,10 +7,10 @@ import ( "time" "github.com/aergoio/aergo-actor/actor" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/p2p/p2putil" "github.com/aergoio/aergo/v2/pkg/component" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" ) func Test_txPutter_Commit(t *testing.T) { diff --git a/syncer/blockfetcher.go b/syncer/blockfetcher.go index 9e6c1d541..ac753c2d4 100644 --- a/syncer/blockfetcher.go +++ b/syncer/blockfetcher.go @@ -10,9 +10,9 @@ import ( "time" "github.com/aergoio/aergo/v2/internal/enc/base58" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/pkg/component" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "github.com/rs/zerolog" ) diff --git a/syncer/blockprocessor.go b/syncer/blockprocessor.go index cac892da5..98d8facb0 100644 --- a/syncer/blockprocessor.go +++ b/syncer/blockprocessor.go @@ -7,9 +7,9 @@ import ( "github.com/aergoio/aergo/v2/chain" "github.com/aergoio/aergo/v2/internal/enc/base58" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/pkg/component" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" ) type BlockProcessor struct { diff --git a/syncer/finder.go b/syncer/finder.go index a99ae1fe9..81d9751b1 100644 --- a/syncer/finder.go +++ b/syncer/finder.go @@ -7,9 +7,9 @@ import ( "github.com/aergoio/aergo/v2/chain" "github.com/aergoio/aergo/v2/internal/enc/base58" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/pkg/component" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "github.com/pkg/errors" ) diff --git a/syncer/finder_test.go b/syncer/finder_test.go index 2687e90b8..d5de0bede 100644 --- a/syncer/finder_test.go +++ b/syncer/finder_test.go @@ -5,7 +5,7 @@ import ( "time" "github.com/aergoio/aergo/v2/chain" - "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/types/message" ) func testFullscanSucceed(t *testing.T, expAncestor uint64) { diff --git a/syncer/hashfetcher.go b/syncer/hashfetcher.go index 4097b4eae..d7d2c17b2 100644 --- a/syncer/hashfetcher.go +++ b/syncer/hashfetcher.go @@ -5,9 +5,9 @@ import ( "time" "github.com/aergoio/aergo/v2/internal/enc/base58" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/pkg/component" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "github.com/pkg/errors" ) diff --git a/syncer/hashfetcher_test.go b/syncer/hashfetcher_test.go index 2663ff1a3..5a6726045 100644 --- a/syncer/hashfetcher_test.go +++ b/syncer/hashfetcher_test.go @@ -5,8 +5,8 @@ import ( "time" "github.com/aergoio/aergo/v2/chain" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" ) func TestHashFetcher_normal(t *testing.T) { diff --git a/syncer/stubsyncer.go b/syncer/stubsyncer.go index 0558f93d3..48c77b67d 100644 --- a/syncer/stubsyncer.go +++ b/syncer/stubsyncer.go @@ -10,9 +10,9 @@ import ( "github.com/aergoio/aergo-actor/actor" "github.com/aergoio/aergo/v2/chain" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/pkg/component" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "github.com/stretchr/testify/assert" ) diff --git a/syncer/stubsyncerchain.go b/syncer/stubsyncerchain.go index e729d1019..3dc80f2ab 100644 --- a/syncer/stubsyncerchain.go +++ b/syncer/stubsyncerchain.go @@ -5,8 +5,8 @@ import ( "time" "github.com/aergoio/aergo/v2/chain" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" ) type StubPeer struct { diff --git a/syncer/syncerservice.go b/syncer/syncerservice.go index 7a5624cae..72c8f67d8 100644 --- a/syncer/syncerservice.go +++ b/syncer/syncerservice.go @@ -11,9 +11,9 @@ import ( "github.com/aergoio/aergo-lib/log" "github.com/aergoio/aergo/v2/chain" cfg "github.com/aergoio/aergo/v2/config" - "github.com/aergoio/aergo/v2/message" "github.com/aergoio/aergo/v2/pkg/component" "github.com/aergoio/aergo/v2/types" + "github.com/aergoio/aergo/v2/types/message" "github.com/pkg/errors" ) diff --git a/syncer/syncerservice_test.go b/syncer/syncerservice_test.go index 16193ad61..feb165343 100644 --- a/syncer/syncerservice_test.go +++ b/syncer/syncerservice_test.go @@ -6,7 +6,7 @@ import ( "time" "github.com/aergoio/aergo/v2/chain" - "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/types/message" "github.com/stretchr/testify/assert" ) diff --git a/message/accountmsg.go b/types/message/accountmsg.go similarity index 100% rename from message/accountmsg.go rename to types/message/accountmsg.go diff --git a/message/blockchainmsg.go b/types/message/blockchainmsg.go similarity index 100% rename from message/blockchainmsg.go rename to types/message/blockchainmsg.go diff --git a/message/mapmsg.go b/types/message/mapmsg.go similarity index 100% rename from message/mapmsg.go rename to types/message/mapmsg.go diff --git a/message/mempoolmsg.go b/types/message/mempoolmsg.go similarity index 100% rename from message/mempoolmsg.go rename to types/message/mempoolmsg.go diff --git a/message/messagemock/helper.go b/types/message/messagemock/helper.go similarity index 100% rename from message/messagemock/helper.go rename to types/message/messagemock/helper.go diff --git a/message/msghelper.go b/types/message/msghelper.go similarity index 100% rename from message/msghelper.go rename to types/message/msghelper.go diff --git a/message/p2pmsg.go b/types/message/p2pmsg.go similarity index 100% rename from message/p2pmsg.go rename to types/message/p2pmsg.go diff --git a/message/pmapmsg.go b/types/message/pmapmsg.go similarity index 100% rename from message/pmapmsg.go rename to types/message/pmapmsg.go diff --git a/message/restmsg.go b/types/message/restmsg.go similarity index 100% rename from message/restmsg.go rename to types/message/restmsg.go diff --git a/message/rpcmsg.go b/types/message/rpcmsg.go similarity index 100% rename from message/rpcmsg.go rename to types/message/rpcmsg.go diff --git a/message/syncermsg.go b/types/message/syncermsg.go similarity index 100% rename from message/syncermsg.go rename to types/message/syncermsg.go