docker-compose: Remove i2pd-server

We can just connect to the the first i2pd service.
Additionally, the testnet also checks for the routerInfo of all routers.
This commit is contained in:
2021-01-05 19:36:39 +01:00
parent cb1369a27f
commit 78d7f59c18
2 changed files with 19 additions and 36 deletions

View File

@ -11,25 +11,12 @@ services:
build:
context: i2p
depends_on:
- i2pd-floodfill1
- i2pd-floodfill2
- i2pd-floodfill
networks:
- no_internet
volumes:
- netdb:/var/lib/i2p/i2p-config/netDb
i2pd-server:
build:
context: i2p
depends_on:
- i2pd-floodfill1
- i2pd-floodfill2
networks:
no_internet:
ipv4_address: 172.16.200.10
volumes:
- netdb:/var/lib/i2p/i2p-config/netDb
contained:
build:
context: contained/
@ -39,6 +26,8 @@ services:
- NET_RAW
depends_on:
- i2pd
environment:
PROXY_SAM_HOST: 172.16.200.3 # First floodfill
volumes:
- /tmp/contained:/mount
- ./contained/bin:/opt/bin
@ -46,19 +35,8 @@ services:
no_internet:
ipv4_address: 172.16.200.20
i2pd-floodfill1:
build:
context: i2p
args:
FLOODFILL: "true"
depends_on:
- volume_setup
networks:
- no_internet
volumes:
- netdb:/var/lib/i2p/i2p-config/netDb
i2pd-floodfill2:
# Must have at least 2!
i2pd-floodfill:
build:
context: i2p
args:

View File

@ -12,39 +12,44 @@ IFS=$'\n\t'
routerCount=${1:-2}
WAIT_TIME=60
FLOODFILL_COUNT=2
_log(){
echo "====$1"
}
_execAll(){
for i in $(seq 1 ${routerCount})
service=$1 ; shift
serviceCount=$1 ; shift
for i in $(seq 1 ${serviceCount})
do
_log "==Router $i"
docker-compose exec --index $i i2pd "$@"
_log "==$service $i"
docker-compose exec --index $i $service "$@"
done
}
_log "Clean everything"
docker-compose down -v --remove-orphans
_log "Start up ${routerCount} router(s)"
docker-compose up -d --scale i2pd=${routerCount}
_log "Start up ${routerCount} router(s) and ${FLOODFILL_COUNT} floodfills"
docker-compose up -d --scale i2pd=${routerCount} --scale=i2pd-floodfill=${FLOODFILL_COUNT}
totalRouterCount=$(( $routerCount + $FLOODFILL_COUNT ))
riCount=0
while [ $riCount != $routerCount ]; do
while [ $riCount != $totalRouterCount ]; do
_log "Waiting ${WAIT_TIME} seconds out of courtesy"
sleep ${WAIT_TIME}s
_log "Gracefully shut them down to store their routerInfo (RI) in the netDb"
_execAll i2prouter stop
_execAll i2pd-floodfill ${FLOODFILL_COUNT} i2prouter stop
_execAll i2pd ${routerCount} i2prouter stop
_log "Starting all routers back up"
sleep 5s
docker-compose start i2pd-floodfill
docker-compose start i2pd
_log "Contents of netDb (expecting ${routerCount} entries)"
_log "Contents of netDb (expecting ${totalRouterCount} entries)"
netDbOutput="$(docker-compose exec i2pd find netDb -name '*.dat')"
riCount=$(echo "${netDbOutput[@]}" | grep routerInfo | wc -l)
_log "Found $riCount entries:"