mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 09:53:48 +00:00
node: add an interface to retrieve node key from config
This commit is contained in:
parent
e03ac4b7ae
commit
fddd6635b5
1 changed files with 6 additions and 0 deletions
|
|
@ -17,6 +17,7 @@
|
||||||
package node
|
package node
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"crypto/ecdsa"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/accounts"
|
"github.com/ethereum/go-ethereum/accounts"
|
||||||
|
|
@ -67,6 +68,11 @@ func (ctx *ServiceContext) Service(service interface{}) error {
|
||||||
return ErrServiceUnknown
|
return ErrServiceUnknown
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NodeKey returns node key from config
|
||||||
|
func (ctx *ServiceContext) NodeKey() *ecdsa.PrivateKey {
|
||||||
|
return ctx.config.NodeKey()
|
||||||
|
}
|
||||||
|
|
||||||
// ServiceConstructor is the function signature of the constructors needed to be
|
// ServiceConstructor is the function signature of the constructors needed to be
|
||||||
// registered for service instantiation.
|
// registered for service instantiation.
|
||||||
type ServiceConstructor func(ctx *ServiceContext) (Service, error)
|
type ServiceConstructor func(ctx *ServiceContext) (Service, error)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue