> For the complete documentation index, see [llms.txt](https://memolabs.gitbook.io/memo/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://memolabs.gitbook.io/memo/start-usage/gateway-mode.md).

# 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>"
```
