github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/module/local.go (about)

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