mirror of
https://github.com/logos-storage/logos-storage-go-bindings.git
synced 2026-01-02 13:33:10 +00:00
31 lines
539 B
Go
31 lines
539 B
Go
package codex
|
|
|
|
import "testing"
|
|
|
|
func newCodexNode(t *testing.T) *CodexNode {
|
|
node, err := CodexNew(CodexConfig{
|
|
DataDir: t.TempDir(),
|
|
LogFormat: LogFormatNoColors,
|
|
})
|
|
if err != nil {
|
|
t.Fatalf("Failed to create Codex node: %v", err)
|
|
}
|
|
|
|
err = node.Start()
|
|
if err != nil {
|
|
t.Fatalf("Failed to start Codex node: %v", err)
|
|
}
|
|
|
|
t.Cleanup(func() {
|
|
if err := node.Stop(); err != nil {
|
|
t.Logf("cleanup codex: %v", err)
|
|
}
|
|
|
|
if err := node.Destroy(); err != nil {
|
|
t.Logf("cleanup codex: %v", err)
|
|
}
|
|
})
|
|
|
|
return node
|
|
}
|