This set of instructions works on the following:
- Ubuntu 18.04
- 4 vCPU (
amd64
only) - 4 GB RAM
- 32 GB storage
Watch a time-compressed video.
Setup the account for automated sudo
privileges, install the git
program, and clone the repository.
echo "${USER} ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/010_${USER}-nopasswd
sudo apt install -qq -y git
git clone http://github.com/dcmartin/open-horizon
Run the update and upgrade processes for the system and then install the required tools; when complete, add the account to the docker
group and reboot the machine.
sudo apt update -qq -y
sudo apt upgrade -qq -y
sudo apt install -qq -y build-essential net-tools jq curl apache2-utils gnupg2 pass docker-compose
sudo addgroup ${USER} docker
sudo reboot
Initialize the random number generator, change to the directory and use make
to build the exchange.
touch ~/.rnd
cd open-horizon
make exchange
curl localhost:3090/v1/admin/version
Run the provided shell script to download horizon
, bluehorizon
, and horizon-cli
packages and install.
sudo ./sh/get.horizon.sh
export HZN_EXCHANGE_URL=$(hzn node list | jq -r '.configuration.exchange_api')
Run provided script to list users in the exchange; please change the HZN_EXCHANGE_APIKEY
as appropriate:
export HZN_USER_ID=${USER} HZN_ORG_ID=${USER} HZN_EXCHANGE_APIKEY=whocares
./sh/lsusers.sh
Example output:
{
"exchange": "http://localhost:3090/v1/",
"org": "dcmartin",
"users": [
{
"password": "********",
"admin": true,
"email": "dcmartin@dcmartin",
"lastUpdated": "2020-05-07T17:22:36.807Z[UTC]",
"updatedBy": "root/root",
"id": "dcmartin/dcmartin"
}
]
}
Login to Docker (aka hub.docker.com
); the DOCKER_NAMESPACE
defaults to USER
environment variable;
override by setting the environment variable or creating a persistent file of the same name.
docker login
As an example and to provide a means to browse the exchange, build the hznmonitor
service and start it. The hznmonitor
service is built from the apache-ubuntu
container, which is built from the base-ubuntu
_container; all three containers will be built, pushed to Docker hub, and published in the exchange.
The service requires the following files to be created (n.b. all string values must be enclosed in quotation marks ["]):
KAFKA_APIKEY
- API key for an IBM event streams Kafka server (n.b. this will be removed in future versions)MQTT_HOST
- TCP/IPv4 address or FQDN for a MQTT broker (seemqtt
)MQTT_USERNAME
- broker credentialsMQTT_PASSWORD
- broker credentials
make hznmonitor
Browse the exchange and the services published using a Web browser on port 3094, e.g. http://127.0.0.1:3094/
Build, push, and publish all the services; there are also sample patterns which may be published from within the services/
subdirectory. For more information see SERVICE.md
make services