{"id":21721831,"url":"https://github.com/bgpkit/bgpkit-broker","last_synced_at":"2025-10-08T19:27:25.677Z","repository":{"id":40493227,"uuid":"419589978","full_name":"bgpkit/bgpkit-broker","owner":"bgpkit","description":"Public BGP MRT data files metadata index.","archived":false,"fork":false,"pushed_at":"2025-09-01T23:24:51.000Z","size":589,"stargazers_count":32,"open_issues_count":2,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-09-01T23:45:49.475Z","etag":null,"topics":["bgp","rust"],"latest_commit_sha":null,"homepage":"https://api.bgpkit.com/docs#tag/bgpkit-broker","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bgpkit.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"bgpkit"}},"created_at":"2021-10-21T05:13:40.000Z","updated_at":"2025-09-01T23:24:44.000Z","dependencies_parsed_at":"2023-02-12T06:31:03.571Z","dependency_job_id":"fbfb8b39-4ef5-43d8-8a11-7c758aa51c16","html_url":"https://github.com/bgpkit/bgpkit-broker","commit_stats":{"total_commits":40,"total_committers":2,"mean_commits":20.0,"dds":"0.15000000000000002","last_synced_commit":"e72787f94f7ca2b40b1c087c7fe5744ddc75c2ab"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"purl":"pkg:github/bgpkit/bgpkit-broker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgpkit%2Fbgpkit-broker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgpkit%2Fbgpkit-broker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgpkit%2Fbgpkit-broker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgpkit%2Fbgpkit-broker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bgpkit","download_url":"https://codeload.github.com/bgpkit/bgpkit-broker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgpkit%2Fbgpkit-broker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000706,"owners_count":26082805,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bgp","rust"],"created_at":"2024-11-26T02:19:06.482Z","updated_at":"2025-10-08T19:27:25.670Z","avatar_url":"https://github.com/bgpkit.png","language":"Rust","funding_links":["https://github.com/sponsors/bgpkit"],"categories":["Rust"],"sub_categories":[],"readme":"# BGPKIT Broker\n\n[![Rust](https://github.com/bgpkit/bgpkit-broker/actions/workflows/rust.yml/badge.svg)](https://github.com/bgpkit/bgpkit-broker/actions/workflows/rust.yml)\n[![Crates.io][crates-badge]][crates-url]\n[![MIT licensed][mit-badge]][mit-url]\n[![Better Uptime Badge](https://betteruptime.com/status-badges/v1/monitor/mfwr.svg)](https://status.bgpkit.com)\n[![Twitter][twitter-badge]][twitter-url]\n[![Mastodon][mastodon-badge]][mastodon-url]\n\n\n[crates-badge]: https://img.shields.io/crates/v/bgpkit-broker.svg\n\n[crates-url]: https://crates.io/crates/bgpkit-broker\n\n[mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg\n\n[mit-url]: https://github.com/bgpkit/bgpkit-broker/blob/main/LICENSE\n\n[twitter-badge]: https://shields.io/badge/Follow-lightgrey?logo=twitter\u0026style=social\n\n[twitter-url]: https://twitter.com/bgpkit\n\n[mastodon-url]: https://infosec.exchange/@bgpkit\n\n[mastodon-badge]: https://img.shields.io/mastodon/follow/109852506691103147?domain=https%3A%2F%2Finfosec.exchange\u0026style=social\n\n[BGPKIT Broker](https://bgpkit.com/broker) is an online data API service that allows users to search for publicly\navailable BGP archive files by time, collector, project, or data type. The service indexes the archives in close to\nreal-time (delay is less than 5 minutes). Currently, we are indexing BGP table dump and updates files\nfrom [RIPE RIS][ripe-ris] and [RouteViews][route-views].\n\n[ripe-ris]: https://www.ripe.net/analyse/internet-measurements/routing-information-service-ris/ris-data-access/mrt-files-store\n\n[route-views]: http://archive.routeviews.org/\n\nThis Rust library provides SDK access to the BGPKIT Broker API as well as a command-line tool to start a self-hosted\nbroker instance.\nThe current BGPKIT Broker API is available at \u003chttps://api.bgpkit.com/docs\u003e.\n\nBGPKIT Broker is used in production at [Cloudflare Radar][radar] powering its [routing page][routing] and projects\nlike [BGP hijack detection][hijack]\nand [route leak detection][route-leak].\n\n[radar]: https://radar.cloudflare.com/\n\n[route-leak]: https://blog.cloudflare.com/route-leak-detection-with-cloudflare-radar/\n\n[hijack]: https://blog.cloudflare.com/bgp-hijack-detection/\n\n[routing]: https://blog.cloudflare.com/radar-routing/\n\n## Broker Rust SDK\n\n### Installation\n\nAdd the following dependency to your `Cargo.toml`:\n\n```toml\nbgpkit-broker = \"0.8\"\n```\n\n### Overview\n\nThe BGPKIT Broker Rust SDK provides access to BGP archive files from RouteViews and RIPE RIS collectors. It features:\n- 🔍 Search BGP archive files by time, collector, project, and data type\n- 🔄 Built-in pagination with automatic streaming through iterator\n- 📊 Access to collector peers information\n- ⏰ Query latest available files for each collector\n- ✅ Configuration validation with early error detection\n\n### Configuration API\n\nAll configuration methods return `Result\u003cSelf, BrokerError\u003e` for proper error handling:\n\n```rust\nuse bgpkit_broker::{BgpkitBroker, BrokerError};\n\n// Configure broker with error handling\nlet broker = BgpkitBroker::new()\n    .ts_start(\"2022-01-01\")?        // timestamps: RFC3339, Unix epoch, or pure dates\n    .ts_end(\"2022-01-02T00:00:00Z\")?\n    .collector_id(\"rrc00,route-views2\")?  // comma-separated collectors\n    .project(\"riperis\")?             // \"riperis\" or \"routeviews\"\n    .data_type(\"rib\")?               // \"rib\" or \"updates\"\n    .page_size(100)?                 // 1-100000\n    .page(1)?;                       // page number \u003e= 1\n```\n\n#### Timestamp Formats\nFlexible timestamp parsing with automatic normalization to RFC3339:\n- Unix timestamp: `\"1640995200\"`\n- RFC3339: `\"2022-01-01T00:00:00Z\"`\n- Pure dates: `\"2022-01-01\"`, `\"2022/01/01\"`, `\"20220101\"`\n- Date with time: `\"2022-01-01 12:30:00\"`\n\n### Basic Usage\n\n#### Using Iterator (Recommended)\nAutomatically handles pagination to stream all matching items:\n\n```rust\nlet broker = BgpkitBroker::new()\n    .ts_start(\"2022-01-01\").unwrap()\n    .ts_end(\"2022-01-02\").unwrap();\n\n// Iterate by reference (reusable broker)\nfor item in \u0026broker {\n    println!(\"{}\", item);\n}\n\n// Or consume broker into iterator\nlet items: Vec\u003cBrokerItem\u003e = broker.into_iter().collect();\n```\n\n#### Manual Page Queries\nFor specific page access or custom iteration:\n\n```rust\nlet mut broker = BgpkitBroker::new()\n    .ts_start(\"2022-01-01\").unwrap()\n    .page(3).unwrap()\n    .page_size(20).unwrap();\n\n// Query single page\nlet items = broker.query_single_page()?;\n\n// Turn to next page\nbroker.turn_page(4);\nlet next_items = broker.query_single_page()?;\n```\n\n### Shortcuts for Common BGP Analysis\n\nThe SDK provides convenient shortcuts for frequent BGP data analysis patterns:\n\n#### Daily RIB Analysis\nGet RIB files captured at midnight for daily snapshots:\n\n```rust\n// Get daily RIBs from diverse collectors for comprehensive analysis\nlet broker = BgpkitBroker::new()\n    .ts_start(\"2024-01-01\").unwrap()\n    .ts_end(\"2024-01-31\").unwrap();\n\nlet diverse_collectors = broker.most_diverse_collectors(5, None).unwrap();\nlet daily_ribs = broker\n    .clone()\n    .collector_id(\u0026diverse_collectors.join(\",\")).unwrap()\n    .daily_ribs().unwrap();\n\nprintln!(\"Found {} daily snapshots from {} collectors\", \n         daily_ribs.len(), diverse_collectors.len());\n```\n\n#### Recent BGP Updates Monitoring\nMonitor recent BGP changes:\n\n```rust\n// Get updates from last 6 hours from specific collectors\nlet recent_updates = BgpkitBroker::new()\n    .collector_id(\"route-views2,rrc00\").unwrap()\n    .recent_updates(6).unwrap();\n\nprintln!(\"Found {} recent update files\", recent_updates.len());\n```\n\n#### Intelligent Collector Selection\nFind collectors with maximum ASN diversity:\n\n```rust\n// Get most diverse RouteViews collectors\nlet broker = BgpkitBroker::new();\nlet rv_collectors = broker.most_diverse_collectors(3, Some(\"routeviews\")).unwrap();\n\n// Use for comprehensive update analysis\nlet comprehensive_updates = broker\n    .clone()\n    .collector_id(\u0026rv_collectors.join(\",\")).unwrap()\n    .recent_updates(12).unwrap();\n```\n\n### Advanced Features\n\n#### Query Latest Files\nGet the most recent file for each collector:\n\n```rust\nlet broker = BgpkitBroker::new();\nlet latest_files = broker.latest()?;\n\n// Filter by specific collector\nlet broker = BgpkitBroker::new()\n    .collector_id(\"rrc00\").unwrap();\nlet latest = broker.latest()?;\n```\n\n#### Query Collector Peers\nAccess BGP peer information with filtering options:\n\n```rust\nlet broker = BgpkitBroker::new()\n    .collector_id(\"route-views2\").unwrap()\n    .peers_only_full_feed(true);\n\nlet peers = broker.get_peers()?;\nfor peer in peers {\n    println!(\"ASN: {}, IP: {}, Prefixes: v4={}/v6={}\",\n        peer.asn, peer.ip, peer.num_v4_pfxs, peer.num_v6_pfxs);\n}\n```\n\nAdditional peer filters:\n- `.peers_asn(ASN)` - Filter by peer AS number\n- `.peers_ip(IP)` - Filter by peer IP address\n\n### Environment Configuration\n\n**SDK Configuration:**\n- `BGPKIT_BROKER_URL` - Custom broker API endpoint (default: `https://api.bgpkit.com/v3/broker`)\n- `ONEIO_ACCEPT_INVALID_CERTS` - Set to `true` to accept invalid SSL certificates\n\n**CLI Server Configuration:**\n- `BGPKIT_BROKER_BACKUP_TO` - Backup destination (local path or S3 URL like `s3://bucket/path/backup.db`)\n- `BGPKIT_BROKER_BACKUP_INTERVAL_HOURS` - Backup interval in hours (default: 24)\n- `BGPKIT_BROKER_BACKUP_HEARTBEAT_URL` - Heartbeat URL for backup completion notifications\n- `BGPKIT_BROKER_HEARTBEAT_URL` - Heartbeat URL for general database update notifications\n- `BGPKIT_BROKER_NATS_URL` - NATS server URL for live notifications\n- `BGPKIT_BROKER_NATS_USER` - NATS server username\n- `BGPKIT_BROKER_NATS_PASSWORD` - NATS server password\n- `BGPKIT_BROKER_NATS_ROOT_SUBJECT` - NATS root subject (default: `public.broker`)\n\n### Data Structures\n\n**BrokerItem** - BGP archive file metadata:\n- `ts_start`, `ts_end` - Time range coverage\n- `collector_id` - Collector identifier (e.g., \"rrc00\", \"route-views2\")\n- `data_type` - File type (\"rib\" or \"updates\")\n- `url` - File download URL\n- `rough_size`, `exact_size` - File size information\n\n**BrokerPeer** - Collector peer information:\n- `asn`, `ip` - Peer identification\n- `collector` - Associated collector\n- `num_v4_pfxs`, `num_v6_pfxs` - Prefix counts\n- `num_connected_asns` - Connected AS count\n\n### Error Handling\n\nThe SDK provides early validation with helpful error messages:\n\n```rust\n// Using ? operator for clean error propagation\nfn process_data() -\u003e Result\u003c(), BrokerError\u003e {\n    let broker = BgpkitBroker::new()\n        .ts_start(\"invalid-date\")?;  // Returns ConfigurationError\n    Ok(())\n}\n\n// Or handle errors explicitly\nmatch BgpkitBroker::new().collector_id(\"invalid-collector\") {\n    Ok(broker) =\u003e { /* use broker */ },\n    Err(e) =\u003e eprintln!(\"Configuration error: {}\", e),\n}\n```\n\n### Migration from v0.7 or earlier\n\nAdd `.unwrap()` or proper error handling to configuration methods:\n\n```rust\n// Before: methods returned Self\nlet broker = BgpkitBroker::new()\n    .ts_start(\"2022-01-01\")\n    .ts_end(\"2022-01-02\");\n\n// After: methods return Result\u003cSelf, BrokerError\u003e\nlet broker = BgpkitBroker::new()\n    .ts_start(\"2022-01-01\").unwrap()\n    .ts_end(\"2022-01-02\").unwrap();\n```\n\n## `bgpkit-broker` CLI Tool\n\n`bgpkit-broker` is a command-line application that packages many functionalities to allow users to self-host a BGPKIT\nBroker instance with ease.\n\n### Install\n\nInstall with `cargo install bgpkit-broker@^0.7 --features cli` or check out the main branch and\nrun `cargo install --path . --features cli`.\n\nIf you are in a macOS environment, you can also use homebrew to install the pre-compiled binary (universal):\n\n```\nbrew install bgpkit/tap/bgpkit-broker\n```\n\n### Usage\n\n`bgpkit-broker` has the following subcommands:\n\n```text\n  A library and command-line to provide indexing and searching functionalities for public BGP data archive files over time.\n\n\nUsage: bgpkit-broker [OPTIONS] \u003cCOMMAND\u003e\n\nCommands:\n  serve      Serve the Broker content via RESTful API\n  update     Update the Broker database\n  bootstrap  Bootstrap the broker database\n  backup     Backup Broker database\n  search     Search MRT files in Broker db\n  latest     Display latest MRT files indexed\n  peers      List public BGP collector peers\n  live       Streaming live from a broker NATS server\n  doctor     Check broker instance health and missing collectors\n  help       Print this message or the help of the given subcommand(s)\n\nOptions:\n      --no-log     disable logging\n      --env \u003cENV\u003e\n  -h, --help       Print help\n  -V, --version    Print version\n```\n\n#### `serve`\n\n`bgpkit-broker serve` is the main command to start the BGPKIT Broker service. It will start a web server that serves the\nAPI endpoints. It will also periodically update the local database unless the `--no-update` flag is set.\n\n```text\n  Serve the Broker content via RESTful API\n\nUsage: bgpkit-broker serve [OPTIONS] \u003cDB_PATH\u003e\n\nArguments:\n  \u003cDB_PATH\u003e  broker db file location\n\nOptions:\n  -i, --update-interval \u003cUPDATE_INTERVAL\u003e  update interval in seconds [default: 300]\n      --no-log                             disable logging\n  -b, --bootstrap                          bootstrap the database if it does not exist\n      --env \u003cENV\u003e\n  -s, --silent                             disable bootstrap progress bar\n  -H, --host \u003cHOST\u003e                        host address [default: 0.0.0.0]\n  -p, --port \u003cPORT\u003e                        port number [default: 40064]\n  -r, --root \u003cROOT\u003e                        root path, useful for configuring docs UI [default: /]\n      --no-update                          disable updater service\n      --no-api                             disable API service\n  -h, --help                               Print help\n  -V, --version                            Print version\n```\n\n**Periodic Backup Configuration:**\n\nThe serve command supports automated periodic backups when configured with environment variables:\n\n* `BGPKIT_BROKER_BACKUP_TO`: Backup destination (local path or S3 URL like `s3://bucket/path/backup.db`)\n* `BGPKIT_BROKER_BACKUP_INTERVAL_HOURS`: Backup interval in hours (default: 24)\n* `BGPKIT_BROKER_BACKUP_HEARTBEAT_URL`: HTTP endpoint to notify when backup completes\n\nExample:\n```bash\nexport BGPKIT_BROKER_BACKUP_TO=\"./daily-backup.db\"\nexport BGPKIT_BROKER_BACKUP_INTERVAL_HOURS=\"12\"\nbgpkit-broker serve database.db\n```\n\n**NATS Notifications:**\n\nFor sending NATS notifications, set these environment variables:\n\n* `BGPKIT_BROKER_NATS_URL`: NATS server URL (e.g., `nats.broker.bgpkit.com`)\n* `BGPKIT_BROKER_NATS_USER`: NATS server username\n* `BGPKIT_BROKER_NATS_PASSWORD`: NATS server password\n* `BGPKIT_BROKER_NATS_ROOT_SUBJECT`: NATS root subject (e.g., `public.broker`)\n\n#### `update`\n\n`bgpkit-broker update` triggers a local database update manually. This command **cannot** be run at the same time\nas `serve` because the active API will lock the database file.\n\n```text\nUpdate the Broker database\n\nUsage: bgpkit-broker update [OPTIONS] \u003cDB_PATH\u003e\n\nArguments:\n  \u003cDB_PATH\u003e  broker db file location\n\nOptions:\n  -d, --days \u003cDAYS\u003e  force number of days to look back. by default resume from the latest available data time\n      --no-log       disable logging\n      --env \u003cENV\u003e\n  -h, --help         Print help\n  -V, --version      Print version\n```\n\n#### `backup`\n\n`bgpkit-broker update` runs a database backup and export the database to a duckdb file and a parquet file. This *can* be\nrun while `serve` is running.\n\n```text\n  Backup Broker database\n\nUsage: bgpkit-broker backup [OPTIONS] \u003cFROM\u003e \u003cTO\u003e\n\nArguments:\n  \u003cFROM\u003e  source database location\n  \u003cTO\u003e    remote database location\n\nOptions:\n  -f, --force                              force writing backup file to existing file if specified\n      --no-log                             disable logging\n      --env \u003cENV\u003e\n  -s, --sqlite-cmd-path \u003cSQLITE_CMD_PATH\u003e  specify sqlite3 command path\n  -h, --help                               Print help\n  -V, --version                            Print version\n```\n\n#### `search`\n\n`bgpkit-broker search` queries for MRT files using the default production API unless specified otherwise.\n\n```text\n  Search MRT files in Broker db\n\nUsage: bgpkit-broker search [OPTIONS]\n\nOptions:\n      --no-log                       disable logging\n  -t, --ts-start \u003cTS_START\u003e          Start timestamp\n      --env \u003cENV\u003e\n  -T, --ts-end \u003cTS_END\u003e              End timestamp\n  -d, --duration \u003cDURATION\u003e          Duration string, e.g. 1 hour\n  -p, --project \u003cPROJECT\u003e            filter by route collector projects, i.e. `route-views` or `riperis`\n  -c, --collector-id \u003cCOLLECTOR_ID\u003e  filter by collector IDs, e.g. 'rrc00', 'route-views2. use comma to separate multiple collectors\n  -d, --data-type \u003cDATA_TYPE\u003e        filter by data types, i.e. 'updates', 'rib'\n      --page \u003cPAGE\u003e                  page number\n      --page-size \u003cPAGE_SIZE\u003e        page size\n  -u, --url \u003cURL\u003e                    Specify broker endpoint\n  -j, --json                         Print out search results in JSON format instead of Markdown table\n  -h, --help                         Print help\n  -V, --version                      Print version\n```\n\n#### `latest`\n\n`bgpkit-broker latest` queries for the latest MRT files of each route collector from RouteViews and RIPE RIS.\n\n- use `--collector COLLECTOR` to narrow down the display of the collector.\n- use `--outdated` flag to toggle showing only the files from collectors that have not been generating data timely\n- use `--json` flag to output to a JSON file instead of a Markdown table\n\n```text\n  Display latest MRT files indexed\n\nUsage: bgpkit-broker latest [OPTIONS]\n\nOptions:\n  -c, --collector \u003cCOLLECTOR\u003e  filter by collector ID\n      --no-log                 disable logging\n      --env \u003cENV\u003e\n  -u, --url \u003cURL\u003e              Specify broker endpoint\n  -o, --outdated               Showing only latest items that are outdated\n  -j, --json                   Print out search results in JSON format instead of Markdown table\n  -h, --help                   Print help\n  -V, --version                Print version\n```\n\n#### `live`\n\nStreaming live from a broker NATS server.\n\n```text\nStreaming live from a broker NATS server\n\nUsage: bgpkit-broker live [OPTIONS]\n\nOptions:\n      --no-log             disable logging\n  -u, --url \u003cURL\u003e          URL to NATS server, e.g. nats://localhost:4222. If not specified, will try to read from BGPKIT_BROKER_NATS_URL env variable\n      --env \u003cENV\u003e\n  -s, --subject \u003cSUBJECT\u003e  Subject to subscribe to, default to public.broker.\u003e\n  -p, --pretty             Pretty print JSON output\n  -h, --help               Print help\n  -V, --version            Print version\n```\n\n#### `peers`\n\nList public BGP collector peer information.\n\n```text\nList public BGP collector peers\n\nUsage: bgpkit-broker peers [OPTIONS]\n\nOptions:\n  -c, --collector \u003cCOLLECTOR\u003e  filter by collector ID\n      --no-log                 disable logging\n  -a, --peer-asn \u003cPEER_ASN\u003e    filter by peer AS number\n      --env \u003cENV\u003e\n  -i, --peer-ip \u003cPEER_IP\u003e      filter by peer IP address\n  -f, --full-feed-only         show only full-feed peers\n  -j, --json                   Print out search results in JSON format instead of Markdown table\n  -h, --help                   Print help\n  -V, --version                Print version\n```\n\nFor example, the command `bgpkit-broker peers --collector rrc00 --full-feed-only` lists all full-feed peers from\ncollector `rrc00`:\n\n```text\nbgpkit-broker peers --collector rrc00 --full-feed-only\n| date       | ip                                   | asn    | collector | num_v4_pfxs | num_v6_pfxs | num_connected_asns |\n|------------|--------------------------------------|--------|-----------|-------------|-------------|--------------------|\n| 2024-11-01 | 103.102.5.1                          | 131477 | rrc00     | 964311      | 0           | 3                  |\n| 2024-11-01 | 12.0.1.63                            | 7018   | rrc00     | 950205      | 0           | 2316               |\n| 2024-11-01 | 154.11.12.212                        | 852    | rrc00     | 952822      | 0           | 482                |\n| 2024-11-01 | 161.129.152.2                        | 13830  | rrc00     | 948244      | 0           | 120                |\n| 2024-11-01 | 165.16.221.66                        | 37721  | rrc00     | 833893      | 214125      | 4515               |\n| 2024-11-01 | 165.254.255.2                        | 15562  | rrc00     | 951002      | 0           | 2                  |\n| 2024-11-01 | 176.12.110.8                         | 50300  | rrc00     | 955141      | 0           | 1046               |\n...\n```\n\n#### `doctor`\n\nCheck broker instance health and missing collectors.\n\n```text\nCheck broker instance health and missing collectors\n\nUsage: bgpkit-broker doctor [OPTIONS]\n\nOptions:\n      --no-log     disable logging\n      --env \u003cENV\u003e\n  -h, --help       Print help\n  -V, --version    Print version\n```\n\nExample output (the data for the shown collectors are now available):\n\n```text\nchecking broker instance health...\n        broker instance at https://api.broker.bgpkit.com/v3 is healthy\n\nchecking for missing collectors...\nmissing the following collectors:\n| project    | name         | country         | activated_on        | data_url                                           |\n|------------|--------------|-----------------|---------------------|----------------------------------------------------|\n| routeviews | decix.jhb    | Malaysia        | 2022-12-20 12:00:00 | http://archive.routeviews.org/decix.jhb/bgpdata    |\n| routeviews | pacwave.lax  | United States   | 2023-03-30 12:00:00 | http://archive.routeviews.org/pacwave.lax/bgpdata  |\n| routeviews | pit.scl      | Chile           | 2023-08-31 23:45:00 | http://archive.routeviews.org/pit.scl/bgpdata      |\n| routeviews | amsix.ams    | The Netherlands | 2024-02-22 23:20:00 | http://archive.routeviews.org/amsix.ams/bgpdata    |\n| routeviews | pitmx.qro    | Mexico          | 2024-02-23 22:15:00 | http://archive.routeviews.org/pitmx.qro/bgpdata    |\n| routeviews | iraq-ixp.bgw | Iraq            | 2024-04-13 00:01:00 | http://archive.routeviews.org/iraq-ixp.bgw/bgpdata |\n```\n\n## Deployment\n\n### Docker\n\nYou can deploy the BGPKIT Broker service using the provided Docker image. The image is available on Docker Hub\nat [bgpkit/broker](https://hub.docker.com/r/bgpkit/bgpkit-broker).\n\nTo run in deattached mode (as a service):\n\n```bash\ndocker run -d -p 40064:40064 bgpkit/bgpkit-broker:latest\n```\n\nTo run as a service using `docker-compose`:\n\n``` bash\ndocker-compose up -d\n```\n\nYou can also build the Docker image from the source code:\n\n```bash\ndocker build -t bgpkit/bgpkit-broker:latest .\n```\n\n### On-premises CLI\n\nYou can also start a BGPKIT Broker instance on your own server using the `bgpkit-broker` CLI tool with the following\ncommand:\n\n```bash\nbgpkit-broker serve YOUR_SQLITE_3_FILE_PATH.sqlite3 --bootstrap --silent\n```\n\n* `YOUR_SQLITE_3_FILE_PATH.sqlite3` is the path to the SQLite3 database file.\n* `--bootstrap` flag is used to bootstrap the database content from the provided daily backup database.\n* `--silent` flag is used to disable the bootstrap download progress bar.\n\nOn a systemd managed OS like Debian or Ubuntu, you can also use the following service file to manage the BGPKIT Broker\nservice:\n\n```ini\n[Unit]\nDescription=BGPKIT Broker Service\nAfter=network.target\n\n[Service]\nExecStart=/usr/local/bin/bgpkit-broker serve /var/lib/bgpkit/broker.sqlite3\nRestart=on-failure\nUser=root\n\n[Install]\nWantedBy=multi-user.target\n```\n\nPut this file at `/etc/systemd/system/bgpkit-broker.service` and run `systemctl daemon-reload` to reload the service\nlist, and then you can start the service with `systemctl start bgpkit-broker`.\nTo enable the service to start on boot, run `systemctl enable bgpkit-broker`.\n\n## Data Provider\n\nIf you have publicly available data and want to be indexed BGPKIT Broker service, please email us at\ndata@bgpkit.com. Our back-end service is designed to be flexible and should be able to adapt to most data archiving\napproaches.\n\n\u003ca href=\"https://bgpkit.com\"\u003e\u003cimg src=\"https://bgpkit.com/Original%20Logo%20Cropped.png\" alt=\"https://bgpkit.com/favicon.ico\" width=\"200\"/\u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbgpkit%2Fbgpkit-broker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbgpkit%2Fbgpkit-broker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbgpkit%2Fbgpkit-broker/lists"}