├── .gitignore ├── .env ├── .gitmodules ├── .gitattributes ├── docker ├── Dockerfile.neo-go-with-tools └── Dockerfile.neo-node-with-plugins ├── config ├── storagedumper.config-client1.json ├── storagedumper.config-client2.json ├── storagedumper.config-consensus.json ├── applicationlogs.config-client1.json ├── applicationlogs.config-client2.json ├── applicationlogs.config-consensus.json ├── dbft.config-consensus.json ├── stateservice.config-client1.json ├── stateservice.config-client2.json ├── stateservice.config-consensus.json ├── tokentracker.config-client1.json ├── tokentracker.config-client2.json ├── tokentracker.config-consensus.json ├── oracle.config-consensus.json ├── oracle.config-client1.json ├── oracle.config-client2.json ├── wallet-client1.privatenet3.json ├── wallet-client2.privatenet3.json ├── rpcserver.config-client1.json ├── rpcserver.config-client2.json ├── rpcserver.config-consensus.json ├── config-client1.privatenet3.json ├── config-client2.privatenet3.json ├── config-consensus.privatenet3.json └── wallet-consensus.privatenet3.json ├── .github ├── actions │ └── load-env │ │ └── action.yml └── workflows │ └── build.yml ├── .devcontainer └── devcontainer.json ├── scripts └── wait_and_invoke.sh ├── http └── client.http ├── docker-compose.yml ├── README.md └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | neo-node/neo 3 | -------------------------------------------------------------------------------- /.env: -------------------------------------------------------------------------------- 1 | IMAGE_TAG=neo-node-3.8.2 2 | NEO_GO_VERSION=0.109.0 3 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "neo"] 2 | path = neo 3 | url = https://github.com/neo-project/neo 4 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Declare files that will always have LF line endings on checkout. 2 | wait_and_invoke.sh text eol=lf -------------------------------------------------------------------------------- /docker/Dockerfile.neo-go-with-tools: -------------------------------------------------------------------------------- 1 | ARG NEO_GO_VERSION=latest 2 | 3 | FROM nspccdev/neo-go:${NEO_GO_VERSION} 4 | 5 | RUN apk update && apk add curl netcat-openbsd jq 6 | 7 | -------------------------------------------------------------------------------- /config/storagedumper.config-client1.json: -------------------------------------------------------------------------------- 1 | { 2 | "PluginConfiguration": { 3 | "BlockCacheSize": 1000, 4 | "HeightToBegin": 0, 5 | "Exclude": [ -4 ] 6 | } 7 | } -------------------------------------------------------------------------------- /config/storagedumper.config-client2.json: -------------------------------------------------------------------------------- 1 | { 2 | "PluginConfiguration": { 3 | "BlockCacheSize": 1000, 4 | "HeightToBegin": 0, 5 | "Exclude": [ -4 ] 6 | } 7 | } -------------------------------------------------------------------------------- /config/storagedumper.config-consensus.json: -------------------------------------------------------------------------------- 1 | { 2 | "PluginConfiguration": { 3 | "BlockCacheSize": 1000, 4 | "HeightToBegin": 0, 5 | "Exclude": [ -4 ] 6 | } 7 | } -------------------------------------------------------------------------------- /config/applicationlogs.config-client1.json: -------------------------------------------------------------------------------- 1 | { 2 | "PluginConfiguration": { 3 | "Path": "ApplicationLogs_{0}", 4 | "Network": 5195086, 5 | "MaxStackSize": 65535, 6 | "Debug": false 7 | }, 8 | "Dependency": [ 9 | "RpcServer" 10 | ] 11 | } -------------------------------------------------------------------------------- /config/applicationlogs.config-client2.json: -------------------------------------------------------------------------------- 1 | { 2 | "PluginConfiguration": { 3 | "Path": "ApplicationLogs_{0}", 4 | "Network": 5195086, 5 | "MaxStackSize": 65535, 6 | "Debug": false 7 | }, 8 | "Dependency": [ 9 | "RpcServer" 10 | ] 11 | } -------------------------------------------------------------------------------- /config/applicationlogs.config-consensus.json: -------------------------------------------------------------------------------- 1 | { 2 | "PluginConfiguration": { 3 | "Path": "ApplicationLogs_{0}", 4 | "Network": 5195086, 5 | "MaxStackSize": 65535, 6 | "Debug": false 7 | }, 8 | "Dependency": [ 9 | "RpcServer" 10 | ] 11 | } -------------------------------------------------------------------------------- /config/dbft.config-consensus.json: -------------------------------------------------------------------------------- 1 | { 2 | "PluginConfiguration": { 3 | "RecoveryLogs": "ConsensusState", 4 | "IgnoreRecoveryLogs": false, 5 | "AutoStart": true, 6 | "Network": 5195086, 7 | "MaxBlockSize": 2102400, 8 | "MaxBlockSystemFee": 900000000000 9 | } 10 | } -------------------------------------------------------------------------------- /config/stateservice.config-client1.json: -------------------------------------------------------------------------------- 1 | { 2 | "PluginConfiguration": { 3 | "Path": "Data_MPT_{0}", 4 | "FullState": false, 5 | "Network": 5195086, 6 | "AutoVerify": false, 7 | "MaxFindResultItems": 100 8 | }, 9 | "Dependency": [ 10 | "RpcServer" 11 | ] 12 | } -------------------------------------------------------------------------------- /config/stateservice.config-client2.json: -------------------------------------------------------------------------------- 1 | { 2 | "PluginConfiguration": { 3 | "Path": "Data_MPT_{0}", 4 | "FullState": false, 5 | "Network": 5195086, 6 | "AutoVerify": false, 7 | "MaxFindResultItems": 100 8 | }, 9 | "Dependency": [ 10 | "RpcServer" 11 | ] 12 | } -------------------------------------------------------------------------------- /config/stateservice.config-consensus.json: -------------------------------------------------------------------------------- 1 | { 2 | "PluginConfiguration": { 3 | "Path": "Data_MPT_{0}", 4 | "FullState": false, 5 | "Network": 5195086, 6 | "AutoVerify": false, 7 | "MaxFindResultItems": 100 8 | }, 9 | "Dependency": [ 10 | "RpcServer" 11 | ] 12 | } -------------------------------------------------------------------------------- /config/tokentracker.config-client1.json: -------------------------------------------------------------------------------- 1 | { 2 | "PluginConfiguration": { 3 | "DBPath": "TokenBalanceData", 4 | "TrackHistory": true, 5 | "MaxResults": 1000, 6 | "Network": 5195086, 7 | "EnabledTrackers": [ 8 | "NEP-11", 9 | "NEP-17" 10 | ] 11 | }, 12 | "Dependency": [ 13 | "RpcServer" 14 | ] 15 | } -------------------------------------------------------------------------------- /config/tokentracker.config-client2.json: -------------------------------------------------------------------------------- 1 | { 2 | "PluginConfiguration": { 3 | "DBPath": "TokenBalanceData", 4 | "TrackHistory": true, 5 | "MaxResults": 1000, 6 | "Network": 5195086, 7 | "EnabledTrackers": [ 8 | "NEP-11", 9 | "NEP-17" 10 | ] 11 | }, 12 | "Dependency": [ 13 | "RpcServer" 14 | ] 15 | } -------------------------------------------------------------------------------- /config/tokentracker.config-consensus.json: -------------------------------------------------------------------------------- 1 | { 2 | "PluginConfiguration": { 3 | "DBPath": "TokenBalanceData", 4 | "TrackHistory": true, 5 | "MaxResults": 1000, 6 | "Network": 5195086, 7 | "EnabledTrackers": [ 8 | "NEP-11", 9 | "NEP-17" 10 | ] 11 | }, 12 | "Dependency": [ 13 | "RpcServer" 14 | ] 15 | } -------------------------------------------------------------------------------- /.github/actions/load-env/action.yml: -------------------------------------------------------------------------------- 1 | name: 'Load .env' 2 | description: 'Loads variables from .env file' 3 | 4 | outputs: 5 | image-tag: 6 | description: 'Base image id' 7 | value: ${{ steps.loadenv.outputs.IMAGE_TAG }} 8 | 9 | runs: 10 | using: "composite" 11 | steps: 12 | - name: Load .env 13 | id: loadenv 14 | run: | 15 | set -o allexport; source .env; set +o allexport 16 | echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_OUTPUT 17 | shell: bash -------------------------------------------------------------------------------- /config/oracle.config-consensus.json: -------------------------------------------------------------------------------- 1 | { 2 | "PluginConfiguration": { 3 | "Network": 5195086, 4 | "Nodes": [], 5 | "MaxTaskTimeout": 432000000, 6 | "MaxOracleTimeout": 10000, 7 | "AllowPrivateHost": false, 8 | "AllowedContentTypes": [ "application/json" ], 9 | "Https": { 10 | "Timeout": 5000 11 | }, 12 | "NeoFS": { 13 | "EndPoint": "http://127.0.0.1:8080", 14 | "Timeout": 15000 15 | }, 16 | "AutoStart": false 17 | }, 18 | "Dependency": [ 19 | "RpcServer" 20 | ] 21 | } -------------------------------------------------------------------------------- /config/oracle.config-client1.json: -------------------------------------------------------------------------------- 1 | { 2 | "PluginConfiguration": { 3 | "Network": 5195086, 4 | "Nodes": [ 5 | "http://neo-client2:20332" 6 | ], 7 | "MaxTaskTimeout": 432000000, 8 | "MaxOracleTimeout": 10000, 9 | "AllowPrivateHost": false, 10 | "AllowedContentTypes": [ "application/json" ], 11 | "Https": { 12 | "Timeout": 5000 13 | }, 14 | "NeoFS": { 15 | "EndPoint": "http://127.0.0.1:8080", 16 | "Timeout": 15000 17 | }, 18 | "AutoStart": true 19 | }, 20 | "Dependency": [ 21 | "RpcServer" 22 | ] 23 | } -------------------------------------------------------------------------------- /config/oracle.config-client2.json: -------------------------------------------------------------------------------- 1 | { 2 | "PluginConfiguration": { 3 | "Network": 5195086, 4 | "Nodes": [ 5 | "http://neo-client1:10332" 6 | ], 7 | "MaxTaskTimeout": 432000000, 8 | "MaxOracleTimeout": 10000, 9 | "AllowPrivateHost": false, 10 | "AllowedContentTypes": [ "application/json" ], 11 | "Https": { 12 | "Timeout": 5000 13 | }, 14 | "NeoFS": { 15 | "EndPoint": "http://127.0.0.1:8080", 16 | "Timeout": 15000 17 | }, 18 | "AutoStart": true 19 | }, 20 | "Dependency": [ 21 | "RpcServer" 22 | ] 23 | } -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "neo3-privatenet-docker", 3 | "image": "ghcr.io/axlabs/yaky-images/neo-neow3j", 4 | "postCreateCommand": "echo 'Starting your neo3-privatenet-docker...' && docker-compose up", 5 | "forwardPorts": [ 10332, 20332, 40332 ], 6 | "portsAttributes": { 7 | "40332": { 8 | "label": "neo-consensus", 9 | "onAutoForward": "silent" 10 | }, 11 | "10332": { 12 | "label": "neo-client1", 13 | "onAutoForward": "silent" 14 | }, 15 | "20332": { 16 | "label": "neo-client2", 17 | "onAutoForward": "silent" 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /config/wallet-client1.privatenet3.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": null, 3 | "version": "1.0", 4 | "scrypt": { 5 | "n": 16384, 6 | "r": 8, 7 | "p": 8 8 | }, 9 | "accounts": [ 10 | { 11 | "address": "NV1Q1dTdvzPbThPbSFz7zudTmsmgnCwX6c", 12 | "label": null, 13 | "isDefault": false, 14 | "lock": false, 15 | "key": "6PYWaAbWpf6oeH1VrqtdAGawYMsTfcN1GJyarhUFVEq1siNcRJwMpoo456", 16 | "contract": { 17 | "script": "DCECYHo4uAEKj0AcJd0B3xt0rxgn3Ra4IfwHRR8u9/Atpg9BVuezJw==", 18 | "parameters": [ 19 | { 20 | "name": "signature", 21 | "type": "Signature" 22 | } 23 | ], 24 | "deployed": false 25 | }, 26 | "extra": null 27 | } 28 | ], 29 | "extra": null 30 | } -------------------------------------------------------------------------------- /config/wallet-client2.privatenet3.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": null, 3 | "version": "1.0", 4 | "scrypt": { 5 | "n": 16384, 6 | "r": 8, 7 | "p": 8 8 | }, 9 | "accounts": [ 10 | { 11 | "address": "NhJX9eCbkKtgDrh1S4xMTRaHUGbZ5Be7uU", 12 | "label": null, 13 | "isDefault": false, 14 | "lock": false, 15 | "key": "6PYNfKunYGT5sMMqmpkQLB3KRrgvdE2vTEhpXsjQBLFh9cTbRkWkTkz9Q1", 16 | "contract": { 17 | "script": "DCEDcnnzpQeBclFTQYERbLOO8wRoslB0gn2zTLvGrciHOTJBVuezJw==", 18 | "parameters": [ 19 | { 20 | "name": "signature", 21 | "type": "Signature" 22 | } 23 | ], 24 | "deployed": false 25 | }, 26 | "extra": null 27 | } 28 | ], 29 | "extra": null 30 | } -------------------------------------------------------------------------------- /config/rpcserver.config-client1.json: -------------------------------------------------------------------------------- 1 | { 2 | "PluginConfiguration": { 3 | "Servers": [ 4 | { 5 | "Network": 5195086, 6 | "BindAddress": "0.0.0.0", 7 | "Port": 10332, 8 | "SslCert": "", 9 | "SslCertPassword": "", 10 | "TrustedAuthorities": [], 11 | "RpcUser": "", 12 | "RpcPass": "", 13 | "EnableCors": false, 14 | "AllowOrigins": [], 15 | "KeepAliveTimeout": 60, 16 | "RequestHeadersTimeout": 15, 17 | "MaxGasInvoke": 100000, 18 | "MaxFee": 0.1, 19 | "MaxConcurrentConnections": 40, 20 | "MaxIteratorResultItems": 100, 21 | "MaxRequestBodySize": 5242880, 22 | "MaxStackSize": 65535, 23 | "DisabledMethods": [ ], 24 | "SessionEnabled": true, 25 | "SessionExpirationTime": 60, 26 | "FindStoragePageSize": 50 27 | } 28 | ] 29 | } 30 | } -------------------------------------------------------------------------------- /config/rpcserver.config-client2.json: -------------------------------------------------------------------------------- 1 | { 2 | "PluginConfiguration": { 3 | "Servers": [ 4 | { 5 | "Network": 5195086, 6 | "BindAddress": "0.0.0.0", 7 | "Port": 20332, 8 | "SslCert": "", 9 | "SslCertPassword": "", 10 | "TrustedAuthorities": [], 11 | "RpcUser": "", 12 | "RpcPass": "", 13 | "EnableCors": false, 14 | "AllowOrigins": [], 15 | "KeepAliveTimeout": 60, 16 | "RequestHeadersTimeout": 15, 17 | "MaxGasInvoke": 100000, 18 | "MaxFee": 0.1, 19 | "MaxConcurrentConnections": 40, 20 | "MaxIteratorResultItems": 100, 21 | "MaxRequestBodySize": 5242880, 22 | "MaxStackSize": 65535, 23 | "DisabledMethods": [ ], 24 | "SessionEnabled": true, 25 | "SessionExpirationTime": 60, 26 | "FindStoragePageSize": 50 27 | } 28 | ] 29 | } 30 | } -------------------------------------------------------------------------------- /config/rpcserver.config-consensus.json: -------------------------------------------------------------------------------- 1 | { 2 | "PluginConfiguration": { 3 | "Servers": [ 4 | { 5 | "Network": 5195086, 6 | "BindAddress": "0.0.0.0", 7 | "Port": 40332, 8 | "SslCert": "", 9 | "SslCertPassword": "", 10 | "TrustedAuthorities": [], 11 | "RpcUser": "", 12 | "RpcPass": "", 13 | "EnableCors": false, 14 | "AllowOrigins": [], 15 | "KeepAliveTimeout": 60, 16 | "RequestHeadersTimeout": 15, 17 | "MaxGasInvoke": 100000, 18 | "MaxFee": 0.1, 19 | "MaxConcurrentConnections": 40, 20 | "MaxIteratorResultItems": 100, 21 | "MaxRequestBodySize": 5242880, 22 | "MaxStackSize": 65535, 23 | "DisabledMethods": [ ], 24 | "SessionEnabled": true, 25 | "SessionExpirationTime": 60, 26 | "FindStoragePageSize": 50 27 | } 28 | ] 29 | } 30 | } -------------------------------------------------------------------------------- /config/config-client1.privatenet3.json: -------------------------------------------------------------------------------- 1 | { 2 | "ApplicationConfiguration": { 3 | "Logger": { 4 | "Path": "Logs", 5 | "ConsoleOutput": true, 6 | "Active": true 7 | }, 8 | "Storage": { 9 | "Engine": "LevelDBStore", 10 | "Path": "Data_LevelDB_{0}" 11 | }, 12 | "P2P": { 13 | "Port": 10333, 14 | "MinDesiredConnections": 10, 15 | "MaxConnections": 40, 16 | "MaxConnectionsPerAddress": 3 17 | }, 18 | "UnlockWallet": { 19 | "Path": "wallet.json", 20 | "Password": "neo", 21 | "IsActive": true 22 | }, 23 | "Plugins": { 24 | "DownloadUrl": "https://api.github.com/repos/neo-project/neo-modules/releases" 25 | } 26 | }, 27 | "ProtocolConfiguration": { 28 | "Network": 5195086, 29 | "MillisecondsPerBlock": 15000, 30 | "MaxTransactionsPerBlock": 512, 31 | "MemoryPoolMaxTransactions": 50000, 32 | "MaxTraceableBlocks": 2102400, 33 | "InitialGasDistribution": 5200000000000000, 34 | "ValidatorsCount": 1, 35 | "StandbyCommittee": [ 36 | "033a4d051b04b7fc0230d2b1aaedfd5a84be279a5361a7358db665ad7857787f1b" 37 | ], 38 | "SeedList": [ 39 | "neo-consensus:40333" 40 | ] 41 | } 42 | } -------------------------------------------------------------------------------- /config/config-client2.privatenet3.json: -------------------------------------------------------------------------------- 1 | { 2 | "ApplicationConfiguration": { 3 | "Logger": { 4 | "Path": "Logs", 5 | "ConsoleOutput": true, 6 | "Active": true 7 | }, 8 | "Storage": { 9 | "Engine": "LevelDBStore", 10 | "Path": "Data_LevelDB_{0}" 11 | }, 12 | "P2P": { 13 | "Port": 20333, 14 | "MinDesiredConnections": 10, 15 | "MaxConnections": 40, 16 | "MaxConnectionsPerAddress": 3 17 | }, 18 | "UnlockWallet": { 19 | "Path": "wallet.json", 20 | "Password": "neo", 21 | "IsActive": true 22 | }, 23 | "Plugins": { 24 | "DownloadUrl": "https://api.github.com/repos/neo-project/neo-modules/releases" 25 | } 26 | }, 27 | "ProtocolConfiguration": { 28 | "Network": 5195086, 29 | "MillisecondsPerBlock": 15000, 30 | "MaxTransactionsPerBlock": 512, 31 | "MemoryPoolMaxTransactions": 50000, 32 | "MaxTraceableBlocks": 2102400, 33 | "InitialGasDistribution": 5200000000000000, 34 | "ValidatorsCount": 1, 35 | "StandbyCommittee": [ 36 | "033a4d051b04b7fc0230d2b1aaedfd5a84be279a5361a7358db665ad7857787f1b" 37 | ], 38 | "SeedList": [ 39 | "neo-consensus:40333" 40 | ] 41 | } 42 | } -------------------------------------------------------------------------------- /config/config-consensus.privatenet3.json: -------------------------------------------------------------------------------- 1 | { 2 | "ApplicationConfiguration": { 3 | "Logger": { 4 | "Path": "Logs", 5 | "ConsoleOutput": true, 6 | "Active": true 7 | }, 8 | "Storage": { 9 | "Engine": "LevelDBStore", 10 | "Path": "Data_LevelDB_{0}" 11 | }, 12 | "P2P": { 13 | "Port": 40333, 14 | "MinDesiredConnections": 10, 15 | "MaxConnections": 40, 16 | "MaxConnectionsPerAddress": 3 17 | }, 18 | "UnlockWallet": { 19 | "Path": "wallet.json", 20 | "Password": "neo", 21 | "IsActive": true 22 | }, 23 | "Plugins": { 24 | "DownloadUrl": "https://api.github.com/repos/neo-project/neo-modules/releases" 25 | } 26 | }, 27 | "ProtocolConfiguration": { 28 | "Network": 5195086, 29 | "MillisecondsPerBlock": 15000, 30 | "MaxTransactionsPerBlock": 512, 31 | "MemoryPoolMaxTransactions": 50000, 32 | "MaxTraceableBlocks": 2102400, 33 | "InitialGasDistribution": 5200000000000000, 34 | "ValidatorsCount": 1, 35 | "StandbyCommittee": [ 36 | "033a4d051b04b7fc0230d2b1aaedfd5a84be279a5361a7358db665ad7857787f1b" 37 | ], 38 | "SeedList": [ 39 | "localhost:40333" 40 | ] 41 | } 42 | } -------------------------------------------------------------------------------- /config/wallet-consensus.privatenet3.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": null, 3 | "version": "1.0", 4 | "scrypt": { 5 | "n": 16384, 6 | "r": 8, 7 | "p": 8 8 | }, 9 | "accounts": [ 10 | { 11 | "address": "NM7Aky765FG8NhhwtxjXRx7jEL1cnw7PBP", 12 | "label": null, 13 | "isDefault": false, 14 | "lock": false, 15 | "key": "6PYM7jHL4GmS8Aw2iEFpuaHTCUKjhT4mwVqdoozGU6sUE25BjV4ePXDdLz", 16 | "contract": { 17 | "script": "DCEDOk0FGwS3/AIw0rGq7f1ahL4nmlNhpzWNtmWteFd4fxtBVuezJw==", 18 | "parameters": [ 19 | { 20 | "name": "signature", 21 | "type": "Signature" 22 | } 23 | ], 24 | "deployed": false 25 | }, 26 | "extra": null 27 | }, 28 | { 29 | "address": "NXXazKH39yNFWWZF5MJ8tEN98VYHwzn7g3", 30 | "label": null, 31 | "isDefault": false, 32 | "lock": false, 33 | "key": "6PYM7jHL4GmS8Aw2iEFpuaHTCUKjhT4mwVqdoozGU6sUE25BjV4ePXDdLz", 34 | "contract": { 35 | "script": "EQwhAzpNBRsEt/wCMNKxqu39WoS+J5pTYac1jbZlrXhXeH8bEUGe0Nw6", 36 | "parameters": [ 37 | { 38 | "name": "parameter0", 39 | "type": "Signature" 40 | } 41 | ], 42 | "deployed": false 43 | }, 44 | "extra": null 45 | } 46 | ], 47 | "extra": null 48 | } -------------------------------------------------------------------------------- /docker/Dockerfile.neo-node-with-plugins: -------------------------------------------------------------------------------- 1 | # Build the plugins 2 | FROM mcr.microsoft.com/dotnet/sdk:9.0 AS plugin-build 3 | 4 | COPY ./neo /neo 5 | WORKDIR /neo 6 | 7 | # If any plugin should be excluded from the build, just set 8 | # to a regex including the names of dirs. 9 | # Example: 10 | # REGEX_EXCLUDE_PLUGINS=".*(MPTTrie|RpcClient)" 11 | ARG REGEX_EXCLUDE_PLUGINS=".*(MPTTrie|RpcClient)" 12 | 13 | # Target framework for the plugins 14 | # ATTENTION: if dotnet version changes, this should be updated! 15 | ENV TARGET_FRAMEWORK="net9.0" 16 | 17 | # 18 | # Some magic here. Time for the kids to leave. Adults only. 19 | # 20 | # The following disgusting shell command is due to the lack of tooling 21 | # to exclude tests and specific sub-projects in dotnet. *facepalm* 22 | # 23 | # The good side: main artifacts and tests are not mixed up in the 24 | # same plugins directory, avoiding potential conflicts of .dll versions 25 | # and other nasty problems. *smile* 26 | # 27 | RUN mkdir -p /plugins && \ 28 | find ./src/Plugins \ 29 | -regextype posix-extended \ 30 | -maxdepth 1 \ 31 | -mindepth 1 \ 32 | -type d \ 33 | -and -not -name '.*' \ 34 | -and -not -regex "${REGEX_EXCLUDE_PLUGINS}" -print0 \ 35 | | xargs -0 -L1 sh -c 'basename $0' \ 36 | | sed 's/ //g' \ 37 | | xargs -I {} sh -c 'echo Building {} && dotnet publish ./src/Plugins/{} -f $TARGET_FRAMEWORK -c Release /p:ErrorOnDuplicatePublishOutputFiles=false -o /plugins && mkdir -p /plugins/{} && mv /plugins/{}.* /plugins/{}/' 38 | 39 | # Build the Neo.CLI 40 | FROM mcr.microsoft.com/dotnet/sdk:9.0 AS neo-cli-build 41 | 42 | COPY ./neo /neo 43 | 44 | WORKDIR /neo 45 | RUN dotnet restore && dotnet publish ./src/Neo.CLI -c Release -o /cli 46 | 47 | # Final image: neo-node-with-plugins :-) 48 | FROM mcr.microsoft.com/dotnet/sdk:9.0 AS neo-cli-final 49 | 50 | LABEL org.opencontainers.image.source https://github.com/axlabs/neo3-privatenet-docker 51 | 52 | RUN apt-get -y update && \ 53 | apt-get -y install jq nano procps screen libleveldb-dev sqlite3 expect && \ 54 | rm -rf /var/lib/apt/lists/* 55 | 56 | WORKDIR /neo-cli 57 | 58 | COPY --from=neo-cli-build /cli . 59 | COPY --from=plugin-build /plugins ./Plugins 60 | 61 | ENTRYPOINT ["screen","-DmS","node","dotnet","neo-cli.dll"] -------------------------------------------------------------------------------- /scripts/wait_and_invoke.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | set -e 4 | echo "Starting script..." 5 | 6 | echo "Checking if neo-node is up..." 7 | until nc -z neo-consensus 40332; do 8 | echo "Waiting for neo-node..." 9 | sleep 5 10 | done 11 | echo "Neo-node is up!" 12 | 13 | echo "Creating wallet.config file..." 14 | echo "{ 15 | \"Path\": \"/wallet.json\", 16 | \"Password\": \"${WALLET_PASSWORD}\" 17 | }" > /wallet.config 18 | 19 | echo "Starting block height check..." 20 | TEMPFILE=$(mktemp) 21 | trap "rm -f $TEMPFILE" EXIT 22 | while true; do 23 | echo "Checking block height..." 24 | sleep 5 25 | curl -s -X POST http://neo-consensus:40332 \ 26 | -H "Content-Type: application/json" \ 27 | -d '{"jsonrpc":"2.0","method":"getblockcount","params":[],"id":1}' > $TEMPFILE 28 | RESPONSE=$(cat $TEMPFILE) 29 | echo "Curl response: $RESPONSE" 30 | if [ -z "$RESPONSE" ]; then 31 | echo "Error: No response from curl" 32 | continue 33 | fi 34 | HEIGHT=$(cat $TEMPFILE | jq ".result | tonumber" 2>/dev/null) 35 | echo "Parsed height: $HEIGHT" 36 | if [ -z "$HEIGHT" ] || [ "$HEIGHT" = "null" ]; then 37 | HEIGHT=0 38 | fi 39 | echo "Current block height: $HEIGHT" 40 | if [ "$HEIGHT" -ge 1 ]; then 41 | echo "Block height is $HEIGHT. Proceeding..." 42 | break 43 | fi 44 | done 45 | 46 | echo "Invoking 'RoleManagement' contract, method 'designateAsRole'..." 47 | 48 | neo-go contract invokefunction --await --force -r http://neo-consensus:40332 \ 49 | --wallet-config /wallet.config \ 50 | --address NXXazKH39yNFWWZF5MJ8tEN98VYHwzn7g3 \ 51 | 49cf4e5378ffcd4dec034fd98a174c5491e395e2 \ 52 | designateAsRole int:8 \ 53 | [ key:02607a38b8010a8f401c25dd01df1b74af1827dd16b821fc07451f2ef7f02da60f \ 54 | key:037279f3a507817251534181116cb38ef30468b25074827db34cbbc6adc8873932 ] \ 55 | -- NXXazKH39yNFWWZF5MJ8tEN98VYHwzn7g3:Global 56 | 57 | echo "Funding address NM7Aky765FG8NhhwtxjXRx7jEL1cnw7PBP (neo-consensus, normal wallet) with 10000000 GAS and 10000000 NEO..." 58 | echo "Funding address NV1Q1dTdvzPbThPbSFz7zudTmsmgnCwX6c (neo-client1) with 10000000 GAS and 10000000 NEO..." 59 | echo "Funding address NhJX9eCbkKtgDrh1S4xMTRaHUGbZ5Be7uU (neo-client2) with 10000000 GAS and 10000000 NEO..." 60 | 61 | neo-go wallet nep17 multitransfer --await --force -r http://neo-consensus:40332 \ 62 | --wallet-config /wallet.config \ 63 | --from NXXazKH39yNFWWZF5MJ8tEN98VYHwzn7g3 \ 64 | GAS:NM7Aky765FG8NhhwtxjXRx7jEL1cnw7PBP:10000000 \ 65 | NEO:NM7Aky765FG8NhhwtxjXRx7jEL1cnw7PBP:10000000 \ 66 | NEO:NXXazKH39yNFWWZF5MJ8tEN98VYHwzn7g3:0 \ 67 | GAS:NV1Q1dTdvzPbThPbSFz7zudTmsmgnCwX6c:10000000 \ 68 | NEO:NV1Q1dTdvzPbThPbSFz7zudTmsmgnCwX6c:10000000 \ 69 | GAS:NhJX9eCbkKtgDrh1S4xMTRaHUGbZ5Be7uU:10000000 \ 70 | NEO:NhJX9eCbkKtgDrh1S4xMTRaHUGbZ5Be7uU:10000000 \ 71 | -- NXXazKH39yNFWWZF5MJ8tEN98VYHwzn7g3:Global 72 | -------------------------------------------------------------------------------- /http/client.http: -------------------------------------------------------------------------------- 1 | ### 2 | # Get the latest block index of `neo-consensus` node: 3 | ### 4 | 5 | POST http://127.0.0.1:40332 HTTP/1.1 6 | content-type: application/json 7 | 8 | { 9 | "jsonrpc":"2.0", 10 | "method":"getblockcount", 11 | "params":[], 12 | "id":1 13 | } 14 | 15 | ### 16 | # Open the wallet from the `neo-consensus` node 17 | ### 18 | 19 | POST http://127.0.0.1:40332 HTTP/1.1 20 | content-type: application/json 21 | 22 | { 23 | "jsonrpc":"2.0", 24 | "method":"openwallet", 25 | "params":["wallet.json","neo"], 26 | "id":1 27 | } 28 | 29 | ### 30 | # List the addresses in `neo-consensus` wallet: 31 | ### 32 | 33 | POST http://127.0.0.1:40332 HTTP/1.1 34 | content-type: application/json 35 | 36 | { 37 | "jsonrpc":"2.0", 38 | "method":"listaddress", 39 | "params":[], 40 | "id":1 41 | } 42 | 43 | ### 44 | # Get all NEP-17 balance of `neo-consensus`' 45 | # address `NKvR5WeczCQMcVWQD9aaMqegfEoCBXGWpW`, specifically: 46 | ### 47 | 48 | POST http://127.0.0.1:40332 HTTP/1.1 49 | content-type: application/json 50 | 51 | { 52 | "jsonrpc":"2.0", 53 | "method":"getnep17balances", 54 | "params":["NXXazKH39yNFWWZF5MJ8tEN98VYHwzn7g3"], 55 | "id":1 56 | } 57 | 58 | ### 59 | # Send 100 NEO from `neo-consensus`' address `NXXazKH39yNFWWZF5MJ8tEN98VYHwzn7g3` 60 | # to `neo-client1`'s address `NdihqSLYTf1B1WYuzhM52MNqvCNPJKLZaz` 61 | ### 62 | 63 | POST http://127.0.0.1:40332 HTTP/1.1 64 | content-type: application/json 65 | 66 | { 67 | "jsonrpc":"2.0", 68 | "method":"sendfrom", 69 | "params":[ 70 | "0xef4073a0f2b305a38ec4050e4d3d28bc40ea63f5", 71 | "NXXazKH39yNFWWZF5MJ8tEN98VYHwzn7g3", 72 | "NdihqSLYTf1B1WYuzhM52MNqvCNPJKLZaz", 73 | 100 74 | ], 75 | "id":1 76 | } 77 | 78 | ### 79 | # Open the wallet of the `neo-client1` 80 | # through JSON-RPC (**only for test purposes!**): 81 | ### 82 | 83 | POST http://127.0.0.1:10332 HTTP/1.1 84 | content-type: application/json 85 | 86 | { 87 | "jsonrpc":"2.0", 88 | "method":"openwallet", 89 | "params":["wallet.json","neo"], 90 | "id":1 91 | } 92 | 93 | ### 94 | # Get all NEP-17 balance of `neo-client1`' address `NdihqSLYTf1B1WYuzhM52MNqvCNPJKLZaz` 95 | # (wait 15 seconds before executing the command, due to the block generation interval): 96 | ### 97 | 98 | POST http://127.0.0.1:10332 HTTP/1.1 99 | content-type: application/json 100 | 101 | { 102 | "jsonrpc":"2.0", 103 | "method":"getnep17balances", 104 | "params":["NdihqSLYTf1B1WYuzhM52MNqvCNPJKLZaz"], 105 | "id":1 106 | } 107 | 108 | ### 109 | # Gets all public keys that has role 'Oracle' from the Role Management contract 110 | ### 111 | POST http://127.0.0.1:40332 HTTP/1.1 112 | content-type: application/json 113 | 114 | { 115 | "jsonrpc": "2.0", 116 | "id": 1, 117 | "method": "invokefunction", 118 | "params": [ 119 | "0x49cf4e5378ffcd4dec034fd98a174c5491e395e2", 120 | "getDesignatedByRole", 121 | [ 122 | { 123 | "type":"Integer", 124 | "value":8 125 | }, 126 | { 127 | "type":"Integer", 128 | "value":10 129 | } 130 | ], 131 | [ 132 | ], 133 | true 134 | ] 135 | } -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.7' 2 | 3 | services: 4 | 5 | neo-consensus: 6 | build: 7 | context: ./ 8 | dockerfile: ./docker/Dockerfile.neo-node-with-plugins 9 | target: neo-cli-final 10 | args: 11 | IMAGE_TAG: ${IMAGE_TAG} 12 | image: ghcr.io/axlabs/neo3-privatenet-docker/neo-cli-with-plugins:${IMAGE_TAG} 13 | hostname: neo-consensus 14 | container_name: neo-consensus 15 | volumes: 16 | - ./config/config-consensus.privatenet3.json:/neo-cli/config.json:ro 17 | - ./config/wallet-consensus.privatenet3.json:/neo-cli/wallet.json:rw 18 | - ./config/rpcserver.config-consensus.json:/neo-cli/Plugins/RpcServer/RpcServer.json:ro 19 | - ./config/dbft.config-consensus.json:/neo-cli/Plugins/DBFTPlugin/DBFTPlugin.json:ro 20 | - ./config/applicationlogs.config-consensus.json:/neo-cli/Plugins/ApplicationLogs/ApplicationLogs.json:ro 21 | - ./config/oracle.config-consensus.json:/neo-cli/Plugins/OracleService/OracleService.json:ro 22 | - ./config/tokentracker.config-consensus.json:/neo-cli/Plugins/TokensTracker/TokensTracker.json:ro 23 | - ./config/stateservice.config-consensus.json:/neo-cli/Plugins/StateService/StateService.json:ro 24 | - ./config/storagedumper.config-consensus.json:/neo-cli/Plugins/StorageDumper/StorageDumper.json:ro 25 | ports: 26 | - "40332:40332" 27 | 28 | neo-client1: 29 | image: ghcr.io/axlabs/neo3-privatenet-docker/neo-cli-with-plugins:${IMAGE_TAG} 30 | hostname: neo-client1 31 | container_name: neo-client1 32 | depends_on: 33 | - neo-consensus 34 | volumes: 35 | - ./config/config-client1.privatenet3.json:/neo-cli/config.json:ro 36 | - ./config/wallet-client1.privatenet3.json:/neo-cli/wallet.json:rw 37 | - ./config/rpcserver.config-client1.json:/neo-cli/Plugins/RpcServer/RpcServer.json:ro 38 | - ./config/applicationlogs.config-client1.json:/neo-cli/Plugins/ApplicationLogs/ApplicationLogs.json:ro 39 | - ./config/oracle.config-client1.json:/neo-cli/Plugins/OracleService/OracleService.json:ro 40 | - ./config/tokentracker.config-client1.json:/neo-cli/Plugins/TokensTracker/TokensTracker.json:ro 41 | - ./config/stateservice.config-client1.json:/neo-cli/Plugins/StateService/StateService.json:ro 42 | - ./config/storagedumper.config-client1.json:/neo-cli/Plugins/StorageDumper/StorageDumper.json:ro 43 | ports: 44 | - "10332:10332" 45 | 46 | neo-client2: 47 | image: ghcr.io/axlabs/neo3-privatenet-docker/neo-cli-with-plugins:${IMAGE_TAG} 48 | hostname: neo-client2 49 | container_name: neo-client2 50 | depends_on: 51 | - neo-consensus 52 | volumes: 53 | - ./config/config-client2.privatenet3.json:/neo-cli/config.json:ro 54 | - ./config/wallet-client2.privatenet3.json:/neo-cli/wallet.json:rw 55 | - ./config/rpcserver.config-client2.json:/neo-cli/Plugins/RpcServer/RpcServer.json:ro 56 | - ./config/applicationlogs.config-client2.json:/neo-cli/Plugins/ApplicationLogs/ApplicationLogs.json:ro 57 | - ./config/oracle.config-client2.json:/neo-cli/Plugins/OracleService/OracleService.json:ro 58 | - ./config/tokentracker.config-client2.json:/neo-cli/Plugins/TokensTracker/TokensTracker.json:ro 59 | - ./config/stateservice.config-client2.json:/neo-cli/Plugins/StateService/StateService.json:ro 60 | - ./config/storagedumper.config-client2.json:/neo-cli/Plugins/StorageDumper/StorageDumper.json:ro 61 | ports: 62 | - "20332:20332" 63 | 64 | neo-go-cli: 65 | build: 66 | context: ./ 67 | dockerfile: ./docker/Dockerfile.neo-go-with-tools 68 | args: 69 | NEO_GO_VERSION: ${NEO_GO_VERSION} 70 | hostname: neo-go-cli 71 | container_name: neo-go-cli 72 | environment: 73 | - WALLET_PASSWORD=neo 74 | volumes: 75 | - ./config/wallet-consensus.privatenet3.json:/wallet.json:ro 76 | - ./scripts/wait_and_invoke.sh:/wait_and_invoke.sh:ro 77 | entrypoint: ["sh", "/wait_and_invoke.sh"] -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build and Publish container (multi-platform) 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | publish: 7 | description: 'Publish to ghcr?' 8 | required: true 9 | default: 'true' 10 | set-latest-tag: 11 | description: 'Publish tag "latest"?' 12 | required: true 13 | default: 'false' 14 | 15 | env: 16 | IMAGE_ID: ghcr.io/axlabs/neo3-privatenet-docker/neo-cli-with-plugins 17 | VERSION_LATEST: latest 18 | 19 | jobs: 20 | 21 | build: 22 | runs-on: ${{ (matrix.platform == 'linux/amd64' && 'ubuntu-latest') || (matrix.platform == 'linux/arm64' && 'ARM64') }} 23 | strategy: 24 | fail-fast: false 25 | matrix: 26 | platform: 27 | - linux/amd64 28 | - linux/arm64 29 | steps: 30 | - name: Prepare 31 | run: | 32 | platform=${{ matrix.platform }} 33 | echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV 34 | 35 | - name: Checkout 36 | uses: actions/checkout@v4 37 | with: 38 | submodules: recursive 39 | 40 | - name: Set up Docker Buildx 41 | uses: docker/setup-buildx-action@v3 42 | with: 43 | config: buildkit-config.toml 44 | 45 | - name: Login to GitHub Container Registry 46 | uses: docker/login-action@v3 47 | with: 48 | registry: ghcr.io 49 | username: ${{ github.actor }} 50 | password: ${{ secrets.GITHUB_TOKEN }} 51 | 52 | - name: Load .env 53 | id: loadenv 54 | uses: ./.github/actions/load-env 55 | 56 | - name: Build and push neo-cli-with-plugins 57 | id: build-plugins-image 58 | uses: docker/build-push-action@v5 59 | with: 60 | platforms: ${{ matrix.platform }} 61 | file: ./docker/Dockerfile.neo-node-with-plugins 62 | target: neo-cli-final 63 | build-args: IMAGE_TAG=${{ steps.loadenv.outputs.image-tag }} 64 | context: ./ 65 | outputs: type=image,name=${{ env.IMAGE_ID }},push-by-digest=true,name-canonical=true,push=${{ github.event.inputs.publish }} 66 | 67 | - name: Clean up digests dir - neo-cli-with-plugins 68 | run: | 69 | rm -rf /tmp/digests-plugins-image 70 | mkdir -p /tmp/digests-plugins-image 71 | 72 | - name: Export digest - neo-cli-with-plugins 73 | run: | 74 | digest="${{ steps.build-plugins-image.outputs.digest }}" 75 | touch "/tmp/digests-plugins-image/${digest#sha256:}" 76 | 77 | - name: Upload digest - neo-cli-with-plugins 78 | if: github.event.inputs.publish == 'true' 79 | uses: actions/upload-artifact@v4 80 | with: 81 | name: digests-plugins-image-${{ env.PLATFORM_PAIR }} 82 | path: /tmp/digests-plugins-image/* 83 | if-no-files-found: error 84 | retention-days: 1 85 | 86 | merge-docker-manifests: 87 | runs-on: ubuntu-latest 88 | if: github.event.inputs.publish == 'true' 89 | needs: 90 | - build 91 | steps: 92 | - name: Checkout 93 | uses: actions/checkout@v4 94 | 95 | - name: Load .env 96 | id: loadenv 97 | uses: ./.github/actions/load-env 98 | 99 | - name: Clean up digests dir - neo-cli-with-plugins 100 | run: | 101 | rm -rf /tmp/digests-plugins-image 102 | mkdir -p /tmp/digests-plugins-image 103 | 104 | - name: Download digests - neo-cli-with-plugins 105 | uses: actions/download-artifact@v4 106 | with: 107 | path: /tmp/digests-plugins-image 108 | pattern: digests-plugins-image-* 109 | merge-multiple: true 110 | 111 | - name: Set up Docker Buildx 112 | uses: docker/setup-buildx-action@v3 113 | 114 | - name: Login to GitHub Container Registry 115 | uses: docker/login-action@v3 116 | with: 117 | registry: ghcr.io 118 | username: ${{ github.actor }} 119 | password: ${{ secrets.GITHUB_TOKEN }} 120 | 121 | - name: Create manifest list and push - neo-cli-with-plugins 122 | working-directory: /tmp/digests-plugins-image 123 | run: | 124 | TAGS="-t ${{ env.IMAGE_ID }}:${{ steps.loadenv.outputs.image-tag }}" 125 | if [[ "${{ github.event.inputs.set-latest-tag }}" == "true" ]]; then 126 | TAGS+=" -t ${{ env.IMAGE_ID }}:latest" 127 | fi 128 | docker buildx imagetools create $TAGS \ 129 | $(printf '${{ env.IMAGE_ID }}@sha256:%s ' *) 130 | 131 | - name: Inspect image - neo-cli-with-plugins 132 | run: | 133 | docker buildx imagetools inspect ${{ env.IMAGE_ID }}:${{ steps.loadenv.outputs.image-tag }} 134 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [](https://github.com/AxLabs/neo3-privatenet-docker/blob/master/LICENSE) 2 | [](https://github.com/AxLabs/neo3-privatenet-docker/stargazers) 3 | 4 |
7 | :fire::zap::fire::zap::fire: 8 | Run Neo N3 blockchain nodes for development in record time! 9 | :fire::zap::fire::zap::fire: 10 |
11 | 12 |You're 3 commands away to set up a Neo N3 blockchain private network.
13 |