A distributed byte sequencer built with Go and CometBFT that produces a uniform sequence of bytes from multiple uncoordinated producers. The system ensures that all nodes maintain the same sequence of bytes, even when they receive different input transactions.
- Distributed byte sequence coordination
- Byzantine Fault Tolerance (BFT) consensus
- Multi-node support with independent inputs
- Consistent byte sequence across all nodes
- Load testing capabilities
- Health monitoring
- Metrics collection
- Tracing support
- Structured logging
DSEQ uses CometBFT's BFT consensus to ensure that all nodes maintain the same sequence of bytes, regardless of the order or source of incoming transactions. This is achieved through:
- Transaction Broadcasting: Nodes broadcast their transactions to the network
- Consensus: CometBFT's BFT consensus ensures all nodes agree on the transaction order
- Sequence Generation: Each node processes the same sequence of transactions in the same order
- Consistency: All nodes produce identical byte sequences despite receiving different inputs
- Go 1.21 or later
- Docker and Docker Compose
- CometBFT v0.38.0-rc3
- Make
- Clone the repository:
git clone https://github.com/yourusername/dseq.git
cd dseq- Install dependencies:
go mod downloadBuild for your current platform:
make buildBuild multi-architecture Docker images:
make build-dockerBuild local Docker image:
make build-docker-localStart a 4-node testnet locally:
make startStop the testnet:
make stop- Send transactions to different nodes:
# Send to node 1
curl -s 'localhost:26657/broadcast_tx_commit?tx="0xDEADBEEF"'
# Send to node 2
curl -s 'localhost:26660/broadcast_tx_commit?tx="0xCAFEBABE"'- Verify sequence consistency:
# Compare sequence files across nodes
make checksumRun load tests with different configurations:
# Quick test (10 requests, 3 concurrent)
make load-quick
# Medium test (100 requests, 9 concurrent)
make load-medium
# Heavy test (1000 requests, 30 concurrent)
make load-heavy
# Custom test
make load NODES=localhost:26657 REQUESTS=50 CONCURRENCY=5Monitor all nodes to verify sequence consistency:
make read-allCompare node sequence files to ensure they match:
make checksumRun tests with race detection and coverage:
make testGenerate test coverage report:
make test-coverageFormat code:
make fmtRun linters:
make lintRun go vet:
make vetClean build artifacts:
make clean.
├── app/ # Application code
│ ├── config/ # Configuration
│ ├── errors/ # Error handling
│ ├── health/ # Health checks
│ ├── logging/ # Structured logging
│ ├── metrics/ # Metrics collection
│ ├── middleware/ # HTTP middleware
│ ├── testutil/ # Test utilities
│ └── tracing/ # Distributed tracing
├── build/ # Build artifacts
├── cmd/ # Command-line tools
├── networks/ # Network configurations
│ └── local/ # Local testnet setup
└── Makefile # Build and development commands
Run make help to see all available targets:
make help- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.