Makefile 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. .POSIX:
  2. # Suppress all directory-related messages for cleaner output
  3. MAKEFLAGS += --no-print-directory
  4. help:
  5. @echo "Explorer Makefile Commands:"
  6. @echo ""
  7. @echo "Network management:"
  8. @echo " make start-localnet - Start explorer environment on Darkfi localnet"
  9. @echo " make start-testnet - Start explorer environment on Darkfi testnet"
  10. @echo " make start-mainnet - Start explorer environment on Darkfi mainnet"
  11. @echo " make stop - Stop running explorer environment"
  12. # Start a full explorer environment on Darkfi networks (localnet, testnet, mainnet)
  13. start-%:
  14. @echo "Starting $* environment..."
  15. @sh -c ' \
  16. trap "echo Interrupt detected; make stop; exit 0" INT; \
  17. $(MAKE) -C ./explorerd start-$*; \
  18. $(MAKE) -C ./explorerd await-startup-$*; \
  19. $(MAKE) -C ./site start-$*; \
  20. echo "Started $* environment. Press Ctrl-C to stop."; \
  21. while true; do sleep 1; done; \
  22. '
  23. # Start no-sync explorer (localnet/testnet/mainnet) without connecting to or syncing with the Darkfi blockchain
  24. start-no-sync-%:
  25. @echo "Starting $* environment (no sync)..."
  26. @sh -c ' \
  27. trap "echo Interrupt detected; make stop; exit 0" INT; \
  28. $(MAKE) -C ./explorerd start-no-sync-$*; \
  29. $(MAKE) -C ./explorerd await-startup-no-sync-$*; \
  30. $(MAKE) -C ./site start-$*; \
  31. echo "Started $* environment in no sync mode. Press Ctrl-C to stop."; \
  32. while true; do sleep 1; done; \
  33. '
  34. # Stop the running network
  35. stop:
  36. @$(MAKE) -C ./explorerd stop || true; \
  37. $(MAKE) -C ./site stop || true; \
  38. .PHONY: start-% check-minerd check-darkfid check-explorerd check-site stop