Process

Get PM2 process list

Method

1process.list

Parameters

Name Type Description Required
id string / number The identifier of the request. Yes
jsonrpc string The protocol version. Yes
method string The method name. Yes
params object The parameters of the request. Yes

Result

Name Type Description Required
id string / number The identifier of the request. Yes
jsonrpc string The protocol version. Yes
result array Result. Yes
result.pid number Process ID. Yes
result.name number Process name. Yes
result.version string Process version. Yes
result.pm_id number PM2 process ID. Yes
result.status string PM2 process status. Yes
result.monit.memory number Used memory. (KB) Yes
result.monit.cpu number Used processor. (%) Yes

Request

1{
2 "id": "unique-request-id",
3 "jsonrpc": "2.0",
4 "method": "process.list",
5 "params": {}
6}

Response

1{
2 "id": "unique-request-id",
3 "jsonrpc": "2.0",
4 "result": [
5 {
6 "pid": 57255,
7 "name": "ark-core",
8 "pm_id": 0,
9 "monit": {
10 "memory": 109600,
11 "cpu": 0.5
12 },
13 "version": "4.0.0"
14 "status": "online"
15 }
16 ]
17}

Stop pm2 process

Method

1process.stop

Parameters

Name Type Description Required
id string / number The identifier of the request. Yes
jsonrpc string The protocol version. Yes
method string The method name. Yes
params object The parameters of the request. Yes
params.name string PM2 process name / ID. Yes

Result

Name Type Description Required
id string / number The identifier of the request. Yes
jsonrpc string The protocol version. Yes
result object Result. Yes
result.name string PM2 process name. Yes
result.status string PM2 process new status. Yes

Request

1{
2 "id": "unique-request-id",
3 "jsonrpc": "2.0",
4 "method": "process.stop",
5 "params": { "name": "ark-core" }
6}

Response

1{
2 "id": "unique-request-id",
3 "jsonrpc": "2.0",
4 "result": {
5 "name": "ark-core",
6 "status": "stopped"
7 }
8}

Start core process

Method

1process.start

Parameters

Name Type Description Required
id string / number The identifier of the request. Yes
jsonrpc string The protocol version. Yes
method string The method name. Yes
params object The parameters of the request. Yes
params.name string Core process name (core, relay, forger). Yes
params.args string Process arguments. Yes

Result

Name Type Description Required
id string / number The identifier of the request. Yes
jsonrpc string The protocol version. Yes
result object Result. Yes

Request

1{
2 "id": "unique-request-id",
3 "jsonrpc": "2.0",
4 "method": "process.start",
5 "params": { "name": "core", "args": "--network=testnet --env=test" }
6}

Response

1{
2 "id": "unique-request-id",
3 "jsonrpc": "2.0",
4 "result": {}
5}

Restart PM2 process

Method

1process.restart

Parameters

Name Type Description Required
id string / number The identifier of the request. Yes
jsonrpc string The protocol version. Yes
method string The method name. Yes
params object The parameters of the request. Yes
params.name string PM2 process name. Yes

Result

Name Type Description Required
id string / number The identifier of the request. Yes
jsonrpc string The protocol version. Yes
result object Result. Yes
result.name string PM2 process name. Yes
result.status string PM2 process status. Yes

Request

1{
2 "id": "unique-request-id",
3 "jsonrpc": "2.0",
4 "method": "process.restart",
5 "params": { "name": "ark-core" }
6}

Response

1{
2 "id": "unique-request-id",
3 "jsonrpc": "2.0",
4 "result": {
5 "name": "ark-core",
6 "status": "online"
7 }
8}

Delete PM2 process

Method

1process.delete

Parameters

Name Type Description Required
id string / number The identifier of the request. Yes
jsonrpc string The protocol version. Yes
method string The method name. Yes
params object The parameters of the request. Yes
params.name string PM2 process name. Yes

Result

Name Type Description Required
id string / number The identifier of the request. Yes
jsonrpc string The protocol version. Yes
result object Result. Yes

Request

1{
2 "id": "unique-request-id",
3 "jsonrpc": "2.0",
4 "method": "process.restart",
5 "params": { "name": "ark-core" }
6}

Response

1{
2 "id": "unique-request-id",
3 "jsonrpc": "2.0",
4 "result": {}
5}
Last updated 2 years ago
Edit Page
Share: