panurus

Panurus

Performance Tip: Use Ctrl+F to jump to sections using anchor links (e.g., #building-and-running)

πŸš€ Quick Reference Commands

Testing

Development & CI Preparation

Maintenance

πŸ“ Project Structure

token/
β”œβ”€β”€ core/          # Driver implementations (fabtoken, zkatdlog)
β”œβ”€β”€ driver/        # Interface definitions (ports)
β”œβ”€β”€ services/      # High-level services (identity, network, ttx, storage)
└── sdk/           # Public API entry points
integration/
β”œβ”€β”€ nwo/           # Network Orchestrator for test networks
└── token/         # Actual test suites (fungible, nft, dvp, etc.)

πŸ”§ Development Workflow

1. Setup (One-time)

make install-tools
make download-fabric
export FAB_BINS=$PWD/../fabric/bin
make docker-images
make testing-docker-images

2. Daily Development

# Code quality
make lint-auto-fix
make checks

# Testing
make unit-tests          # Standard
make unit-tests-race     # With race detection
make integration-tests-fabtoken-fabric-t1  # Integration tests

3. Debugging

# Performance profiling
go test -cpuprofile=cpu.out ./...
go test -memprofile=mem.out ./...

# Focused testing
make integration-tests-dlog-fabric TEST_FILTER="T1"

πŸ› Troubleshooting Quick Reference

πŸ”„ CI Workflow Overview

To ensure your commits pass CI automatically, understand what runs:

πŸ”§ Pre-Merge Checks (GitHub Actions)

All PRs and pushes to main trigger these workflows:

  1. Checks Job (Prerequisite):
    • License verification
    • Code formatting (gofmt, goimports)
    • Static analysis (govet, staticcheck, ineffassign, misspell)
    • Run locally with: make checks
  2. Unit Testing:
    • Race detector enabled tests
    • Regression tests
    • Coverage reporting to Coveralls
  3. Integration Testing (Extensive Matrix):
    • Fabtoken (cleartext tokens): t1-t5
    • ZKATDLog (privacy tokens): t1-t13
    • Fabric-X, Interop, NFT, DVP, Update tests
    • Stress tests
    • All with coverage reporting
  4. Separate Workflows:
    • golangci-lint: Comprehensive linting (30 min timeout)
    • Markdown links: Validates all doc links
    • CodeQL: Security analysis (weekly + on push/PR)

πŸ’‘ Best Practices for CI Success

πŸ—οΈ Architecture Overview

Core Patterns

Key Technologies

πŸ§ͺ Testing Strategy

Unit Tests

Integration Tests

Mocking Best Practices

πŸ“ Development Conventions

Coding Standards

Git Workflow

Plan Documentation (Workflow Rule)

Before implementing any task:

  1. Create plan.md in project root with:
    • Clear goal description
    • Numbered implementation steps
    • β€œImplementation Progress” section with [ ] Pending checkboxes
  2. Update immediately when completing steps: [x] Done + brief change notes
  3. Log blockers/decisions under ## Notes & Decisions
  4. Mark plan as βœ… COMPLETE when finished

πŸ” Debugging & Advanced Testing

Log Locations

Debugging Techniques

πŸ“š Key Files & Directories

πŸ”„ CI Workflow Overview

To ensure your commits pass CI automatically, understand what runs:

πŸ”§ Pre-Merge Checks (GitHub Actions)

All PRs and pushes to main trigger these workflows:

  1. Checks Job (Prerequisite):
    • License verification
    • Code formatting (gofmt, goimports)
    • Static analysis (govet, staticcheck, ineffassign, misspell)
    • Run locally with: make checks
  2. Unit Testing:
    • Race detector enabled tests
    • Regression tests
    • Coverage reporting to Coveralls
  3. Integration Testing (Extensive Matrix):
    • Fabtoken (cleartext tokens): t1-t5
    • ZKATDLog (privacy tokens): t1-t13
    • Fabric-X, Interop, NFT, DVP, Update tests
    • Stress tests
    • All with coverage reporting
  4. Separate Workflows:
    • golangci-lint: Comprehensive linting (30 min timeout)
    • Markdown links: Validates all doc links
    • CodeQL: Security analysis (weekly + on push/PR)

πŸ’‘ Best Practices for CI Success