This document describes setting up the proxy-router component of the Morpheus AI Network in a Docker container ONLY and accessing it via the Swagger API Interface...no GUI or Wallet components are included in this setup
- The Proxy-Router is a critical component of the Morpheus AI Network. It is responsible for monitoring the blockchain for events and managing the AI models and providers that are available to the network.
- The Proxy-Router is a standalone application that can be run on any server that has access to the blockchain and the AI models.
- This document walks through using Docker to build and run the proxy-router image on your server.
- Your AI model has been configured, started and made available to the proxy-router server via a private endpoint (IP:PORT or DNS:PORT) eg:
http://mycoolaimodel.domain.com:8080 - You have an existing funded wallet with MOR and ETH and also have the
private keyfor the wallet (this will be needed for the .env file configuration) - Your proxy-router must have a publicly accessible endpoint for the provider (ip:port or fqdn:port no protocol) eg:
mycoolmornode.domain.com:3333- this will be used when creating the provider on the blockchain
- We have added a published Docker image to the GitHub Container Registry (ghcr.io) for the proxy-router component
- The image is built from the main branch of the repository and is updated with each new release
- The image is available at: Morpheus Node Package source for the different builds
- Docker is installed and current on your server
- Volume mapping for the data directory is required for the proxy-router to persist data across container restarts
- Key configuration files are located in mounted volumes on the host server:
- proxy-router.env - env variables configured per proxy-router.all.env
- .cookie - this is created initially when proxy-router starts up
- proxy.conf - controls agent/user access to the api
- models-config.json - model configuration file
- rating-config.json - rating configuration file
- Note the use of
-vfor external volume (should be avaialbe on the host) and-efor environment variables - Ports can be changed for the PROXY_ADDRESS and WEB_ADDRESS as needed ... make sure that the
-pports are mapped correctly to the container ports
- The .env file contains all the environment variables needed to run the proxy-router
- Minimal config of the .env file that is required to run the proxy-router and includes the file paths for the key configuration files
# Minimal .env file contents with external volume references
AUTH_CONFIG_FILE_PATH=/app/data/proxy.conf
COOKIE_FILE_PATH=/app/data/.cookie
RATING_CONFIG_PATH=/app/data/rating-config.json
PROXY_STORAGE_PATH=/app/data/data
MODELS_CONFIG_PATH=/app/data/models-config.json
ETH_NODE_CHAIN_ID=
BLOCKSCOUT_API_URL=
DIAMOND_CONTRACT_ADDRESS=
MOR_TOKEN_ADDRESS=
WALLET_PRIVATE_KEY=
PROXY_ADDRESS=0.0.0.0:3333
WEB_ADDRESS=0.0.0.0:8082
WEB_PUBLIC_URL=http://localhost:8082- Once the .env file has been created, execute the following command to run the proxy-router Docker container
- Adjust the image tag to the version you want to run
# Minimal Docker Run Command using a .env file
docker run -d \
--env-file proxy-router.env \
-v /path/to/local/data:/app/data \
-p 3333:3333 \
-p 8082:8082 \
ghcr.io/morpheusais/morpheus-lumerin-node:latest# Minimal Docker Run Command and mandatory variables (no .env file necessary)
docker run -d \
-e AUTH_CONFIG_FILE_PATH=/app/data/proxy.conf \
-e COOKIE_FILE_PATH=/app/data/.cookie \
-e RATING_CONFIG_PATH=/app/data/rating-config.json \
-e PROXY_STORAGE_PATH=/app/data/data \
-e MODELS_CONFIG_PATH=/app/data/models-config.json \
-e ETH_NODE_CHAIN_ID= \
-e BLOCKSCOUT_API_URL= \
-e DIAMOND_CONTRACT_ADDRESS= \
-e MOR_TOKEN_ADDRESS= \
-e WALLET_PRIVATE_KEY= \
-e PROXY_ADDRESS=0.0.0.0:3333 \
-e WEB_ADDRESS=0.0.0.0:8082 \
-e WEB_PUBLIC_URL=http://localhost:8082 \
-v /path/to/local/data:/app/data \
-p 3333:3333 \
-p 8082:8082 \
ghcr.io/morpheusais/morpheus-lumerin-node:latest- Optionally, you can build and run your own Docker image using the provided Dockerfile and docker_build.sh script
- This is useful if you want to customize the image or if you want to build the image on a server that does not have access to the internet
- Docker and Git are installed and current on your server
- The three key configuration files are located in the same directory as the proxy-router code:
- .env
- models-config.json
- rating-config.json
- Clone the source code from the repository:
git clone -b main https://github.com/MorpheusAIs/Morpheus-Lumerin-Node.git
- Change to the proxy-router directory:
cd Morpheus-Lumerin-Node\proxy-router
- Configure the 3 key files for your environment:
- Environment file configuration
- Copy the example file to .env:
- Linux/Mac:
cp .env.example .env - Windows:
copy .env.example.win .env
- Linux/Mac:
- Edit values within the .env as desired
- Add your private key to
WALLET_PRIVATE_KEY= - Modify the following values to ensure that those files remain "outside of the running container" for persistence and are mounted by the docker-compose.yml file's
volumedirectiveAUTH_CONFIG_FILE_PATH=/app/data/proxy.confCOOKIE_FILE_PATH=/app/data/.cookieMODELS_CONFIG_PATH=/app/data/models-config.jsonRATING_CONFIG_PATH=/app/data/rating-config.jsonPROXY_STORAGE_PATH=/app/data/
- Add your private key to
- Choose the blockchain you'd like to work on...BASE MAINNET is the default
- To operate on the BASE Sepolia TESTNET,
- Uncomment the
TESTNET VALUESand comment theMAINNET VALUESlines & save the file
- Copy the example file to .env:
- Models Configuration file
- Copy the example file to models-config.json:
- Linux/Mac:
cp models-config.json.example models-config.json - Windows:
copy models-config.json.example models-config.json
- Linux/Mac:
- Edit the models-config.json file to include the models you'd like to use.
- Details here: models-config.json.md
- Once your provider is up and running, deploy a new model and model bid via the API interface (you will need to update the
modelIdfor the configuration)
- Copy the example file to models-config.json:
- Rating Configuration file
- Copy the example file to rating-config.json:
- Linux/Mac:
cp rating-config.json.example rating-config.json - Windows:
copy rating-config.json.example rating-config.json
- Linux/Mac:
- Edit the rating-config.json file to include the weights and preferred providers you'd like to use.
- Details here: rating-config.json.md
- Copy the example file to rating-config.json:
- Environment file configuration
- Build the Docker image using the provided
docker_build.shscript./docker_build.sh --build- This script pulls the current Git tag and version, builds the docker image with all the port and defaults defined in the docker-compose.yml file
- Run the Docker container using the provided
docker_build.shscript./docker_build.sh --run- This script runs the docker container with the port and volume mappings defined in the docker-compose.yml file
- The proxy-router will start and begin listening for blockchain events
- Once the proxy-router is running, you can navigate to the Swagger API Interface (http://localhost:8082/swagger/index.html as example) to validate that the proxy-router is running and listening for blockchain events
- Once validated, you can move on and create your provider, model and bid on the blockchain 03-provider-offer.md
- We have created docker-compose.yml, Dockerfile and docker_build.sh scripts to ease configuration and deployment of the proxy-router in a containerized environment
- Use these files as guides for applying to your system needs and configurations, private key, eth_node, ports, endpoints, volumes, .env, models-config.json and rating-config.json will need to be adjusted to your specific needs
- In most cases, the default .env file will work for the proxy-router...In some cases you will want to modify the .env file with advanced capability (log entries, private keys, private endpoints, etc)
- Please see the following for more information on these key config files: