运行 不同端口上的 composer-rest-server?
Running composer-rest-server on a different port?
默认情况下,它从 3000 开始,另一个进程正在使用它。
有没有办法让它 运行 在不同的端口上?
~/git/my-test-network$ composer-rest-server -p hlfv1 -n my-test-network -i admin -s adminpw -N never
Discovering types from business network definition ...
Discovered types from business network definition
Generating schemas for all types in business network definition ...
Generated schemas for all types in business network definition
Adding schemas for all types to Loopback ...
Added schemas for all types to Loopback
events.js:160
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE 0.0.0.0:3000
at Object.exports._errnoException (util.js:1018:11)
at exports._exceptionWithHostPort (util.js:1041:20)
at Server._listen2 (net.js:1258:14)
at listen (net.js:1294:10)
at net.js:1404:9
at _combinedTickCallback (internal/process/next_tick.js:83:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
使用 -P
标志。
daniels-mbp-2:composer-common dselman$ composer-rest-server --help
Usage: composer-rest-server [options]
Options:
-p, --connectionProfileName The connection profile name [string]
-n, --businessNetworkName The business network identifier [string]
-i, --enrollId The enrollment ID of the user [string]
-s, --enrollSecret The enrollment secret of the user [string]
-N, --namespaces Use namespaces if conflicting types exist [string] [choices: "always", "required", "never"] [default: "always"]
-P, --port The port to serve the REST API on [number]
-S, --security Enable security for the REST API [boolean] [default: false]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]
从版本 0.20 开始,端口标志为 -p(小写)
以下命令适用于最新版本 0.20^
composer-rest-server -c admin@mynetwork -n never -w true -p 3001
默认情况下,它从 3000 开始,另一个进程正在使用它。
有没有办法让它 运行 在不同的端口上?
~/git/my-test-network$ composer-rest-server -p hlfv1 -n my-test-network -i admin -s adminpw -N never
Discovering types from business network definition ...
Discovered types from business network definition
Generating schemas for all types in business network definition ...
Generated schemas for all types in business network definition
Adding schemas for all types to Loopback ...
Added schemas for all types to Loopback
events.js:160
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE 0.0.0.0:3000
at Object.exports._errnoException (util.js:1018:11)
at exports._exceptionWithHostPort (util.js:1041:20)
at Server._listen2 (net.js:1258:14)
at listen (net.js:1294:10)
at net.js:1404:9
at _combinedTickCallback (internal/process/next_tick.js:83:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
使用 -P
标志。
daniels-mbp-2:composer-common dselman$ composer-rest-server --help
Usage: composer-rest-server [options]
Options:
-p, --connectionProfileName The connection profile name [string]
-n, --businessNetworkName The business network identifier [string]
-i, --enrollId The enrollment ID of the user [string]
-s, --enrollSecret The enrollment secret of the user [string]
-N, --namespaces Use namespaces if conflicting types exist [string] [choices: "always", "required", "never"] [default: "always"]
-P, --port The port to serve the REST API on [number]
-S, --security Enable security for the REST API [boolean] [default: false]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]
从版本 0.20 开始,端口标志为 -p(小写)
以下命令适用于最新版本 0.20^
composer-rest-server -c admin@mynetwork -n never -w true -p 3001