topology-foundation / ts-topology

The official TypeScript implementation of Topology Protocol
https://topology-foundation.github.io/ts-topology/
MIT License
27 stars 19 forks source link

Enhancement : Make protocol string global #244

Open elielnfinic opened 2 weeks ago

elielnfinic commented 2 weeks ago

Currently, the protocol string "/topology/message/0.0.1" is hardcoded in multiple places within the codebase. To improve maintainability and avoid duplication, we should extract this protocol string into a global constant.

Proposed Solution

  1. Define a global constant for the protocol string in a common configuration file.
  2. Replace all occurrences of the hardcoded protocol string with the global constant.
d-roak commented 2 weeks ago

agree. The protocol string is only related with libp2p, so it should be global within the packages/network only