github.com/hyperion-hyn/go-ethereum@v2.4.0+incompatible/private/private.go (about) 1 package private 2 3 import ( 4 "os" 5 6 "github.com/ethereum/go-ethereum/private/constellation" 7 ) 8 9 type PrivateTransactionManager interface { 10 Send(data []byte, from string, to []string) ([]byte, error) 11 SendSignedTx(data []byte, to []string) ([]byte, error) 12 Receive(data []byte) ([]byte, error) 13 } 14 15 func FromEnvironmentOrNil(name string) PrivateTransactionManager { 16 cfgPath := os.Getenv(name) 17 if cfgPath == "" { 18 return nil 19 } 20 return constellation.MustNew(cfgPath) 21 } 22 23 var P = FromEnvironmentOrNil("PRIVATE_CONFIG")