mirror of
https://github.com/hanzoai/nchain.git
synced 2026-10-30 18:27:22 +00:00
Single API deployment serves all brands via hostname-based routing.
Per-brand env vars use BRAND_{UPPER}_* format with ENABLE_MULTI_TENANT.
One API Ingress handles all api.*/ws.* domains; per-brand web Ingresses.
ClusterTarget type maps brands to K8s clusters for NodeCluster CR creation.
Also adds Solana, Bitcoin, Cosmos protocol drivers with recommended
hardware specs (RecommendedResources/RecommendedStorage on Driver interface).
33 lines
575 B
Go
33 lines
575 B
Go
package protocol
|
|
|
|
import "sync"
|
|
|
|
var (
|
|
mu sync.RWMutex
|
|
drivers = map[string]Driver{}
|
|
)
|
|
|
|
// Register adds a protocol driver to the registry.
|
|
func Register(d Driver) {
|
|
mu.Lock()
|
|
defer mu.Unlock()
|
|
drivers[d.Name()] = d
|
|
}
|
|
|
|
// Get returns the protocol driver for the given name.
|
|
func Get(name string) (Driver, bool) {
|
|
mu.RLock()
|
|
defer mu.RUnlock()
|
|
d, ok := drivers[name]
|
|
return d, ok
|
|
}
|
|
|
|
func init() {
|
|
Register(&LuxDriver{})
|
|
Register(&EthereumDriver{})
|
|
Register(&SolanaDriver{})
|
|
Register(&BitcoinDriver{})
|
|
Register(&CosmosDriver{})
|
|
Register(&GenericDriver{})
|
|
}
|