neo-modules icon indicating copy to clipboard operation
neo-modules copied to clipboard

Rest server

Open cschuchardt88 opened this issue 2 years ago • 66 comments

RestServer

In this section you will learn about RestServer plugin and how it works.

Dependencies

  • Microsoft.AspNetCore.JsonPatch.dll Required
  • Microsoft.AspNetCore.Mvc.NewtonsoftJson.dll Required
  • Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer.dll Required
  • Microsoft.AspNetCore.Mvc.Versioning.dll Required
  • Microsoft.OpenApi.dll Required
  • Newtonsoft.Json.Bson.dll Required
  • Newtonsoft.Json.dll Required
  • System.ServiceProcess.ServiceController.dll linux maybe
  • Microsoft.AspNetCore.Mvc.Versioning.dll Required
  • Microsoft.AspNetCore.Mvc.Versioning.dll Required
  • Microsoft.AspNetCore.Mvc.Versioning.dll Required
  • Microsoft.OpenApi.dll Swagger (optional)
  • Swashbuckle.AspNetCore.Swagger.dll Swagger (optional)
  • Swashbuckle.AspNetCore.SwaggerGen.dll Swagger (optional)
  • Swashbuckle.AspNetCore.SwaggerUI.dll Swagger (optional)
  • Swashbuckle.AspNetCore.Newtonsoft.dll Swagger (optional)
  • RestServer.xml Swagger UI (optional)

In Docker

