Complete setup guide for the Camino Messenger Protocol (CMP) integration with Hubby eSIM API.
This repository contains two components that enable Hubby to integrate with the Camino travel network:
- Partner Plugin (
camino-partner-plugin/) - A gRPC server that bridges Camino Messenger Bots with the Hubby API - Bot Configuration (
camino-bot/) - Docker configuration for running Camino Messenger Bots
┌─────────────────────────────────────────────────────────────────────────────┐
│ Camino Network (Matrix) │
│ messenger.chain4travel.com │
└─────────────────────────────────────┬───────────────────────────────────────┘
│
┌───────────────────────┼───────────────────┐
│ │ │
▼ ▼ ▼
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ External │ │ Your Supplier │ │ Your Distributor│
│ Distributors │ │ Bot (Docker) │ │ Bot (Docker) │
└─────────────────┘ └────────┬────────┘ └─────────────────┘
│
│ gRPC (port 50051)
▼
┌─────────────────┐
│ Partner Plugin │ ◄── This repo
│ (Node.js) │
└────────┬────────┘
│
│ HTTP/REST
▼
┌─────────────────┐
│ Hubby API │ ◄── backend-hubby
│ (Firebase) │
└─────────────────┘
- Node.js >= 18
- Docker and Docker Compose
- grpcurl (for testing):
brew install grpcurl - Access to Hubby API (Firebase emulator or deployed instance)
hubby-cmp/
├── camino-partner-plugin/ # gRPC Partner Plugin
│ ├── src/ # TypeScript source code
│ │ ├── api/ # Hubby API client
│ │ ├── handlers/ # gRPC service handlers
│ │ ├── cache/ # Search result cache
│ │ ├── config.ts # Configuration
│ │ └── server.ts # gRPC server entry point
│ ├── proto/official/ # CMP protocol definitions (submodule)
│ ├── package.json
│ ├── tsconfig.json
│ ├── Dockerfile
│ └── docker-compose.yml
│
├── camino-bot/ # Camino Messenger Bot config
│ ├── cmb-config/ # Bot configuration files
│ │ ├── supplier-config.yaml
│ │ └── distributor-config.yaml
│ ├── supplier-bot-db/ # Supplier bot database (auto-generated)
│ ├── distributor-bot-db/ # Distributor bot database (auto-generated)
│ ├── docker-compose.yml # Bot containers
│ ├── e2e-test.sh # End-to-end test script
│ └── TESTING.md # Testing documentation
│
└── README.md # This file
git clone https://github.com/your-org/hubby-cmp.git
cd hubby-cmpThe Partner Plugin requires the Hubby API to be running. If using Firebase Emulator:
cd /path/to/backend-hubby/functions
npm install
npm run serveThe API will be available at http://localhost:5001/hubby-esim-dev/europe-west4/api_v2
cd camino-partner-plugin
# Install dependencies
npm install
# Build TypeScript
npm run build
# Start the server
HUBBY_API_URL=http://localhost:5001/hubby-esim-dev/europe-west4/api_v2 npm run grpc:serverYou should see:
═══════════════════════════════════════════════════════════════════
CMP Partner Plugin - Standalone (v4)
═══════════════════════════════════════════════════════════════════
Hubby API URL: http://localhost:5001/hubby-esim-dev/europe-west4/api_v2
Public API URL: http://localhost:5001/hubby-esim-dev/europe-west4/api_v2
✓ cmp.services.activity.v4.ActivitySearchService
✓ cmp.services.activity.v4.ActivityProductInfoService
✓ cmp.services.activity.v4.ActivityProductListService
✓ cmp.services.book.v4.ValidationService
✓ cmp.services.book.v4.MintService
✓ cmp.services.notification.v3.NotificationService
═══════════════════════════════════════════════════════════════════
Server running on 0.0.0.0:50051
═══════════════════════════════════════════════════════════════════
cd camino-bot
# Pull the latest bot image
docker-compose pull
# Start the supplier bot
docker-compose up supplier_botImportant: Start services in this order:
- Hubby API (Firebase)
- Partner Plugin
- Supplier Bot (requires NotificationService on startup)
Test that the Partner Plugin is responding:
grpcurl -plaintext localhost:50051 listExpected output:
cmp.services.activity.v4.ActivityProductInfoService
cmp.services.activity.v4.ActivityProductListService
cmp.services.activity.v4.ActivitySearchService
cmp.services.book.v4.MintService
cmp.services.book.v4.ValidationService
cmp.services.notification.v3.NotificationService
grpc.reflection.v1alpha.ServerReflection
| Variable | Default | Description |
|---|---|---|
HUBBY_API_URL |
http://localhost:5001 |
Hubby REST API URL (internal) |
PUBLIC_API_URL |
(falls back to HUBBY_API_URL) |
Public URL for NFT metadata (must be publicly accessible for blockchain) |
GRPC_PORT |
50051 |
gRPC server port |
GRPC_HOST |
0.0.0.0 |
gRPC server bind address |
HUBBY_API_URL=http://localhost:5001/hubby-esim-dev/europe-west4/api_v2 \
npm run grpc:serverHUBBY_API_URL=http://localhost:5001/hubby-esim-dev/europe-west4/api_v2 \
PUBLIC_API_URL=https://your-subdomain.ngrok.io/hubby-esim-dev/europe-west4/api_v2 \
npm run grpc:serverBot configuration files are in camino-bot/cmb-config/:
| Setting | Description |
|---|---|
developer_mode |
Set to true for verbose logging |
bot_key |
Private key for the bot (hex, no 0x prefix) |
cm_account_address |
CM Account address on Camino Network |
partner_plugin.host |
Partner Plugin address (use host.docker.internal:50051 in Docker) |
partner_plugin.enabled |
Must be true if handling services |
booking_token_address |
Booking Token smart contract address |
chain_rpc_url |
Camino C-Chain RPC WebSocket URL |
The Partner Plugin implements these CMP v4 services:
| Service | Description |
|---|---|
ActivitySearchService |
Search for eSIM products by location, dates |
ActivityProductInfoService |
Get detailed product information |
ActivityProductListService |
List all available products |
ValidationService |
Validate a booking (locks price) |
MintService |
Create a booking (mints NFT) |
NotificationService |
Handle on-chain event notifications |
The Partner Plugin calls these Hubby API endpoints:
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/partner/destinations |
List all destinations with bundles |
| GET | /api/partner/destinations/:id |
Get single destination |
| POST | /api/partner/validations |
Create a price validation |
| GET | /api/partner/validations/:id |
Get validation details |
| POST | /api/partner/bookings |
Create booking from validation |
| GET | /api/partner/bookings/:id |
Get booking details |
| GET | /api/partner/bookings/:id/metadata |
Get NFT metadata (ERC-721) |
Run the automated e2e test:
cd camino-bot
./e2e-test.sh --verboseOptions:
--help Show all options
--verbose Show full JSON responses
--dry-run Stop after validation (don't create booking)
--host HOST Distributor host (default: 3.74.156.61:9090)
# Search for eSIM products
grpcurl -plaintext -d '{
"header": {"base_header": {"version": {"major": 4}}},
"travellers": [{"traveller_id": 1, "type": "TRAVELLER_TYPE_ADULT"}]
}' localhost:50051 cmp.services.activity.v4.ActivitySearchService/ActivitySearch
# List all products
grpcurl -plaintext -d '{
"header": {"base_header": {"version": {"major": 4}}}
}' localhost:50051 cmp.services.activity.v4.ActivityProductListService/ActivityProductList# List destinations
curl http://localhost:5001/hubby-esim-dev/europe-west4/api_v2/api/partner/destinations
# Create validation
curl -X POST http://localhost:5001/hubby-esim-dev/europe-west4/api_v2/api/partner/validations \
-H "Content-Type: application/json" \
-d '{"destination_id": "ESP", "bundle_id": "DATA_LIMITED_1GB_TEST_ESP", "quantity": 1}'These wallets are for testing on the Columbus testnet:
| Role | Mnemonic |
|---|---|
| Partner | eye multiply clump win seed hidden social ten menu poem shell knee valley sustain bright impact rely foam bullet orchard rough base enforce apology |
| Supplier | quiz answer trap author innocent bar soft family layer close ocean seed tide deny exhibit enlist wealth bacon phone extend direct tower fat make |
| Distributor | science explain kidney tip access nephew prosper rib voyage correct program hollow assault immense tray smile pudding dolphin vessel lava prepare together blind into |
| Entity | CM Account Address |
|---|---|
| Supplier (Hubby) | 0xe45ed0700e7d9c8e0cd338bfe86dd2fcd84bf2fc |
- Check Node.js version:
node -v(must be >= 18) - Verify
HUBBY_API_URLis accessible - Check port 50051 is not in use
- Ensure Partner Plugin is running on port 50051
- In Docker, use
host.docker.internal:50051inpartner_plugin.host - Verify with:
grpcurl -plaintext localhost:50051 list
Start the Partner Plugin before the Supplier Bot. The bot checks for pending notifications on startup.
Your network may be blocked. Try from a different network or check firewall settings.
- Ensure
PUBLIC_API_URLis set to a publicly accessible URL - Use ngrok for local development:
ngrok http 5001 - Verify the metadata endpoint is accessible:
curl $PUBLIC_API_URL/api/partner/bookings/{id}/metadata
cd camino-partner-plugin
# Install dependencies
npm install
# Run in development mode (with ts-node)
npm run dev
# Build for production
npm run buildThe CMP protocol definitions are in camino-partner-plugin/proto/official/. These are from the official CMP repository.
To update:
cd camino-partner-plugin/proto/official
git pull origin mainMIT