|
| 1 | +# Broker Operation |
| 2 | + |
| 3 | +<div class="warning"> |
| 4 | + |
| 5 | +Before operation Bento (except in basic [local development][page-local-dev] only), we highly suggest: |
| 6 | + |
| 7 | +1. [Optimizing Bento performance][page-bento-perf] you will connect the Broker to |
| 8 | +2. Researching the best [configuration][page-broker-config] options fitting your specific needs |
| 9 | + |
| 10 | +</div> |
| 11 | + |
| 12 | +## Connect a Bento instance |
| 13 | + |
| 14 | +A Broker requires a [running Bento instance][page-bento-run], that can be affirmed with a test proof fulfillment: |
| 15 | + |
| 16 | +```bash |
| 17 | +RUST_LOG=info cargo run --bin bento_cli -- -c 32 |
| 18 | +``` |
| 19 | + |
| 20 | +```txt |
| 21 | +2024-10-23T14:37:37.364844Z INFO bento_cli: image_id: a0dfc25e54ebde808e4fd8c34b6549bbb91b4928edeea90ceb7d1d8e7e9096c7 | input_id: eccc8f06-488a-426c-ae3d-e5acada9ae22 |
| 22 | +2024-10-23T14:37:37.368613Z INFO bento_cli: STARK job_id: 0d89e2ca-a1e3-478f-b89d-8ab23b89f51e |
| 23 | +2024-10-23T14:37:37.369346Z INFO bento_cli: STARK Job running.... |
| 24 | +2024-10-23T14:37:39.371331Z INFO bento_cli: STARK Job running.... |
| 25 | +2024-10-23T14:37:41.373508Z INFO bento_cli: STARK Job running.... |
| 26 | +2024-10-23T14:37:43.375780Z INFO bento_cli: Job done! |
| 27 | +``` |
| 28 | + |
| 29 | +## Funding your Broker on the proving market |
| 30 | + |
| 31 | +To have the Broker interact with a [market deployment][page-deployments], an account for the network you wish to operate on is required, with sufficient native token (`ETH` typically) to pay for gas fees. |
| 32 | + |
| 33 | +<div class="warning"> |
| 34 | + |
| 35 | +For market v0 Sepolia testnet purposes, we recommend around 1-2 Sepolia ETH. |
| 36 | +Gas costs for market operation in future market versions should be significantly less. |
| 37 | + |
| 38 | +</div> |
| 39 | + |
| 40 | +The following process will guide you through setting up a new wallet and funding it with testnet ETH: |
| 41 | + |
| 42 | +1. Set the environment variables `PRIVATE_KEY`, `SET_VERIFIER_ADDR`,`PROOF_MARKET_ADDR` in `.env-compose`: |
| 43 | + |
| 44 | +```bash |
| 45 | +# Prover node configs |
| 46 | +... |
| 47 | +PRIVATE_KEY=0xYOUR_TEST_WALLET_PRIVATE_KEY_HERE |
| 48 | +... |
| 49 | +PROOF_MARKET_ADDR=0x261D8c5e9742e6f7f1076Fa1F560894524e19cad # This is the address of the market contract on the target chain. |
| 50 | +... |
| 51 | +RPC_URL="https://rpc.sepolia.org" # This is the RPC URL of the target chain. |
| 52 | +... |
| 53 | +``` |
| 54 | + |
| 55 | +2. Load the `.env-compose` file into the environment: |
| 56 | + |
| 57 | +```bash |
| 58 | +source .env-compose |
| 59 | +``` |
| 60 | + |
| 61 | +3. The Broker needs to have funds deposited on the Boundless market contract to cover lock-in stake on requests. Run the following command to deposit an initial amount of ETH into the market contract. |
| 62 | + |
| 63 | +```bash |
| 64 | +# Set amount in ETH denominated units |
| 65 | +# 0.5 Sepolia ETH should be OK for basic testing |
| 66 | +# BOUNDLESS_DEPOSIT=0.5 |
| 67 | + |
| 68 | +RUST_LOG=info,boundless_market=debug cargo run --bin cli -- deposit ${BOUNDLESS_DEPOSIT:?} |
| 69 | +``` |
| 70 | + |
| 71 | +```txt |
| 72 | +2024-10-23T14:29:52.704754Z DEBUG boundless_market::contracts::proof_market: Calling deposit() value: 500000000000000000 |
| 73 | +2024-10-23T14:29:52.993892Z DEBUG boundless_market::contracts::proof_market: Broadcasting deposit tx 0xfc5c11e75101a9158735ec9e9519f5692b2f64b3337268b7ed999502956cd982 |
| 74 | +2024-10-23T14:30:07.175952Z DEBUG boundless_market::contracts::proof_market: Submitted deposit 0xfc5c11e75101a9158735ec9e9519f5692b2f64b3337268b7ed999502956cd982 |
| 75 | +2024-10-23T14:30:07.175994Z INFO cli: Deposited: 500000000000000000 |
| 76 | +``` |
| 77 | + |
| 78 | +[page-broker-config]: ./configure.md |
| 79 | +[page-local-dev]: ../../market/local-development.md |
| 80 | +[page-bento-perf]: ../bento/performance.md |
| 81 | +[page-deployments]: ../../market/deployments.md |
| 82 | +[page-bento-run]: ../bento/running.md |
0 commit comments