RestServer
|   |   |-- Microsoft.AspNetCore.JsonPatch.dll
|   |   |-- Microsoft.AspNetCore.Mvc.NewtonsoftJson.dll
|   |   |-- Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer.dll
|   |   |-- Microsoft.AspNetCore.Mvc.Versioning.dll
|   |   |-- Microsoft.OpenApi.dll
|   |   |-- Neo.ConsoleService.dll
|   |   |-- Newtonsoft.Json.Bson.dll
|   |   |-- Newtonsoft.Json.dll
|   |   |-- RestServer.deps.json
|   |   |-- RestServer.dll
|   |   |-- RestServer.pdb
|   |   |-- RestServer.xml
|   |   |-- Swashbuckle.AspNetCore.Newtonsoft.dll
|   |   |-- Swashbuckle.AspNetCore.Swagger.dll
|   |   |-- Swashbuckle.AspNetCore.SwaggerGen.dll
|   |   |-- Swashbuckle.AspNetCore.SwaggerUI.dll
|   |   |-- System.ServiceProcess.ServiceController.dll
|   |   |-- config.json
|   |   `-- runtimes
|   |       `-- win
|   |           `-- lib
|   |               `-- net6.0
|   |                   `-- System.ServiceProcess.ServiceController.dll

These files go in the same directory as the RestServer.dll. In neo-cli plugins/RestServer/ folder.

Response Headers

Name Value(s) Description
server neo-cli/3.6.0 RestServer/3.6.0 neo-cli and RestServer version.

JSON Serializer

RestServer uses custom Newtonsoft Json Converters to serialize controller action responses and route parameters.

One Way Binding - Write only.

  • Neo.SmartContract.ContractState
  • Neo.SmartContract.NefFile
  • Neo.SmartContract.MethodToken
  • Neo.SmartContract.Native.TrimmedBlock
  • Neo.SmartContract.Manifest.ContractAbi
  • Neo.SmartContract.Manifest.ContractGroup
  • Neo.SmartContract.Manifest.ContractManifest
  • Neo.SmartContract.Manifest.ContractPermission
  • Neo.SmartContract.Manifest.ContractPermissionDescriptor
  • Neo.Network.P2P.Payloads.Block
  • Neo.Network.P2P.Payloads.Header
  • Neo.Network.P2P.Payloads.Signer
  • Neo.Network.P2P.Payloads.TransactionAttribute
  • Neo.Network.P2P.Payloads.Transaction
  • Neo.Network.P2P.Payloads.Witness

Two Way Binding - Read & Write

  • System.Guid
  • System.ReadOnlyMemory<T>
  • Neo.BigDecimal
  • Neo.UInt160
  • Neo.UInt256
  • Neo.Cryptography.ECC.ECPoint
  • Neo.VM.Types.Array
  • Neo.VM.Types.Boolean
  • Neo.VM.Types.Buffer
  • Neo.VM.Types.ByteString
  • Neo.VM.Types.Integer
  • Neo.VM.Types.InteropInterface
  • Neo.VM.Types.Null
  • Neo.VM.Types.Map
  • Neo.VM.Types.Pointer
  • Neo.VM.Types.StackItem
  • Neo.VM.Types.Struct

Remote Endpoints

Parametes {hash} can be any Neo N3 address or scripthash; {address} can be any Neo N3 address only; {number} and {index} can be any uint32.

Parameter Examples

  • {hash} - 0xef4073a0f2b305a38ec4050e4d3d28bc40ea63f5 or NiHURyS83nX2mpxtA7xq84cGxVbHojj5Wc
  • {address} - NiHURyS83nX2mpxtA7xq84cGxVbHojj5Wc
  • {number} - 1
  • {index} - 2500000

Paths

  • Utils
    • [GET] /api/v1/utils/{hash}/address
    • [GET] /api/v1/utils/{address}/scripthash
    • [GET] /api/v1/utils/{hash}/{address}/validate
  • Node
    • [GET] /api/v1/node
    • [GET] /api/v1/node/peers
    • [GET] /api/v1/node/plugins
    • [GET] /api/v1/node/settings
  • Ledger
    • [GET] /api/v1/ledger/neo/accounts
    • [GET] /api/v1/ledger/gas/accounts
    • [GET] /api/v1/ledger/blocks?page={number}&size={number}
    • [GET] /api/v1/ledger/blocks/height
    • [GET] /api/v1/ledger/blocks/{index}
    • [GET] /api/v1/ledger/blocks/{index}/header
    • [GET] /api/v1/ledger/blocks/{index}/witness
    • [GET] /api/v1/ledger/blocks/{index}/transactions?page={number}&size={number}
    • [GET] /api/v1/ledger/transactions/{hash}
    • [GET] /api/v1/ledger/transactions/{hash}/witnesses
    • [GET] /api/v1/ledger/transactions/{hash}/signers
    • [GET] /api/v1/ledger/transactions/{hash}/attributes
    • [GET] /api/v1/ledger/memorypool?page={number}&size={number}
    • [GET] /api/v1/ledger/memorypool/verified?page={number}&size={number}
    • [GET] /api/v1/ledger/memorypool/unverified?page={number}&size={number}
    • [GET] /api/v1/ledger/memorypool/count
  • Tokens
    • [GET] /api/v1/tokens/balanceof/{address}
    • NFTs
      • [GET] /api/v1/tokens/nep-11?page={number}&size={number}
      • [GET] /api/v1/tokens/nep-11/count
      • [GET] /api/v1/tokens/nep-11/{hash}/balanceof/{address}
    • NEP-17
      • [GET] /api/v1/tokens/nep-17?page={number}&size={number}
      • [GET] /api/v1/tokens/nep-17/count
      • [GET] /api/v1/tokens/nep-17/{hash}/balanceof/{address}
  • Contracts
    • [GET] /api/v1/contracts?page={number}&size={number}
    • [GET] /api/v1/contracts/count
    • [GET] /api/v1/contracts/{hash}
    • [GET] /api/v1/contracts/{hash}/abi
    • [GET] /api/v1/contracts/{hash}/manifest
    • [GET] /api/v1/contracts/{hash}/nef
    • [GET] /api/v1/contracts/{hash}/storage
  • Wallet
    • [POST] /api/v1/wallet/open
    • [POST] /api/v1/wallet/create
    • [POST] /api/v1/wallet/{session}/address/create
    • [GET] /api/v1/wallet/{session}/address/list
    • [GET] /api/v1/wallet/{session}/asset/list
    • [GET] /api/v1/wallet/{session}/balance/list
    • [POST] /api/v1/wallet/{session}/changepassword
    • [GET] /api/v1/wallet/{session}/close
    • [GET] /api/v1/wallet/{session}/delete/{address}
    • [GET] /api/v1/wallet/{session}/export/{address}
    • [GET] /api/v1/wallet/{session}/export
    • [GET] /api/v1/wallet/{session}/gas/unclaimed
    • [GET] /api/v1/wallet/{session}/key/list
    • [POST] /api/v1/wallet/{session}/import
    • [POST] /api/v1/wallet/{session}/import/multisigaddress
    • [POST] /api/v1/wallet/{session}/transfer

cschuchardt88 avatar Nov 08 '23 08:11 cschuchardt88

@superboyiii can you please review and test it?

Jim8y avatar Nov 08 '23 08:11 Jim8y

This is awesome. Need some time for test.

superboyiii avatar Nov 08 '23 08:11 superboyiii

anyone know what this error is about? It builds fine on my computer. CodeQL / Analyze (csharp) gets error only.

  MSBuild version 17.8.3+195e7f5a3 for .NET
    Determining projects to restore...
    All projects are up-to-date for restore.
    LevelDBStore -> /home/runner/work/neo-modules/neo-modules/src/LevelDBStore/bin/Debug/net7.0/LevelDBStore.dll
    RocksDBStore -> /home/runner/work/neo-modules/neo-modules/src/RocksDBStore/bin/Debug/net7.0/RocksDBStore.dll
    StatesDumper -> /home/runner/work/neo-modules/neo-modules/src/StatesDumper/bin/Debug/net7.0/StatesDumper.dll
    RpcServer -> /home/runner/work/neo-modules/neo-modules/src/RpcServer/bin/Debug/net7.0/RpcServer.dll
  CSC : error CS0006: Metadata file '/home/runner/work/neo-modules/neo-modules/src/RpcServer/obj/Debug/net7.0/ref/RpcServer.dll' could not be found [/home/runner/work/neo-modules/neo-modules/src/OracleService/OracleService.csproj]
  CSC : error CS0006: Metadata file '/home/runner/work/neo-modules/neo-modules/src/RpcServer/obj/Debug/net7.0/ref/RpcServer.dll' could not be found [/home/runner/work/neo-modules/neo-modules/src/ApplicationLogs/ApplicationLogs.csproj]

cschuchardt88 avatar Nov 20 '23 20:11 cschuchardt88

Build well on my local PC, not sure if it referred to the changes on *csproj of Oracle and Applicationlog image

superboyiii avatar Nov 21 '23 07:11 superboyiii

Tried to revert the modification from ApplicationLogs and OracleService, forked it to my repo and run CodeQL check. Still failed.

superboyiii avatar Nov 21 '23 08:11 superboyiii

In the code.yml it says if there is an error autobuilding the project to comment out that step and add your own build commands or script to run. we needed to do that for neo-express repo you can have a look at that if you want https://github.com/neo-project/neo-express/blob/master/.github/workflows/code.yml

cschuchardt88 avatar Nov 23 '23 06:11 cschuchardt88

1701940303290 Is it necessary to put HardFork into CamelCasePropertyNamesContractResolver() ?

superboyiii avatar Dec 07 '23 09:12 superboyiii

Changed hardfork names. Now removed prefix. image

cschuchardt88 avatar Dec 11 '23 07:12 cschuchardt88

Fixed image

cschuchardt88 avatar Dec 11 '23 08:12 cschuchardt88

@superboyiii This may help you. Just do Ctrl+O in postman. Some URL may have been removed. Neo API version 1.0.postman_collection.json

should look like this image

cschuchardt88 avatar Dec 11 '23 11:12 cschuchardt88

@cschuchardt88 I can't get any response from Wallet model, even can't debug into it. Other models work well. Is it working on yours?

superboyiii avatar Dec 25 '23 02:12 superboyiii

Check the config? Its disabled by default.

cschuchardt88 avatar Dec 25 '23 02:12 cschuchardt88

Check the config? Its disabled by default.

Oh, OK. Works now, thanks.

superboyiii avatar Dec 25 '23 03:12 superboyiii

@superboyiii I added you to my repos, so you can commit changes directly.

cschuchardt88 avatar Dec 27 '23 06:12 cschuchardt88

Is this OK? @cschuchardt88 https://github.com/neo-project/neo-modules/pull/839/commits/784c7dbdcf9bcd207f4c63416e2fa0d11a2628b8 1703732686186

superboyiii avatar Dec 28 '23 03:12 superboyiii

Has to be this:

Rules = signer.Rules != null ? signer.Rules.Select(s => WitnessRuleToJToken(s, serializer)) : Array.Empty<WitnessRule>(),

You have to call WitnessRuleToJToken or else it can't serialize the object, and you will get an error.

cschuchardt88 avatar Dec 28 '23 08:12 cschuchardt88

Also i forgot to mention there is console commands.

image

cschuchardt88 avatar Dec 28 '23 09:12 cschuchardt88

@Jim8y @shargon Need your review for double check.

superboyiii avatar Jan 02 '24 07:01 superboyiii

My environment is kinda painful to set up testing this pr. Will take a while for me, but shargon and superboy's review should be sufficient to merge.

Jim8y avatar Jan 02 '24 16:01 Jim8y

@superboyiii Did you check out the Swagger UI?

  • http://127.0.0.1:10339/swagger/index.html

image

cschuchardt88 avatar Jan 03 '24 02:01 cschuchardt88

@superboyiii Did you check out the Swagger UI?

Tried it, it's really cool and convinent!

superboyiii avatar Jan 03 '24 06:01 superboyiii

Is not forgotten, I will need time to review it, I really love this PR

shargon avatar Jan 04 '24 21:01 shargon

neo> FATAL [12:50:32.505] 	System.Reflection.ReflectionTypeLoadException
Unable to load one or more of the requested types.
Could not load file or assembly 'Microsoft.EntityFrameworkCore, Version=7.0.10.0,  Culture=neutral,  PublicKeyToken=adb9793829...ch()
   at  System.Thr...eadStart()
Unhandled exception. System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.
Could not load file or assembly 'Microsoft.EntityFrameworkCore, Version=7.0.10.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.

   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at Microsoft.AspNetCore.Mvc.Controllers.ControllerFeatureProvider.PopulateFeature(IEnumerable`1 parts, ControllerFeature feature)
   at Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartManager.PopulateFeature[TFeature](TFeature feature)
   at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider.GetControllerTypes()
   at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider.GetDescriptors()
   at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider.OnProvidersExecuting(ActionDescriptorProviderContext context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.UpdateCollection()
   at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.Initialize()
   at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.get_ActionDescriptors()
   at Microsoft.AspNetCore.Mvc.ApiExplorer.DefaultApiVersionDescriptionProvider.EnumerateApiVersions(IActionDescriptorCollectionProvider actionDescriptorCollectionProvider)
   at Microsoft.AspNetCore.Mvc.ApiExplorer.DefaultApiVersionDescriptionProvider.LazyApiVersionDescriptions.EnumerateApiVersions()
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at Microsoft.AspNetCore.Mvc.ApiExplorer.DefaultApiVersionDescriptionProvider.get_ApiVersionDescriptions()
   at Neo.Plugins.RestServer.RestWebServer.<>c__DisplayClass7_3.<Start>b__37(SwaggerUIOptions options)
   at Microsoft.AspNetCore.Builder.SwaggerUIBuilderExtensions.UseSwaggerUI(IApplicationBuilder app, Action`1 setupAction)
   at Neo.Plugins.RestServer.RestWebServer.<Start>b__7_2(IApplicationBuilder app)
   at Microsoft.Extensions.DependencyInjection.AutoRegisterMiddleware.<>c__DisplayClass4_0.<Configure>b__0(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.WebHost.BuildApplication()
   at Microsoft.AspNetCore.Hosting.WebHost.StartAsync(CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Hosting.WebHost.Start()
   at Neo.Plugins.RestServer.RestWebServer.Start()
   at Neo.Plugins.RestServer.RestServerPlugin.OnSystemLoaded(NeoSystem system)
   at Neo.NeoSystem..ctor(ProtocolSettings settings, String storageEngine, String storagePath) in /opt/neoLib/src/Neo/NeoSystem.cs:line 130
   at Neo.CLI.MainService.Start(String[] args) in /opt/neoLib/src/Neo.CLI/CLI/MainService.cs:line 379
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.EntityFrameworkCore, Version=7.0.10.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.

File name: 'Microsoft.EntityFrameworkCore, Version=7.0.10.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
/opt/start_node.sh: line 2:   116 Aborted                 (core dumped) dotnet neo-cli.dll
root@292575307a6c:/# 

I am trying to set it online on neocompiler.io for who wants to test.

vncoelho avatar Jan 05 '24 12:01 vncoelho

I was missing the .xml file in the folder. I will try again.

vncoelho avatar Jan 05 '24 13:01 vncoelho

image

vncoelho avatar Jan 05 '24 13:01 vncoelho

neo> FATAL [13:05:36.078] 	System.IO.FileNotFoundException
Could not load file or assembly 'Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer, Version=5.1.0.0,  Culture=neutral,  PublicKeyToken=adb9793829...ch()
   at  System.Thr...eadStart()
Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer, Version=5.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.

File name: 'Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer, Version=5.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
   at Neo.Plugins.RestServer.RestWebServer.<Start>b__7_1(IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.WebHostBuilder.BuildCommonServices(AggregateException& hostingStartupErrors)
   at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
   at Neo.Plugins.RestServer.RestWebServer.Start()
   at Neo.Plugins.RestServer.RestServerPlugin.OnSystemLoaded(NeoSystem system)
   at Neo.NeoSystem..ctor(ProtocolSettings settings, String storageEngine, String storagePath) in /opt/neoLib/src/Neo/NeoSystem.cs:line 130
   at Neo.CLI.MainService.Start(String[] args) in /opt/neoLib/src/Neo.CLI/CLI/MainService.cs:line 379
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
/opt/start_node.sh: line 2:   111 Aborted                 (core dumped) dotnet neo-cli.dll
root@a262d64d5120:/# 

vncoelho avatar Jan 05 '24 13:01 vncoelho

I tried now copying all .dlls to the folder. But still some errors

image

NEO-CLI v3.6.2  -  NEO v3.6.2  -  NEO-VM v3.6.2

neo> FATAL [15:12:58.316] 	System.Reflection.ReflectionTypeLoadException
Unable to load one or more of the requested types.
Could not load file or assembly 'Microsoft.EntityFrameworkCore, Version=7.0.10.0,  Culture=neutral,  PublicKeyToken=adb9793829...ch()
   at  System.Thr...eadStart()
Unhandled exception. System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.
Could not load file or assembly 'Microsoft.EntityFrameworkCore, Version=7.0.10.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.

   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at Microsoft.AspNetCore.Mvc.Controllers.ControllerFeatureProvider.PopulateFeature(IEnumerable`1 parts, ControllerFeature feature)
   at Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartManager.PopulateFeature[TFeature](TFeature feature)
   at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider.GetControllerTypes()
   at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider.GetDescriptors()
   at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider.OnProvidersExecuting(ActionDescriptorProviderContext context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.UpdateCollection()
   at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.Initialize()
   at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.get_ActionDescriptors()
   at Microsoft.AspNetCore.Mvc.ApiExplorer.DefaultApiVersionDescriptionProvider.EnumerateApiVersions(IActionDescriptorCollectionProvider actionDescriptorCollectionProvider)
   at Microsoft.AspNetCore.Mvc.ApiExplorer.DefaultApiVersionDescriptionProvider.LazyApiVersionDescriptions.EnumerateApiVersions()
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at Microsoft.AspNetCore.Mvc.ApiExplorer.DefaultApiVersionDescriptionProvider.get_ApiVersionDescriptions()
   at Neo.Plugins.RestServer.RestWebServer.<>c__DisplayClass7_3.<Start>b__37(SwaggerUIOptions options)
   at Microsoft.AspNetCore.Builder.SwaggerUIBuilderExtensions.UseSwaggerUI(IApplicationBuilder app, Action`1 setupAction)
   at Neo.Plugins.RestServer.RestWebServer.<Start>b__7_2(IApplicationBuilder app)
   at Microsoft.Extensions.DependencyInjection.AutoRegisterMiddleware.<>c__DisplayClass4_0.<Configure>b__0(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.WebHost.BuildApplication()
   at Microsoft.AspNetCore.Hosting.WebHost.StartAsync(CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Hosting.WebHost.Start()
   at Neo.Plugins.RestServer.RestWebServer.Start()
   at Neo.Plugins.RestServer.RestServerPlugin.OnSystemLoaded(NeoSystem system)
   at Neo.NeoSystem..ctor(ProtocolSettings settings, String storageEngine, String storagePath) in /opt/neoLib/src/Neo/NeoSystem.cs:line 130
   at Neo.CLI.MainService.Start(String[] args) in /opt/neoLib/src/Neo.CLI/CLI/MainService.cs:line 379
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.EntityFrameworkCore, Version=7.0.10.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.

File name: 'Microsoft.EntityFrameworkCore, Version=7.0.10.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
/opt/start_node.sh: line 2:    99 Aborted                 (core dumped) dotnet neo-cli.dll
root@2b23b4535fb1:/# 

vncoelho avatar Jan 05 '24 15:01 vncoelho

@vncoelho Looks like you are using Microsoft.EntityFrameworkCore? You site is programmed in asp.net mvc? Looks like my plugin is loading your mvc controllers for your site?

cschuchardt88 avatar Jan 05 '24 18:01 cschuchardt88

Everything is built with SDK mcr.microsoft.com/dotnet/sdk:7.0.404-jammy

Node is created with dotnet publish -c Release -f net7.0 Plugins are generated with dotnet publish -c Release -o app

Client is run with a container with image mcr.microsoft.com/dotnet/aspnet:7.0.14-jammy We used to use aspnet because it was enough for neo-cli to run, image was more compact. Perhaps we may need another image for client now.

vncoelho avatar Jan 06 '24 04:01 vncoelho

My thoughts are, that you are using the wrong image. Why are you using web image like aspnet:7.0.14-jammy? Since your doing that way, Microsoft.Extensions.DependencyInjection.AutoRegisterMiddleware will; you guessed it auto register. In this case its trying to auto register Microsoft.EntityFrameworkCore or something that needs it; but not likely. however i don't use Microsoft.EntityFrameworkCore thats for interacting with SQL databases.

Maybe also try only the dependencies that RestServer Require. Here is an updated list: image

cschuchardt88 avatar Jan 06 '24 05:01 cschuchardt88