# Gateway & Application (\~30 min)

```bash
pocketd tx bank send $FUNDING_ADDR $GATEWAY_ADDR 100000000upokt --network=beta --fees=100upokt --unordered --timeout-duration=5s --yes
pocketd tx bank send $FUNDING_ADDR $APP_ADDR 100000000upokt --network=beta --fees=100upokt --unordered --timeout-duration=5s --yes
```

Check balances:

```bash
pocketd query --network=beta bank balances $GATEWAY_ADDR
pocketd query --network=beta bank balances $APP_ADDR
```

## Gateway and Application Configurations

(See full docs: <https://dev.poktroll.com/operate/cheat\\_sheets/gateway\\_cheatsheet#gateway-and-application-configurations>)

{% stepper %}
{% step %}

### Stake the Gateway

Create a Gateway staking config:

```bash
cat <<🚀 > /tmp/stake_gateway_config.yaml
stake_amount: 1000000upokt
🚀
```

Stake the Gateway:

```bash
pocketd tx gateway stake-gateway \
  --config=/tmp/stake_gateway_config.yaml \
  --from=$GATEWAY_ADDR $TX_PARAM_FLAGS $NODE_FLAGS
```

After the next block settles, check the Gateway status:

```bash
pocketd query gateway show-gateway $GATEWAY_ADDR $NODE_FLAGS
```

{% endstep %}

{% step %}

### Stake the Application

Create an Application staking config:

```bash
cat <<🚀 > /tmp/stake_app_config.yaml
stake_amount: 100000000upokt
service_ids:
  - "anvil"
🚀
```

Stake the Application:

```bash
pocketd tx application stake-application \
  --config=/tmp/stake_app_config.yaml \
  --from=$APP_ADDR $TX_PARAM_FLAGS $NODE_FLAGS
```

After the next block settles, check the Application status:

```bash
pocketd query application show-application $APP_ADDR $NODE_FLAGS
```

{% endstep %}

{% step %}

### Delegate the Application to the Gateway

```bash
pocketd tx application delegate-to-gateway $GATEWAY_ADDR --from=$APP_ADDR $TX_PARAM_FLAGS $NODE_FLAGS
```

After about a minute, check the Application status:

```bash
pocketd query application show-application $APP_ADDR $NODE_FLAGS
```

{% endstep %}
{% endstepper %}

## Send a test relay

You can run `pocketd relayminer relay --help` to use a helper utility to send a test relay from your staked Application.

### EVM Example

```bash
pocketd relayminer relay \
    --app=${APP_ADDR} \
    --node=${BETA_RPC_URL} \
    --grpc-addr=${BETA_GRPC_URL_RAW} \
    --keyring-backend="$POCKET_TEST_KEYRING_BACKEND" --home="$POCKET_HOME_PROD" \
    --payload="{\"jsonrpc\": \"2.0\", \"id\": 1, \"method\": \"eth_blockNumber\", \"params\": []}"
```

Optional: specify a supplier with `--supplier=<SUPPLIER_ADDR>`. Note: this will fail if the specified supplier is not in the session at the time of the relay.

## PATH Gateway Setup

PATH documentation: <https://path.grove.city/>

Once your Application and Gateway are staked, follow the "Configure PATH for Shannon" section in the PATH docs: <https://path.grove.city/develop/path/cheatsheet\\_shannon#2-configure-path-for-shannon>
