lotus/documentation/en/api-scripting-support.md

26 lines
1.1 KiB
Markdown
Raw Normal View History

2020-05-14 20:21:19 +00:00
# Remote API Support
You may want to delegate the work **Lotus Miner** or **Lotus Node** performs to other machines.
2020-05-14 20:21:19 +00:00
Here is how to setup the necessary authorization and environment variables.
## Environment variables
Environmental variables are variables that are defined for the current shell and are inherited by any child shells or processes. Environmental variables are used to pass information into processes that are spawned from the shell.
2020-05-14 20:21:19 +00:00
Using the [JWT you generated](https://lotu.sh/en+api#how-do-i-generate-a-token-18865), you can assign it and the **multiaddr** to the appropriate environment variable.
```sh
# Lotus Node
FULLNODE_API_INFO="JWT_TOKEN:/ip4/127.0.0.1/tcp/1234/http"
# Lotus Miner
MINER_API_INFO="JWT_TOKEN:/ip4/127.0.0.1/tcp/2345/http"
```
2020-05-12 19:09:40 +00:00
You can also use `lotus auth api-info --perm admin` to quickly create _API_INFO env vars
- The **Lotus Node**'s `mutliaddr` is in `~/.lotus/api`.
- The default token is in `~/.lotus/token`.
- The **Lotus Miner**'s `multiaddr` is in `~/.lotusminer/config`.
2020-07-08 10:53:04 +00:00
- The default token is in `~/.lotusminer/token`.