Documentation
¶
Index ¶
- Constants
- Variables
- func AddSubLogger(root *build.SubLoggerManager, subsystem string, interceptor signal.Interceptor, ...)
- func SetAgentName(newAgentName string)
- func SetSubLogger(root *build.SubLoggerManager, subsystem string, logger btclog.Logger, ...)
- func SetupLoggers(root *build.SubLoggerManager, interceptor signal.Interceptor)
- func Tags() []string
- func UserAgent(initiator string) string
- func Version() string
- type Server
- func (s *Server) ApplyHtlcView(in lnwl.CommitDiffAuxInput) lfn.Result[lfn.Option[tlv.Blob]]
- func (s *Server) AuxCloseOutputs(desc types.AuxCloseDesc) (lfn.Option[chancloser.AuxCloseOutputs], error)
- func (s *Server) CanHandle(msg msgmux.PeerMsg) bool
- func (s *Server) ChannelFinalized(pid funding.PendingChanID) error
- func (s *Server) ChannelReady(openChan lnwl.AuxChanState) error
- func (s *Server) DeriveSweepAddr(inputs []input.Input, change lnwl.AddrWithKey) lfn.Result[sweep.SweepOutput]
- func (s *Server) DeriveTapscriptRoot(pid funding.PendingChanID) funding.AuxTapscriptResult
- func (s *Server) DescFromPendingChanID(pid funding.PendingChanID, chanState lnwl.AuxChanState, ...) funding.AuxFundingDescResult
- func (s *Server) ExtraBudgetForInputs(inputs []input.Input) lfn.Result[btcutil.Amount]
- func (s *Server) FetchLeavesFromCommit(chanState lnwl.AuxChanState, com channeldb.ChannelCommitment, ...) lfn.Result[lnwl.CommitDiffAuxResult]
- func (s *Server) FetchLeavesFromRevocation(r *channeldb.RevocationLog) lfn.Result[lnwl.CommitDiffAuxResult]
- func (s *Server) FetchLeavesFromView(in lnwl.CommitDiffAuxInput) lfn.Result[lnwl.CommitDiffAuxResult]
- func (s *Server) FinalizeClose(desc types.AuxCloseDesc, closeTx *wire.MsgTx) error
- func (s *Server) GetInitRecords(peer route.Vertex) (lnwire.CustomRecords, error)
- func (s *Server) InlineParseCustomData(msg proto.Message) error
- func (s *Server) IsCustomHTLC(htlcRecords lnwire.CustomRecords) bool
- func (s *Server) Name() msgmux.EndpointName
- func (s *Server) NotifyBroadcast(req *sweep.BumpRequest, tx *wire.MsgTx, fee btcutil.Amount, ...) error
- func (s *Server) PackSigs(blob []lfn.Option[tlv.Blob]) lfn.Result[lfn.Option[tlv.Blob]]
- func (s *Server) PaymentBandwidth(fundingBlob, htlcBlob, commitmentBlob lfn.Option[tlv.Blob], ...) (lnwire.MilliSatoshi, error)
- func (s *Server) ProcessChannelReady(cid lnwire.ChannelID, peer route.Vertex)
- func (s *Server) ProcessInitRecords(peer route.Vertex, customRecords lnwire.CustomRecords) error
- func (s *Server) ProcessReestablish(cid lnwire.ChannelID, peer route.Vertex)
- func (s *Server) ProduceHtlcExtraData(totalAmount lnwire.MilliSatoshi, htlcCustomRecords lnwire.CustomRecords, ...) (lnwire.MilliSatoshi, lnwire.CustomRecords, error)
- func (s *Server) RegisterGrpcService(registrar grpc.ServiceRegistrar)
- func (s *Server) RegisterRestService(ctx context.Context, mux *proxy.ServeMux, endpoint string, ...) error
- func (s *Server) ResolveContract(req lnwl.ResolutionReq) lfn.Result[tlv.Blob]
- func (s *Server) RunUntilShutdown(mainErrChan <-chan error) error
- func (s *Server) SendMessage(ctx context.Context, msg msgmux.PeerMsg) bool
- func (s *Server) ShouldHandleTraffic(cid lnwire.ShortChannelID, fundingBlob, htlcBlob lfn.Option[tlv.Blob]) (bool, error)
- func (s *Server) ShutdownBlob(req types.AuxShutdownReq) (lfn.Option[lnwire.CustomRecords], error)
- func (s *Server) StartAsSubserver(lndGrpc *lndclient.GrpcLndServices) error
- func (s *Server) Stop() error
- func (s *Server) SubmitSecondLevelSigBatch(chanState lnwl.AuxChanState, commitTx *wire.MsgTx, sigJob []lnwl.AuxSigJob) error
- func (s *Server) UnpackSigs(blob lfn.Option[tlv.Blob]) lfn.Result[[]lfn.Option[tlv.Blob]]
- func (s *Server) UpdateConfig(cfg *tapconfig.Config)
- func (s *Server) ValidateMacaroon(ctx context.Context, requiredPermissions []bakery.Op, fullMethod string) error
- func (s *Server) VerifySecondLevelSigs(chanState lnwl.AuxChanState, commitTx *wire.MsgTx, ...) error
- type ValidatorV0
- type WitnessValidatorV0
Constants ¶
const ( // AppMajor defines the major version of this binary. AppMajor uint = 0 // AppMinor defines the minor version of this binary. AppMinor uint = 8 // AppPatch defines the application patch for this binary. AppPatch uint = 0 // AppStatus defines the release status of this binary (e.g. beta). AppStatus = "alpha" // AppPreRelease defines the pre-release version of this binary. // It MUST only contain characters from the semantic versioning spec. AppPreRelease = "rc2" // GitTagIncludeStatus indicates whether the status should be included // in the git tag name. // // Including the app version status in the git tag may be problematic // for golang projects when importing them as dependencies. We therefore // include this flag to allow toggling the status on and off in a // standardised way across our projects. GitTagIncludeStatus = false )
These constants define the application version and follow the semantic versioning 2.0.0 spec (http://semver.org/).
Variables ¶
var ( // Commit stores the current commit of this build, which includes the // most recent tag, the number of commits since that tag (if non-zero), // the commit hash, and a dirty marker. This should be set using the // -ldflags during compilation. Commit string // CommitHash stores the current commit hash of this build. CommitHash string // RawTags contains the raw set of build tags, separated by commas. RawTags string // GoVersion stores the go version that the executable was compiled // with. GoVersion string )
Functions ¶
func AddSubLogger ¶
func AddSubLogger(root *build.SubLoggerManager, subsystem string, interceptor signal.Interceptor, useLoggers ...func(btclog.Logger))
AddSubLogger is a helper method to conveniently create and register the logger of one or more sub systems.
func SetAgentName ¶
func SetAgentName(newAgentName string)
SetAgentName overwrites the default agent name which can be used to identify the software tapd is bundled in (for example LiT). This function panics if the agent name contains characters outside of the allowed semantic alphabet.
func SetSubLogger ¶
func SetSubLogger(root *build.SubLoggerManager, subsystem string, logger btclog.Logger, useLoggers ...func(btclog.Logger))
SetSubLogger is a helper method to conveniently register the logger of a sub system.
func SetupLoggers ¶
func SetupLoggers(root *build.SubLoggerManager, interceptor signal.Interceptor)
SetupLoggers initializes all package-global logger variables.
func Tags ¶
func Tags() []string
Tags returns the list of build tags that were compiled into the executable.
func UserAgent ¶
UserAgent returns the full user agent string that identifies the software that is submitting swaps to the loop server.
func Version ¶
func Version() string
Version returns the application version as a properly formed string per the semantic versioning 2.0.0 spec (http://semver.org/).
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the main daemon construct for the Taproot Asset server. It handles spinning up the RPC sever, the database, and any other components that the Taproot Asset server needs to function.
func NewServer ¶
func NewServer(chainParams *address.ChainParams) *Server
NewServer creates a new server.
func (*Server) ApplyHtlcView ¶ added in v0.4.0
ApplyHtlcView serves as the state transition function for the custom channel's blob. Given the old blob, and an HTLC view, then a new blob should be returned that reflects the pending updates.
NOTE: This method is part of the lnwallet.AuxLeafStore interface.
func (*Server) AuxCloseOutputs ¶ added in v0.4.0
func (s *Server) AuxCloseOutputs( desc types.AuxCloseDesc) (lfn.Option[chancloser.AuxCloseOutputs], error)
AuxCloseOutputs returns the set of close outputs to use for this co-op close attempt. We'll add some extra outputs to the co-op close transaction, and also give the caller a custom sorting routine.
NOTE: This method is part of the types.AuxChanCloser interface.
func (*Server) CanHandle ¶ added in v0.4.0
CanHandle returns true if the target message can be routed to this endpoint.
NOTE: This method is part of the msgmux.MsgEndpoint interface.
func (*Server) ChannelFinalized ¶ added in v0.4.0
func (s *Server) ChannelFinalized(pid funding.PendingChanID) error
ChannelFinalized is called once we receive the commit sig from a remote party and find it to be valid.
NOTE: This method is part of the funding.AuxFundingController interface.
func (*Server) ChannelReady ¶ added in v0.4.0
func (s *Server) ChannelReady(openChan lnwl.AuxChanState) error
ChannelReady is called when a channel has been fully opened and is ready to be used. This can be used to perform any final setup or cleanup.
NOTE: This method is part of the funding.AuxFundingController interface.
func (*Server) DeriveSweepAddr ¶ added in v0.4.0
func (s *Server) DeriveSweepAddr(inputs []input.Input, change lnwl.AddrWithKey) lfn.Result[sweep.SweepOutput]
DeriveSweepAddr takes a set of inputs, and the change address we'd use to sweep them, and maybe results in an extra sweep output that we should add to the sweeping transaction.
NOTE: This method is part of the sweep.AuxSweeper interface.
func (*Server) DeriveTapscriptRoot ¶ added in v0.4.0
func (s *Server) DeriveTapscriptRoot( pid funding.PendingChanID) funding.AuxTapscriptResult
DeriveTapscriptRoot takes a pending channel ID and maybe returns a tapscript root that should be used when creating any MuSig2 sessions for a channel.
NOTE: This method is part of the funding.AuxFundingController interface.
func (*Server) DescFromPendingChanID ¶ added in v0.4.0
func (s *Server) DescFromPendingChanID(pid funding.PendingChanID, chanState lnwl.AuxChanState, keyRing lntypes.Dual[lnwl.CommitmentKeyRing], initiator bool) funding.AuxFundingDescResult
DescFromPendingChanID takes a pending channel ID, that may already be known due to prior custom channel messages, and maybe returns an aux funding desc which can be used to modify how a channel is funded.
NOTE: This method is part of the funding.AuxFundingController interface.
func (*Server) ExtraBudgetForInputs ¶ added in v0.5.0
ExtraBudgetForInputs takes a set of inputs and maybe returns an extra budget that should be added to the sweep transaction.
NOTE: This method is part of the sweep.AuxSweeper interface.
func (*Server) FetchLeavesFromCommit ¶ added in v0.4.0
func (s *Server) FetchLeavesFromCommit(chanState lnwl.AuxChanState, com channeldb.ChannelCommitment, keys lnwl.CommitmentKeyRing, whoseCommit lntypes.ChannelParty) lfn.Result[lnwl.CommitDiffAuxResult]
FetchLeavesFromCommit attempts to fetch the auxiliary leaves that correspond to the passed aux blob, and an existing channel commitment.
NOTE: This method is part of the lnwallet.AuxLeafStore interface. nolint:lll
func (*Server) FetchLeavesFromRevocation ¶ added in v0.4.0
func (s *Server) FetchLeavesFromRevocation( r *channeldb.RevocationLog) lfn.Result[lnwl.CommitDiffAuxResult]
FetchLeavesFromRevocation attempts to fetch the auxiliary leaves from a channel revocation that stores balance + blob information.
NOTE: This method is part of the lnwallet.AuxLeafStore interface.
func (*Server) FetchLeavesFromView ¶ added in v0.4.0
func (s *Server) FetchLeavesFromView( in lnwl.CommitDiffAuxInput) lfn.Result[lnwl.CommitDiffAuxResult]
FetchLeavesFromView attempts to fetch the auxiliary leaves that correspond to the passed aux blob, and pending fully evaluated HTLC view.
NOTE: This method is part of the lnwallet.AuxLeafStore interface.
func (*Server) FinalizeClose ¶ added in v0.4.0
FinalizeClose is called once the co-op close transaction has been agreed upon. We'll finalize the exclusion proofs, then send things off to the custodian or porter to finish sending/receiving the proofs.
NOTE: This method is part of the types.AuxChanCloser interface.
func (*Server) GetInitRecords ¶ added in v0.7.0
GetInitRecords is called when sending an init message to a peer. It returns custom records to include in the init message TLVs. The implementation can decide which records to include based on the peer identity.
func (*Server) InlineParseCustomData ¶ added in v0.4.0
InlineParseCustomData replaces any custom data binary blob in the given RPC message with its corresponding JSON formatted data. This transforms the binary (likely TLV encoded) data to a human-readable JSON representation (still as byte slice).
NOTE: This method is part of the lnd.AuxDataParser interface.
func (*Server) IsCustomHTLC ¶ added in v0.5.1
func (s *Server) IsCustomHTLC(htlcRecords lnwire.CustomRecords) bool
IsCustomHTLC returns true if the HTLC carries the set of relevant custom records to put it under the purview of the traffic shaper, meaning that it's from a custom channel.
NOTE: This method is part of the routing.TlvTrafficShaper interface.
func (*Server) Name ¶ added in v0.4.0
func (s *Server) Name() msgmux.EndpointName
Name returns the name of this endpoint. This MUST be unique across all registered endpoints.
NOTE: This method is part of the msgmux.MsgEndpoint interface.
func (*Server) NotifyBroadcast ¶ added in v0.4.0
func (s *Server) NotifyBroadcast(req *sweep.BumpRequest, tx *wire.MsgTx, fee btcutil.Amount, outpointToTxIndex map[wire.OutPoint]int) error
NotifyBroadcast is used to notify external callers of the broadcast of a sweep transaction, generated by the passed BumpRequest.
NOTE: This method is part of the sweep.AuxSweeper interface.
func (*Server) PackSigs ¶ added in v0.4.0
PackSigs takes a series of aux signatures and packs them into a single blob that can be sent alongside the CommitSig messages.
NOTE: This method is part of the lnwallet.AuxSigner interface.
func (*Server) PaymentBandwidth ¶ added in v0.4.0
func (s *Server) PaymentBandwidth(fundingBlob, htlcBlob, commitmentBlob lfn.Option[tlv.Blob], linkBandwidth, htlcAmt lnwire.MilliSatoshi, htlcView lnwallet.AuxHtlcView, peer route.Vertex) (lnwire.MilliSatoshi, error)
PaymentBandwidth returns the available bandwidth for a custom channel decided by the given channel aux blob and HTLC blob. A return value of 0 means there is no bandwidth available. To find out if a channel is a custom channel that should be handled by the traffic shaper, the HandleTraffic method should be called first.
NOTE: This method is part of the routing.TlvTrafficShaper interface.
func (*Server) ProcessChannelReady ¶ added in v0.7.0
ProcessChannelReady handles the event of marking a channel identified by its channel ID as ready to use. We also provide the peer the channel was established with.
func (*Server) ProcessInitRecords ¶ added in v0.7.0
ProcessInitRecords handles received init records from a peer. The implementation can store state internally to affect future channel operations with this peer.
func (*Server) ProcessReestablish ¶ added in v0.7.0
ProcessReestablishFeatures handles received channel_reestablish feature TLVs. This is a blocking call - the channel link will wait for this method to complete before continuing channel operations. The implementation can modify aux channel behavior based on the negotiated features.
func (*Server) ProduceHtlcExtraData ¶ added in v0.4.0
func (s *Server) ProduceHtlcExtraData(totalAmount lnwire.MilliSatoshi, htlcCustomRecords lnwire.CustomRecords, peer route.Vertex) (lnwire.MilliSatoshi, lnwire.CustomRecords, error)
ProduceHtlcExtraData is a function that, based on the previous custom record blob of an HTLC, may produce a different blob or modify the amount of bitcoin this HTLC should carry.
NOTE: This method is part of the routing.TlvTrafficShaper interface.
func (*Server) RegisterGrpcService ¶ added in v0.7.0
func (s *Server) RegisterGrpcService(registrar grpc.ServiceRegistrar)
RegisterGrpcService must register the sub-server's GRPC server with the given registrar.
NOTE: this is part of the SubServer interface.
func (*Server) RegisterRestService ¶ added in v0.7.0
func (s *Server) RegisterRestService(ctx context.Context, mux *proxy.ServeMux, endpoint string, dialOpts []grpc.DialOption) error
RegisterRestService registers the sub-server's REST handlers with the given endpoint.
NOTE: this is part of the SubServer interface.
func (*Server) ResolveContract ¶ added in v0.4.0
ResolveContract attempts to obtain a resolution blob for the specified contract.
NOTE: This method is part of the lnwallet.AuxContractResolver interface.
func (*Server) RunUntilShutdown ¶
RunUntilShutdown runs the main Taproot Asset server loop until a signal is received to shut down the process.
func (*Server) SendMessage ¶ added in v0.4.0
SendMessage handles the target message, and returns true if the message was able to be processed.
NOTE: This method is part of the msgmux.MsgEndpoint interface.
func (*Server) ShouldHandleTraffic ¶ added in v0.5.0
func (s *Server) ShouldHandleTraffic(cid lnwire.ShortChannelID, fundingBlob, htlcBlob lfn.Option[tlv.Blob]) (bool, error)
ShouldHandleTraffic is called in order to check if the channel identified by the provided channel ID is handled by the traffic shaper implementation. If it is handled by the traffic shaper, then the normal bandwidth calculation can be skipped and the bandwidth returned by PaymentBandwidth should be used instead.
NOTE: This method is part of the routing.TlvTrafficShaper interface.
func (*Server) ShutdownBlob ¶ added in v0.4.0
func (s *Server) ShutdownBlob( req types.AuxShutdownReq) (lfn.Option[lnwire.CustomRecords], error)
ShutdownBlob returns the set of custom records that should be included in the shutdown message.
NOTE: This method is part of the types.AuxChanCloser interface.
func (*Server) StartAsSubserver ¶
func (s *Server) StartAsSubserver(lndGrpc *lndclient.GrpcLndServices) error
StartAsSubserver is an alternative to Start where the RPC server does not create its own gRPC server but registers to an existing one. The same goes for REST (if enabled), instead of creating an own mux and HTTP server, we register to an existing one.
func (*Server) SubmitSecondLevelSigBatch ¶ added in v0.4.0
func (s *Server) SubmitSecondLevelSigBatch(chanState lnwl.AuxChanState, commitTx *wire.MsgTx, sigJob []lnwl.AuxSigJob) error
SubmitSecondLevelSigBatch takes a batch of aux sign jobs and processes them asynchronously.
NOTE: This method is part of the lnwallet.AuxSigner interface.
func (*Server) UnpackSigs ¶ added in v0.4.0
UnpackSigs takes a packed blob of signatures and returns the original signatures for each HTLC, keyed by HTLC index.
NOTE: This method is part of the lnwallet.AuxSigner interface.
func (*Server) UpdateConfig ¶ added in v0.4.0
UpdateConfig updates the server's configuration. This MUST be called before the server is started.
func (*Server) ValidateMacaroon ¶
func (s *Server) ValidateMacaroon(ctx context.Context, requiredPermissions []bakery.Op, fullMethod string) error
ValidateMacaroon extracts the macaroon from the context's gRPC metadata, checks its signature, makes sure all specified permissions for the called method are contained within and finally ensures all caveat conditions are met. A non-nil error is returned if any of the checks fail. This method is needed to enable tapd running as an external subserver in the same process as lnd but still validate its own macaroons.
func (*Server) VerifySecondLevelSigs ¶ added in v0.4.0
func (s *Server) VerifySecondLevelSigs(chanState lnwl.AuxChanState, commitTx *wire.MsgTx, verifyJob []lnwl.AuxVerifyJob) error
VerifySecondLevelSigs attempts to synchronously verify a batch of aux sig jobs.
NOTE: This method is part of the lnwallet.AuxSigner interface.
type ValidatorV0 ¶
type ValidatorV0 struct{}
ValidatorV0 is an implementation of the tapscript.TxValidator interface that supports Taproot Asset script version 0.
func (*ValidatorV0) Execute ¶
func (v *ValidatorV0) Execute(newAsset *asset.Asset, splitAssets []*commitment.SplitAsset, prevAssets commitment.InputSet, chainLookup asset.ChainLookup) error
Execute creates and runs an instance of the Taproot Asset script V0 VM.
type WitnessValidatorV0 ¶ added in v0.4.0
type WitnessValidatorV0 struct{}
WitnessValidatorV0 is an implementation of the tapscript.WitnessValidator interface that supports Taproot Asset script version 0.
func (*WitnessValidatorV0) ValidateWitnesses ¶ added in v0.4.0
func (v *WitnessValidatorV0) ValidateWitnesses(newAsset *asset.Asset, splitAssets []*commitment.SplitAsset, prevAssets commitment.InputSet) error
ValidateWitnesses validates the created witnesses of an asset transfer.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package backup implements wallet asset backup and restore functionality.
|
Package backup implements wallet asset backup and restore functionality. |
|
cmd
|
|
|
merge-sql-schemas
command
|
|
|
tapcli
command
|
|
|
tapd
command
|
|
|
tapd-integrated
command
Package main implements a minimal integrated daemon that runs lnd and tapd in the same process.
|
Package main implements a minimal integrated daemon that runs lnd and tapd in the same process. |
|
docs
|
|
|
examples/basic-portfolio-pilot
command
WARNING: This is a demonstration example only and is NOT suitable for production use.
|
WARNING: This is a demonstration example only and is NOT suitable for production use. |
|
Package healthcheck contains a monitor which takes a set of liveness checks which it periodically checks.
|
Package healthcheck contains a monitor which takes a set of liveness checks which it periodically checks. |
|
Package integration provides the glue layer for running lnd with tapd's custom channel support.
|
Package integration provides the glue layer for running lnd with tapd's custom channel support. |
|
internal
|
|
|
nolint:lll
|
nolint:lll |
|
taprpc
module
|
|