Router package for Morpho protocol
npm install @morpho-dev/router> Status: Alpha – this is under active development and interfaces/behavior are subject to change.
CLI install
``bash`
pnpm add -g @morpho-dev/router
- Router configuration is read from a TOML file
- router start only accepts --config-file (or ROUTER_CONFIG_FILE/./router.toml)--mock
- Seed mock offers with for testing--file
- Load offers from JSON file with
Examples:
`bashStart router from a config file
router start --config-file ./router.toml
$3
Use
router chain to manage the anvil chain for dev and E2E workflows.`bash
Start a chain and emit JSON status
router chain start --output jsonCheck chain status
router chain status --output jsonStop the chain and purge state
router chain stop --purge
`Example
router.toml:`toml
[logging]
level = "info"[database]
url_env = "DATABASE_URL"
[api]
port = 7891
[indexer]
block_window = 8000
chains = ["ethereum"]
[chains."ethereum"]
rpc_url_env = "ETHEREUM_RPC_URL"
`
$3
#### Global
`text
Usage: router [options] [command]Router package for Morpho protocol
Options:
-V, --version output the version number
-h, --help display help for command
Commands:
start [options] Start Router services.
chain Manage the anvil chain lifecycle.
gatekeeper [options] Start Gatekeeper validation service.
help [command] display help for command
`#### start
`text
Usage: router start [options]Start Router services.
Options:
--config-file Path to router TOML config file
--mock Number of mock offers to seed
--file Seed offers from a JSON file
-h, --help display help for command
`#### chain
`text
Usage: router chain [options] [command]Manage the anvil chain lifecycle.
Options:
-h, --help display help for command
Commands:
start [options] Start an anvil chain.
status [options] Show chain status.
stop [options] Stop the chain process.
restart [options] Restart the chain process.
logs [options] Read anvil logs.
help [command] display help for command
`#### gatekeeper
`text
Usage: router gatekeeper [options]Start Gatekeeper validation service.
Options:
--config-file Path to router TOML config file
-h, --help display help for command
``