Description
We are using a static dev mode swam key in libdream. See:
https://github.com/taubyte/tau/blob/main/libdream/simple.go#L145
https://github.com/taubyte/tau/blob/main/libdream/universe.go#L222
While this was fine at the very start, it's causing issues when running multiple tests in parallel.
We need a function like:
func generateSwarmKey(id string) string {
hash := sha256.Sum256([]byte(id))
return "/key/swarm/psk/1.0.0//base16/" + hex.EncodeToString(hash[:])
}
Which will generate the same swarm key for the same universe id, and use that in lieu of protocols.SwarmKey()
Maybe have universe.SwarmKey() which calls generateSwarmKey and caches the result, or call generateSwarmKey when universe is created here https://github.com/taubyte/tau/blob/main/libdream/universe.go#L22. I prefer the second way better.
protocols.SwarmKey() function should then be deleted.
Activity