github.com/koko1123/flow-go-1@v0.29.6/module/local.go (about)

     1  // (c) 2019 Dapper Labs - ALL RIGHTS RESERVED
     2  
     3  package module
     4  
     5  import (
     6  	"github.com/koko1123/flow-go-1/model/flow"
     7  	"github.com/onflow/flow-go/crypto"
     8  	"github.com/onflow/flow-go/crypto/hash"
     9  )
    10  
    11  // Local encapsulates the stable local node information.
    12  type Local interface {
    13  
    14  	// NodeID returns the node ID of the local node.
    15  	NodeID() flow.Identifier
    16  
    17  	// Address returns the (listen) address of the local node.
    18  	Address() string
    19  
    20  	// Sign provides a signature oracle that given a message and hasher, it
    21  	// generates and returns a signature over the message using the node's private key
    22  	// as well as the input hasher
    23  	Sign([]byte, hash.Hasher) (crypto.Signature, error)
    24  
    25  	// NotMeFilter returns handy not-me filter for searching identity
    26  	NotMeFilter() flow.IdentityFilter
    27  
    28  	// SignFunc provides a signature oracle that given a message, a hasher, and a signing function, it
    29  	// generates and returns a signature over the message using the node's private key
    30  	// as well as the input hasher by invoking the given signing function. The overall idea of this function
    31  	// is to not expose the private key to the caller.
    32  	SignFunc([]byte, hash.Hasher, func(crypto.PrivateKey, []byte, hash.Hasher) (crypto.Signature,
    33  		error)) (crypto.Signature, error)
    34  }