nim-codex/docker
Ben Bierens db9d90b465
Dht debug (#446)
* Support for building docker images with local modifications for the purpose of testing and debugging

* exposes peer information via debug/info

* api-names slightly kinder to json serializers

* Moves debug image-building

* fixes misalignment of debug peer info array

* Changes switchPeers source from KeyBook to AddressBook (filed ticket in libp2p, discussed with Tanguy)

* Limited success with dist-test peer discovery tests

* Removes unnecessary random-timer

* bumps dht repo. Adds peerId to formatNode

* Removes unused prints

* bumps libp2p-dht

* Exposes node address on debug api

* Adds traces

* review comments by me

* Hides debug/peers api behind compile flag

* Waiting for nim-libp2p-dht PR merge

* bumps libp2p-dht back to main after PRs were merged there.

* Cleanup
2023-06-19 08:21:03 +02:00
..
README.md Makes required arguments overrideable from environment variables (#377) 2023-03-20 15:07:07 +01:00
codex.Dockerfile Dht debug (#446) 2023-06-19 08:21:03 +02:00
docker-compose.yaml Docker build (#354) 2023-03-08 12:45:55 +01:00
startCodex.sh Dht debug (#446) 2023-06-19 08:21:03 +02:00

README.md

Codex Docker Image

Build and run using the example docker-compose file: docker-compose up -d

Stop and retain image and volume data: docker-compose down

Stop and delete image and volume data: docker-compose down --rmi all -v rm -R hostdatadir

Environment variables

Codex docker image supports the following environment variables:

  • LISTEN_ADDRS(*)
  • API_BINDADDR(*)
  • DATA_DIR(*)
  • LOG_LEVEL
  • METRICS_ADDR
  • METRICS_PORT
  • NAT_IP
  • API_PORT
  • DISC_IP
  • DISC_PORT
  • NET_PRIVKEY
  • BOOTSTRAP_SPR
  • MAX_PEERS
  • AGENT_STRING
  • STORAGE_QUOTA
  • BLOCK_TTL
  • CACHE_SIZE
  • ETH_PROVIDER
  • ETH_ACCOUNT
  • ETH_DEPLOYMENT

(*) These variables have default values in the docker image that are different from Codex's standard default values.

All environment variables are optional and will default to Codex's CLI default values.

Constants

Codex CLI arguments 'data-dir', 'listen-addrs', and 'api-bindaddr' cannot be configured. They are set to values required for docker in case of bind addresses. In the case of 'data-dir', the value is set to /datadir. It is important that you map this folder to a host volume in your container configuration. See docker-compose.yaml for examples.

Useful

Connect nodes with the /connect endpoint. To get the IP address of a container within a network: Find container Id: docker ps Open terminal in container: docker exec -it <CONTAINER ID> sh Get IP addresses: ifconfig