Skip to content

Commit

Permalink
Adding rest server
Browse files Browse the repository at this point in the history
  • Loading branch information
vncoelho committed Jan 9, 2024
1 parent 34eff3e commit b30a96b
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 11 deletions.
28 changes: 28 additions & 0 deletions docker-compose-eco-network/Neo.CLI/configs/plugins/restServer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"PluginConfiguration": {
"Network": 56753,
"BindAddress": "0.0.0.0",
"Port": 40337,
"KeepAliveTimeout": 120,
"SslCertFile": "",
"SslCertPassword": "",
"TrustedAuthorities": [], // Example: "aec13cdd5ea6a3998aec14ac331ad96bedbb770f" (Thumbprint)
"EnableBasicAuthentication": false,
"RestUser": "",
"RestPass": "",
"EnableCors": true,
"AllowOrigins": [], // Example: "http://www.example.com"
"DisableControllers": [ "WalletController" ],
"EnableCompression": true,
"CompressionLevel": "SmallestSize", // "Fastest" or "Optimal" or "NoCompression" or "SmallestSize"
"EnableForwardedHeaders": false,
"EnableSwagger": true,
"MaxPageSize": 50,
"MaxConcurrentConnections": 40,
"MaxTransactionFee": 10000000,
"MaxGasInvoke": 200000000,
"MaxTransactionSize": 1024,
"WalletSessionTimeout": 120
}
}

15 changes: 11 additions & 4 deletions docker-compose-eco-network/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ services:
IS_RPC_SERVER: 1
IS_RPC_CLIENT: 0
IS_ORACLE: 0
IS_REST_SERVER: 0
labels:
autoheal: 'true'
networks:
Expand Down Expand Up @@ -75,7 +76,8 @@ services:
environment:
IS_RPC_SERVER: 1
IS_RPC_CLIENT: 0
IS_ORACLE: 0
IS_ORACLE: 0
IS_REST_SERVER: 0
labels:
autoheal: 'true'
networks:
Expand Down Expand Up @@ -107,7 +109,8 @@ services:
environment:
IS_RPC_SERVER: 0
IS_RPC_CLIENT: 0
IS_ORACLE: 0
IS_ORACLE: 0
IS_REST_SERVER: 0
labels:
autoheal: 'true'
networks:
Expand Down Expand Up @@ -139,7 +142,8 @@ services:
environment:
IS_RPC_SERVER: 0
IS_RPC_CLIENT: 0
IS_ORACLE: 0
IS_ORACLE: 0
IS_REST_SERVER: 0
labels:
autoheal: 'true'
networks:
Expand All @@ -153,10 +157,12 @@ services:
ports:
- "20337:20337"
- "30337:30337"
- "40337:40337"
volumes:
- $ECO_PWD/docker-compose-eco-network/Neo.CLI/configs/config1RPC.json:/opt/node/Neo.CLI/config.json
- $ECO_PWD/docker-compose-eco-network/Neo.CLI/configs/plugins/appLogConfig.json:/opt/node/Neo.CLI/Plugins/ApplicationLogs/config.json
- $ECO_PWD/docker-compose-eco-network/Neo.CLI/configs/plugins/rpcServer3.json:/opt/node/Neo.CLI/Plugins/RpcServer/config.json
- $ECO_PWD/docker-compose-eco-network/Neo.CLI/configs/plugins/restServer.json:/opt/node/Neo.CLI/Plugins/RestServer/config.json
- $ECO_PWD/docker-compose-eco-network/Neo.CLI/configs/plugins/tokensTracker.json:/opt/node/Neo.CLI/Plugins/TokensTracker/config.json
- $ECO_PWD/docker-compose-eco-network/Neo.CLI/configs/plugins/statesDumper.json:/opt/node/Neo.CLI/Plugins/StatesDumper/config.json
- $ECO_PWD/docker-compose-eco-network/Neo.CLI/getIncStorage.sh:/opt/getIncStorage.sh
Expand All @@ -180,7 +186,8 @@ services:
environment:
IS_RPC_SERVER: 1
IS_RPC_CLIENT: 0
IS_ORACLE: 1
IS_REST_SERVER: 1
IS_ORACLE: 1
labels:
autoheal: 'true'
networks:
Expand Down
2 changes: 1 addition & 1 deletion docker-neo-csharp-node/docker_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -e

# This automatically downloads the client from specified NEO_CLI_URL NeoResearch
NEO_CLI_VERSION="3.6.2-all-plugins-monorepo-neocli"
NEO_CLI_VERSION="3.6.2-all-plugins-monorepo-neocli-restServer"

BASE_NAME="eco-neo-csharp-node"
IMAGE_NAME="$BASE_NAME:$NEO_CLI_VERSION"
Expand Down
20 changes: 14 additions & 6 deletions docker-neo-csharp-node/scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,33 @@ sed -i -e "s/eco-neo-csharp-node4-running/$IP_SERVER4/g" /opt/node/Neo.CLI/confi

if [[ ${IS_ORACLE} = "0" ]]; then
echo "Deleting Oracle"
rm /opt/node/Neo.CLI/Plugins/OracleService.dll
rm -r /opt/node/Neo.CLI/Plugins/OracleService
sleep 1
fi

if [[ ${IS_RPC_SERVER} = "0" ]]; then
echo "Deleting RPCServer"
rm /opt/node/Neo.CLI/Plugins/RpcServer.dll
rm /opt/node/Neo.CLI/Plugins/TokensTracker.dll
rm /opt/node/Neo.CLI/Plugins/ApplicationLogs.dll
rm /opt/node/Neo.CLI/Plugins/StateService.dll
rm -r /opt/node/Neo.CLI/Plugins/RpcServer
rm -r /opt/node/Neo.CLI/Plugins/TokensTracker
rm -r /opt/node/Neo.CLI/Plugins/ApplicationLogs
rm -r /opt/node/Neo.CLI/Plugins/StateService
sleep 1
fi

if [[ ${IS_RPC_CLIENT} = "0" ]]; then
echo "Deleting RpcClient"
rm /opt/node/Neo.CLI/Plugins/RpcClient.dll
rm -r /opt/node/Neo.CLI/Plugins/RpcClient
sleep 1
fi

if [[ ${IS_REST_SERVER} = "0" ]]; then
echo "Deleting RestServer"
rm -r /opt/node/Neo.CLI/Plugins/RestServer
sleep 1
fi



echo "LAUNCHING Neo.CLI...";
screen -L -dmS node /opt/start_node.sh

Expand Down

0 comments on commit b30a96b

Please sign in to comment.