mirror of https://github.com/poanetwork/quorum.git
23 lines
458 B
Go
23 lines
458 B
Go
package private
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/ethereum/go-ethereum/private/constellation"
|
|
)
|
|
|
|
type PrivateTransactionManager interface {
|
|
Send(data []byte, from string, to []string) ([]byte, error)
|
|
Receive(data []byte) ([]byte, error)
|
|
}
|
|
|
|
func FromEnvironmentOrNil(name string) PrivateTransactionManager {
|
|
cfgPath := os.Getenv(name)
|
|
if cfgPath == "" {
|
|
return nil
|
|
}
|
|
return constellation.MustNew(cfgPath)
|
|
}
|
|
|
|
var P = FromEnvironmentOrNil("PRIVATE_CONFIG")
|