diff --git a/Dockerfile b/Dockerfile index 0d1c6bf7e..160a732e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,7 @@ ADD bin/neo-go /usr/bin/neo-go ADD config /config RUN chmod u+x /usr/bin/neo-go +RUN mkdir -p /chains ENTRYPOINT ["neo-go"] CMD ["node", "--config-path", "./config", "--testnet"] diff --git a/Makefile b/Makefile index 1f2c1cc14..ae2710240 100644 --- a/Makefile +++ b/Makefile @@ -5,14 +5,25 @@ REPONAME = "neo-go" NETMODE ?= "privnet" build: - @go build -ldflags "-X github.com/CityOfZion/neo-go/config.Version=${VERSION}-dev -X github.com/CityOfZion/neo-go/config.BuildTime=${BUILD_TIME}" -o ./bin/neo-go ./cli/main.go + @echo "=> Building darwin binary" + @go build -i -ldflags "-X github.com/CityOfZion/neo-go/config.Version=${VERSION}-dev -X github.com/CityOfZion/neo-go/config.BuildTime=${BUILD_TIME}" -o ./bin/neo-go ./cli/main.go build-image: docker build -t cityofzion/neo-go --build-arg VERSION=${VERSION} . +build-linux: + @echo "=> Building linux binary" + @GOOS=linux go build -i -ldflags "-X github.com/CityOfZion/neo-go/config.Version=${VERSION}-dev -X github.com/CityOfZion/neo-go/config.BuildTime=${BUILD_TIME}" -o ./bin/neo-go ./cli/main.go + check-version: git fetch && (! git rev-list ${VERSION}) +clean-cluster: + @echo "=> Removing all containers and chain storage" + @rm -rf chains/privnet-docker-one chains/privnet-docker-two chains/privnet-docker-three chains/privnet-docker-four + @docker-compose stop + @docker-compose rm -f + deps: @dep ensure @@ -31,6 +42,14 @@ push-to-registry: run: build ./bin/neo-go node -config-path ./config -${NETMODE} +run-cluster: build-linux + @echo "=> Starting docker-compose cluster" + @echo "=> Building container image" + @docker-compose build + @docker-compose up -d + @echo "=> Tailing logs, exiting this prompt will not stop the cluster" + @docker-compose logs -f + test: @go test ./... -cover diff --git a/VERSION b/VERSION index 787ffc30a..8298bb08b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.42.0 +0.43.0 diff --git a/config/protocol.privnet.docker.four.yml b/config/protocol.privnet.docker.four.yml new file mode 100644 index 000000000..425a7035b --- /dev/null +++ b/config/protocol.privnet.docker.four.yml @@ -0,0 +1,26 @@ +ProtocolConfiguration: + Magic: 56753 + AddressVersion: 23 + StandbyValidators: + - 02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2 + - 02103a7f7dd016558597f7960d27c516a4394fd968b9e65155eb4b013e4040406e + - 03d90c07df63e690ce77912e10ab51acc944b66860237b608c4f8f8309e71ee699 + - 02a7bc55fe8684e0119768d104ba30795bdcc86619e864add26156723ed185cd62 + SeedList: + - node_one:20334 + - node_two:20335 + - node_three:20336 + SystemFee: + EnrollmentTransaction: 1000 + IssueTransaction: 500 + PublishTransaction: 500 + RegisterTransaction: 10000 + +ApplicationConfiguration: + DataDirectoryPath: "/chains/privnet" + RPCPort: 20336 + NodePort: 20337 + Relay: true + DialTimeout: 3 + ProtoTickInterval: 2 + MaxPeers: 50 diff --git a/config/protocol.privnet.docker.one.yml b/config/protocol.privnet.docker.one.yml new file mode 100644 index 000000000..41ad3039e --- /dev/null +++ b/config/protocol.privnet.docker.one.yml @@ -0,0 +1,23 @@ +ProtocolConfiguration: + Magic: 56753 + AddressVersion: 23 + StandbyValidators: + - 02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2 + - 02103a7f7dd016558597f7960d27c516a4394fd968b9e65155eb4b013e4040406e + - 03d90c07df63e690ce77912e10ab51acc944b66860237b608c4f8f8309e71ee699 + - 02a7bc55fe8684e0119768d104ba30795bdcc86619e864add26156723ed185cd62 + SeedList: [] + SystemFee: + EnrollmentTransaction: 1000 + IssueTransaction: 500 + PublishTransaction: 500 + RegisterTransaction: 10000 + +ApplicationConfiguration: + DataDirectoryPath: "/chains/privnet" + RPCPort: 20333 + NodePort: 20334 + Relay: true + DialTimeout: 3 + ProtoTickInterval: 2 + MaxPeers: 50 diff --git a/config/protocol.privnet.docker.three.yml b/config/protocol.privnet.docker.three.yml new file mode 100644 index 000000000..2547d50ce --- /dev/null +++ b/config/protocol.privnet.docker.three.yml @@ -0,0 +1,23 @@ +ProtocolConfiguration: + Magic: 56753 + AddressVersion: 23 + StandbyValidators: + - 02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2 + - 02103a7f7dd016558597f7960d27c516a4394fd968b9e65155eb4b013e4040406e + - 03d90c07df63e690ce77912e10ab51acc944b66860237b608c4f8f8309e71ee699 + - 02a7bc55fe8684e0119768d104ba30795bdcc86619e864add26156723ed185cd62 + SeedList: [] + SystemFee: + EnrollmentTransaction: 1000 + IssueTransaction: 500 + PublishTransaction: 500 + RegisterTransaction: 10000 + +ApplicationConfiguration: + DataDirectoryPath: "/chains/privnet" + RPCPort: 20335 + NodePort: 20336 + Relay: true + DialTimeout: 3 + ProtoTickInterval: 2 + MaxPeers: 50 diff --git a/config/protocol.privnet.docker.two.yml b/config/protocol.privnet.docker.two.yml new file mode 100644 index 000000000..5c6e77942 --- /dev/null +++ b/config/protocol.privnet.docker.two.yml @@ -0,0 +1,23 @@ +ProtocolConfiguration: + Magic: 56753 + AddressVersion: 23 + StandbyValidators: + - 02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2 + - 02103a7f7dd016558597f7960d27c516a4394fd968b9e65155eb4b013e4040406e + - 03d90c07df63e690ce77912e10ab51acc944b66860237b608c4f8f8309e71ee699 + - 02a7bc55fe8684e0119768d104ba30795bdcc86619e864add26156723ed185cd62 + SeedList: [] + SystemFee: + EnrollmentTransaction: 1000 + IssueTransaction: 500 + PublishTransaction: 500 + RegisterTransaction: 10000 + +ApplicationConfiguration: + DataDirectoryPath: "/chains/privnet" + RPCPort: 20334 + NodePort: 20335 + Relay: true + DialTimeout: 3 + ProtoTickInterval: 2 + MaxPeers: 50 diff --git a/config/protocol.privnet.yml b/config/protocol.privnet.yml index e8765d95d..adbb30d70 100644 --- a/config/protocol.privnet.yml +++ b/config/protocol.privnet.yml @@ -7,7 +7,6 @@ ProtocolConfiguration: - 03d90c07df63e690ce77912e10ab51acc944b66860237b608c4f8f8309e71ee699 - 02a7bc55fe8684e0119768d104ba30795bdcc86619e864add26156723ed185cd62 SeedList: - - 127.0.0.1:20333 - 127.0.0.1:20334 - 127.0.0.1:20335 - 127.0.0.1:20336 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..605351961 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,38 @@ +version: '3' +services: + node_one: + build: . + volumes: + - ./config/protocol.privnet.docker.one.yml:/config/protocol.privnet.yml + - ./chains/privnet-docker-one:/chains/privnet + ports: + - 20334:20334 + command: "node --config-path /config --privnet" + node_two: + build: . + volumes: + - ./config/protocol.privnet.docker.two.yml:/config/protocol.privnet.yml + - ./chains/privnet-docker-two:/chains/privnet + ports: + - 20335:20335 + command: "node --config-path /config --privnet" + node_three: + build: . + volumes: + - ./config/protocol.privnet.docker.three.yml:/config/protocol.privnet.yml + - ./chains/privnet-docker-three:/chains/privnet + ports: + - 20336:20336 + command: "node --config-path /config --privnet" + node_four: + build: . + volumes: + - ./config/protocol.privnet.docker.four.yml:/config/protocol.privnet.yml + - ./chains/privnet-docker-four:/chains/privnet + ports: + - 20337:20337 + command: "node --config-path /config --privnet" + depends_on: + - node_one + - node_two + - node_three