From ba39ff2c332edd61b1c4855296e30828dd97bef6 Mon Sep 17 00:00:00 2001 From: Guilherme Sperb Machado Date: Tue, 24 Mar 2020 00:38:09 +0100 Subject: [PATCH] Add first version of docker-compose and git sub-modules --- .gitmodules | 6 +++ README.md | 17 ++++++++ config/config.privatenet3-client.json | 28 +++++++++++++ config/config.privatenet3-consensus.json | 28 +++++++++++++ config/protocol.privatenet3-client.json | 13 ++++++ config/protocol.privatenet3-consensus.json | 13 ++++++ config/wallet.privatenet3.json | 48 ++++++++++++++++++++++ docker-compose.yml | 40 ++++++++++++++++++ docker/Dockerfile | 10 +++++ neo-modules | 1 + neo-node | 1 + 11 files changed, 205 insertions(+) create mode 100644 .gitmodules create mode 100644 README.md create mode 100644 config/config.privatenet3-client.json create mode 100644 config/config.privatenet3-consensus.json create mode 100644 config/protocol.privatenet3-client.json create mode 100644 config/protocol.privatenet3-consensus.json create mode 100644 config/wallet.privatenet3.json create mode 100644 docker-compose.yml create mode 100644 docker/Dockerfile create mode 160000 neo-modules create mode 160000 neo-node diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..557dd1f --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "neo-node"] + path = neo-node + url = https://github.com/neo-project/neo-node.git +[submodule "neo-modules"] + path = neo-modules + url = https://github.com/neo-project/neo-modules.git diff --git a/README.md b/README.md new file mode 100644 index 0000000..3a1225c --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +# neo3-privatenet-docker + +:fire::fire::fire::fire: + +Are you ready? Are you really ready? + +This is the **ULTIMATE** GitHub repository to run your Neo3 blockchain node and start developing! :green_heart: + +:tada: + +## How to run + +TBD. + +## Thanks + +We have to thank [hal0x2328](https://github.com/hal0x2328) for publishing [hal0x2328/neo3-privatenet-tutorial](https://github.com/hal0x2328/neo3-privatenet-tutorial) and inspiring us to make things even simpler. :-) \ No newline at end of file diff --git a/config/config.privatenet3-client.json b/config/config.privatenet3-client.json new file mode 100644 index 0000000..5ec1995 --- /dev/null +++ b/config/config.privatenet3-client.json @@ -0,0 +1,28 @@ +{ + "ApplicationConfiguration": { + "Storage": { + "Engine": "MemoryStore" + }, + "Paths": { + "Chain": "Client_Chain_{0}", + }, + "P2P": { + "Port": 50333, + "WsPort": 50334 + }, + "RPC": { + "BindAddress": "127.0.0.1", + "Port": 50332, + "SslCert": "", + "SslCertPassword": "", + "MaxGasInvoke": 10 + }, + "UnlockWallet": { + "Path": "wallet.json", + "Password": "one", + "StartConsensus": false, + "IsActive": false + }, + "PluginURL": "https://github.com/neo-project/neo-plugins/releases/download/v{1}/{0}.zip" + } +} diff --git a/config/config.privatenet3-consensus.json b/config/config.privatenet3-consensus.json new file mode 100644 index 0000000..c3171ee --- /dev/null +++ b/config/config.privatenet3-consensus.json @@ -0,0 +1,28 @@ +{ + "ApplicationConfiguration": { + "Storage": { + "Engine": "MemoryStore" + }, + "Paths": { + "Chain": "Consensus_Chain_{0}", + }, + "P2P": { + "Port": 40333, + "WsPort": 40334 + }, + "RPC": { + "BindAddress": "127.0.0.1", + "Port": 40332, + "SslCert": "", + "SslCertPassword": "", + "MaxGasInvoke": 10 + }, + "UnlockWallet": { + "Path": "wallet.json", + "Password": "one", + "StartConsensus": true, + "IsActive": true + }, + "PluginURL": "https://github.com/neo-project/neo-plugins/releases/download/v{1}/{0}.zip" + } +} diff --git a/config/protocol.privatenet3-client.json b/config/protocol.privatenet3-client.json new file mode 100644 index 0000000..8985e6c --- /dev/null +++ b/config/protocol.privatenet3-client.json @@ -0,0 +1,13 @@ +{ + "ProtocolConfiguration": { + "Magic": 769, + "AddressVersion": 23, + "MillisecondsPerBlock": 15000, + "StandbyValidators": [ + "03f1ec3c1e283e880de6e9c489f0f27c19007c53385aaa4c0c917c320079edadf2", + ], + "SeedList": [ + "neo-consensus:40333", + ] + } +} \ No newline at end of file diff --git a/config/protocol.privatenet3-consensus.json b/config/protocol.privatenet3-consensus.json new file mode 100644 index 0000000..6a36551 --- /dev/null +++ b/config/protocol.privatenet3-consensus.json @@ -0,0 +1,13 @@ +{ + "ProtocolConfiguration": { + "Magic": 769, + "AddressVersion": 23, + "MillisecondsPerBlock": 15000, + "StandbyValidators": [ + "03f1ec3c1e283e880de6e9c489f0f27c19007c53385aaa4c0c917c320079edadf2", + ], + "SeedList": [ + "localhost:40333", + ] + } +} \ No newline at end of file diff --git a/config/wallet.privatenet3.json b/config/wallet.privatenet3.json new file mode 100644 index 0000000..53fd1d4 --- /dev/null +++ b/config/wallet.privatenet3.json @@ -0,0 +1,48 @@ +{ + "name": null, + "version": "3.0", + "scrypt": { + "n": 16384, + "r": 8, + "p": 8 + }, + "accounts": [ + { + "address": "AK5AmzrrM3sw3kbCHXpHNeuK3kkjnneUrb", + "label": null, + "isDefault": false, + "lock": false, + "key": "6PYLVq2QgQqEdzP6cZRLSQyTbDzw1BqF2qCsE9duWEWj7bgmmPVAG9QQBn", + "contract": { + "script": "DCED8ew8Hig+iA3m6cSJ8PJ8GQB8UzhaqkwMkXwyAHntrfILQQqQatQ=", + "parameters": [ + { + "name": "signature", + "type": "Signature" + } + ], + "deployed": false + }, + "extra": null + }, + { + "address": "AHE5cLhX5NjGB5R2PcdUvGudUoGUBDeHX4", + "label": null, + "isDefault": false, + "lock": false, + "key": "6PYLVq2QgQqEdzP6cZRLSQyTbDzw1BqF2qCsE9duWEWj7bgmmPVAG9QQBn", + "contract": { + "script": "EQwhA/HsPB4oPogN5unEifDyfBkAfFM4WqpMDJF8MgB57a3yEQtBMHOzuw==", + "parameters": [ + { + "name": "parameter0", + "type": "Signature" + } + ], + "deployed": false + }, + "extra": null + } + ], + "extra": null +} \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..d83e616 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,40 @@ +version: '3.6' + +services: + + build-neo-cli: + build: ./neo-node + image: neo-project/neo-node/neo-cli:latest + + neo-consensus: + build: + context: ./neo-modules + dockerfile: ../docker/Dockerfile + target: NeoCliFinal + image: docker.pkg.github.com/axlabs/neo3-privatenet-docker/neo-cli-with-plugins:latest + hostname: neo-consensus + depends_on: + - build-neo-cli + volumes: + - ./config/config.privatenet3-consensus.json:/neo-cli/config.json:ro + - ./config/protocol.privatenet3-consensus.json:/neo-cli/protocol.json:ro + - ./config/wallet.privatenet3.json:/neo-cli/wallet.json:ro + ports: + - "40332:40332" + + neo-client: + build: + context: ./neo-modules + dockerfile: ../docker/Dockerfile + target: NeoCliFinal + image: docker.pkg.github.com/axlabs/neo3-privatenet-docker/neo-cli-with-plugins:latest + hostname: neo-client + depends_on: + - build-neo-cli + - neo-consensus + volumes: + - ./config/config.privatenet3-client.json:/neo-cli/config.json:ro + - ./config/protocol.privatenet3-client.json:/neo-cli/protocol.json:ro + - ./config/wallet.privatenet3.json:/neo-cli/wallet.json:ro + ports: + - "50332:50332" \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..01e37ce --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,10 @@ +FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS PluginBuild + +COPY ./ /neo-modules + +WORKDIR /neo-modules +RUN dotnet restore && dotnet publish -c Release -o /plugins + +FROM neo-project/neo-node/neo-cli:latest AS NeoCliFinal + +COPY --from=PluginBuild /plugins ./Plugins \ No newline at end of file diff --git a/neo-modules b/neo-modules new file mode 160000 index 0000000..bbcfa56 --- /dev/null +++ b/neo-modules @@ -0,0 +1 @@ +Subproject commit bbcfa56171a931c1c6f2b50f9289350dd7c052c0 diff --git a/neo-node b/neo-node new file mode 160000 index 0000000..e81556e --- /dev/null +++ b/neo-node @@ -0,0 +1 @@ +Subproject commit e81556e06943eafcb66e400d7194eb6d876f16d1