Also the service is running according to the Windows Service Manager and the node manager can create and connect nodes. The Firewall ist also open for the Actyx service.
I sent it via E-Mail as it is too long for posting here.
2. Test the API
> Invoke-RestMethod -Uri "http://localhost:4455/api/v2/node/id"
Invoke-RestMethod : Unable to connect to the remote server
At line:1 char:1
+ Invoke-RestMethod -Uri "http://localhost:4455/api/v2/node/id"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc
eption
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
3. Provide custom API endpoint to the Nodejs application
PS C:\Users\jesko\Desktop\quickstart> $Env:AX_STORE_URI="localhost:4454/api/v2"
PS C:\Users\jesko\Desktop\quickstart> npm run start
> actyx-quickstart@1.0.0 start
> ts-node index
Error: Error: unable to connect to Actyx at http://localhost:4454/api/v2/node/id. Is the service running? -- Error: request to http://localhost:4454/api/v2/node/id failed, reason: connect ECONNREFUSED ::1:4454
at C:\Users\jesko\Desktop\quickstart\node_modules\@actyx\sdk\lib\v2\utils.js:56:19
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at Object.exports.v2getNodeId (C:\Users\jesko\Desktop\quickstart\node_modules\@actyx\sdk\lib\v2\utils.js:48:12)
at Object.of (C:\Users\user\Desktop\quickstart\node_modules\@actyx\sdk\lib\actyx.js:39:24)
at Object.mkPond [as of] (C:\Users\jesko\Desktop\quickstart\node_modules\@actyx\pond\lib\pond.js:255:19)
So from the results of 2. and 3. it is clear that the Actyx API isn’t listening on 4454. And that even though the logs show the following
2022-01-19T06:57:12.768697Z INFO API_BOUND: API bound to 127.0.0.1:4454.
So I am thinking that maybe something else is taking over the port after node startup? Someone may be using SO_REUSEADDR and we aren’t using SO_EXCLUSIVEADDRUSE (which would probably be a bug).
Could you please try the following and post the results?
Stop the Actyx service
Edit the C:\Program Files\Actyx\Node\actyx-service.xml file by changing the line <startarguments>--background</startarguments> to <startarguments>--background --bind-api 7575</startarguments>
Restart the Actyx service
Run through steps 2. and 3. from above again, but using port 7575 instead of 4454 (I used 4455 above by mistake in step 2).
3. Provide custom API endpoint to the Nodejs application
PS C:\Users\jesko\Desktop\quickstart> $Env:AX_STORE_URI="localhost:7575/api/v2"
PS C:\Users\jesko\Desktop\quickstart> npm run start
> actyx-quickstart@1.0.0 start
> ts-node index
Error: Error: unable to connect to Actyx at http://localhost:7575/api/v2/node/id. Is the service running? -- Error: request to http://localhost:7575/api/v2/node/id failed, reason: connect ECONNREFUSED ::1:7575
at C:\Users\jesko\Desktop\quickstart\node_modules\@actyx\sdk\lib\v2\utils.js:56:19
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at Object.exports.v2getNodeId (C:\Users\jesko\Desktop\quickstart\node_modules\@actyx\sdk\lib\v2\utils.js:48:12)
at Object.of (C:\Users\jesko\Desktop\quickstart\node_modules\@actyx\sdk\lib\actyx.js:39:24)
at Object.mkPond [as of] (C:\Users\jesko\Desktop\quickstart\node_modules\@actyx\pond\lib\pond.js:255:19
I also pulled the recent changes from the git repo.