Custom development scripts and configuration for the network project. These scripts provide convenient shortcuts for building, testing, linting, and managing the core network codebase.
This repository contains:
- direnv configuration (
.envrc) - Environment setup for the network project - .direnv directory - Contains Neovim config and development scripts
- Neovim configuration (
.direnv/.nvim.lua) - Project-specific Neovim settings - Development scripts (
.direnv/bin/) - Build, test, and utility scripts
- Neovim configuration (
This repository is designed to be used via symbolic links from the network bare repository.
Run the setup script to create the necessary symbolic links:
./setup.shThis will create:
~/work/network/.direnv→~/work/network-scripts/.direnv~/work/network/.envrc→~/work/network-scripts/.envrc
If you prefer to set up manually:
# Create directory symlink
ln -sf ~/work/network-scripts/.direnv ~/work/network/.direnv
# Create file symlink
ln -sf ~/work/network-scripts/.envrc ~/work/network/.envrc
# Reload direnv
cd ~/work/network
direnv allow- direnv - For environment variable management
- Go 1.22+ - Required for building and testing
- Docker - Required for E2E tests and container management
- Task - Task runner for build commands
- golangci-lint - For code linting
- ripgrep (rg) - For fast text search
Builds the core-network project with CGO flags and displays a spinner during compilation.
buildRuns a specific unit test by name. Uses ripgrep to find the test location and runs it with race detection.
ut TestName [additional-go-test-flags]Runs all unit tests in the core-network project.
ut-allRuns unit tests for a specific package path.
ut-specific ./pkg/some/packageBuilds all components and runs end-to-end integration tests with Docker Compose scenarios.
e2e [test-filter]Environment variables:
CORE_NETWORK_E2E_PARALLEL- Number of parallel test runs (default: 3)
Runs E2E tests without rebuilding components (faster for iterative testing).
e2e-no-build [test-filter]Runs E2E performance tests.
e2eperfRuns linters on modified Go files. Automatically detects changes and runs appropriate linters:
- golangci-lint
- custom linters
- mock generation
- checklocks linter (for core-network)
lintRemoves all Docker containers (useful for cleaning up test environments).
clean_containersPrunes unused Docker networks.
clean_networkChecks network connectivity and connection status (likely for testing network components).
conn-checkChecks routing configuration and status.
route-checkSynchronizes the main branch (likely updates main worktree from remote).
sync-mainPulls ziggy-related updates (custom deployment/testing tool).
pull-ziggyPushes ziggy-related updates.
push-ziggySets up the development environment when entering the network directory. Includes:
- Python environment (pyenv)
- Go workspace configuration
- PATH additions for local scripts and tools
- Custom environment variables
Neovim project-specific configuration for LSP and editor settings.
-
Navigate to the network directory:
cd ~/work/network
-
Make code changes in your worktree
-
Run tests:
ut TestName # Run specific test ut-all # Run all unit tests e2e # Run E2E tests
-
Run linters before committing:
lint
-
Build if needed:
build
To update these scripts:
- Edit scripts in this repository (
~/work/network-scripts/) - Commit and push changes
- Changes are immediately available via symlinks at
~/work/network/.direnv/bin/
# Verify symlinks exist
ls -la ~/work/network/.direnv
ls -la ~/work/network/.envrc
# Re-run setup if needed
./setup.shcd ~/work/network
direnv allowchmod +x ~/work/network-scripts/bin/*network-dev-scripts/
├── .direnv/ # Directory symlinked to ~/work/network/.direnv
│ ├── .nvim.lua # Neovim configuration
│ └── bin/ # Development scripts
│ ├── build # Build core-network
│ ├── clean_containers # Clean Docker containers
│ ├── clean_network # Clean Docker networks
│ ├── conn-check # Check connections
│ ├── e2e # Run E2E tests
│ ├── e2e-no-build # Run E2E without build
│ ├── e2eperf # Run E2E performance tests
│ ├── lint # Run linters
│ ├── pull-ziggy # Pull ziggy updates
│ ├── push-ziggy # Push ziggy updates
│ ├── route-check # Check routes
│ ├── sync-main # Sync main branch
│ ├── ut # Run specific unit test
│ ├── ut-all # Run all unit tests
│ └── ut-specific # Run tests for specific package
├── .envrc # direnv configuration (symlinked)
├── .gitignore # Git ignore patterns
├── README.md # This file
└── setup.sh # Symlink setup script
Private repository for internal development use.