# Gateway Mode

Multiple users can share one mefs's running program.

### [User Agent Start](https://docs.memolabs.org/#/start-and-usage/gateway-mode?id=user-agent-start) <a href="#user-agent-start" id="user-agent-start"></a>

After mefs is started, other users can also be started as a proxy.

```shell
mefs-user lfs start <addr> --sk=<private key> --pwd=<password>
```

Parameter explanation:

```shell
addr：account address;

--sk：the private key of the user; if the private key corresponding to the address does not match, the address of the private key shall prevail;

--pwd：user's password;
```

### [User Agent Stop](https://docs.memolabs.org/#/start-and-usage/gateway-mode?id=user-agent-stop) <a href="#user-agent-stop" id="user-agent-stop"></a>

After mefs is started, other users can also be shut down by proxy.

```shell
mefs-user lfs kill <addr> --pwd=<password>
```

Parameter explanation:

```shell
addr：account address

--pwd：account password
```

### [Usage](https://docs.memolabs.org/#/start-and-usage/gateway-mode?id=usage) <a href="#usage" id="usage"></a>

* Cli

```shell
mefs-user rootcmd subcmd arg1 op1=arg2 --addr=<public key>
```

* Http

```shell
curl "http://<ip>:5001/api/v0/<roocmd>/<subcmd>?arg=<arg1>&op1=<arg2>&addr=<public key
```

### [Example](https://docs.memolabs.org/#/start-and-usage/gateway-mode?id=example) <a href="#example" id="example"></a>

The user whose address is the public key obtains the file named ObjectName from the BucketName bucket.

* Cli

```shell
mefs_user lfs get_object <BucketName> <ObjectName> --addr=<public key>
```

* Http

```shell
curl  "http://127.0.0.1:5001/api/v0/lfs/get_object?arg=<BucketName>&arg=<ObjectName>&addr=<public key>"
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://memolabs.gitbook.io/memo/start-usage/gateway-mode.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
