Documentation ¶
Index ¶
- Constants
- Variables
- func AddSubLogger(root *build.RotatingLogWriter, subsystem string, ...)
- func CheckFederationServer(localRuntimeID int64, connectTimeout time.Duration, server universe.ServerAddr) error
- func ConnectUniverse(serverAddr universe.ServerAddr) (unirpc.UniverseClient, error)
- func MarshalAsset(ctx context.Context, a *asset.Asset, isSpent, withWitness bool, ...) (*taprpc.Asset, error)
- func NewRpcUniverseDiff(serverAddr universe.ServerAddr) (universe.DiffEngine, error)
- func NewRpcUniverseRegistrar(serverAddr universe.ServerAddr) (universe.Registrar, error)
- func SetAgentName(newAgentName string)
- func SetSubLogger(root *build.RotatingLogWriter, subsystem string, logger btclog.Logger, ...)
- func SetupLoggers(root *build.RotatingLogWriter, interceptor signal.Interceptor)
- func Tags() []string
- func UnmarshalKeyDescriptor(rpcDesc *taprpc.KeyDescriptor) (keychain.KeyDescriptor, error)
- func UnmarshalOutpoint(outpoint string) (*wire.OutPoint, error)
- func UnmarshalScriptKey(rpcKey *taprpc.ScriptKey) (*asset.ScriptKey, error)
- func UserAgent(initiator string) string
- func Version() string
- type Config
- type DatabaseConfig
- type KeyLookup
- type LndRpcChainBridge
- func (l *LndRpcChainBridge) CurrentHeight(ctx context.Context) (uint32, error)
- func (l *LndRpcChainBridge) EstimateFee(ctx context.Context, confTarget uint32) (chainfee.SatPerKWeight, error)
- func (l *LndRpcChainBridge) GetBlock(ctx context.Context, hash chainhash.Hash) (*wire.MsgBlock, error)
- func (l *LndRpcChainBridge) PublishTransaction(ctx context.Context, tx *wire.MsgTx) error
- func (l *LndRpcChainBridge) RegisterConfirmationsNtfn(ctx context.Context, txid *chainhash.Hash, pkScript []byte, ...) (*chainntnfs.ConfirmationEvent, chan error, error)
- type LndRpcGenSigner
- type LndRpcKeyRing
- func (l *LndRpcKeyRing) DeriveKey(ctx context.Context, keyLoc keychain.KeyLocator) (keychain.KeyDescriptor, error)
- func (l *LndRpcKeyRing) DeriveNextKey(ctx context.Context, keyFam keychain.KeyFamily) (keychain.KeyDescriptor, error)
- func (l *LndRpcKeyRing) DeriveNextTaprootAssetKey(ctx context.Context) (keychain.KeyDescriptor, error)
- func (l *LndRpcKeyRing) IsLocalKey(ctx context.Context, desc keychain.KeyDescriptor) bool
- type LndRpcVirtualTxSigner
- type LndRpcWalletAnchor
- func (l *LndRpcWalletAnchor) FundPsbt(ctx context.Context, packet *psbt.Packet, minConfs uint32, ...) (tapgarden.FundedPsbt, error)
- func (l *LndRpcWalletAnchor) ImportTaprootOutput(ctx context.Context, pub *btcec.PublicKey) (btcutil.Address, error)
- func (l *LndRpcWalletAnchor) ListTransactions(ctx context.Context, startHeight, endHeight int32, account string) ([]lndclient.Transaction, error)
- func (l *LndRpcWalletAnchor) ListUnspentImportScripts(ctx context.Context) ([]*lnwallet.Utxo, error)
- func (l *LndRpcWalletAnchor) SignAndFinalizePsbt(ctx context.Context, pkt *psbt.Packet) (*psbt.Packet, error)
- func (l *LndRpcWalletAnchor) SignPsbt(ctx context.Context, packet *psbt.Packet) (*psbt.Packet, error)
- func (l *LndRpcWalletAnchor) SubscribeTransactions(ctx context.Context) (<-chan lndclient.Transaction, <-chan error, error)
- func (l *LndRpcWalletAnchor) UnlockInput(ctx context.Context) error
- type RPCConfig
- type RpcUniverseDiff
- func (r *RpcUniverseDiff) FetchIssuanceProof(ctx context.Context, id universe.Identifier, key universe.BaseKey) ([]*universe.IssuanceProof, error)
- func (r *RpcUniverseDiff) MintingKeys(ctx context.Context, id universe.Identifier) ([]universe.BaseKey, error)
- func (r *RpcUniverseDiff) RootNode(ctx context.Context, id universe.Identifier) (universe.BaseRoot, error)
- func (r *RpcUniverseDiff) RootNodes(ctx context.Context) ([]universe.BaseRoot, error)
- type RpcUniverseRegistrar
- type Server
- func (r Server) AddFederationServer(ctx context.Context, in *unirpc.AddFederationServerRequest) (*unirpc.AddFederationServerResponse, error)
- func (r Server) AddrReceives(ctx context.Context, in *taprpc.AddrReceivesRequest) (*taprpc.AddrReceivesResponse, error)
- func (r Server) AnchorVirtualPsbts(ctx context.Context, in *wrpc.AnchorVirtualPsbtsRequest) (*taprpc.SendAssetResponse, error)
- func (r Server) AssetLeafKeys(ctx context.Context, req *unirpc.ID) (*unirpc.AssetLeafKeyResponse, error)
- func (r Server) AssetLeaves(ctx context.Context, req *unirpc.ID) (*unirpc.AssetLeafResponse, error)
- func (r Server) AssetRoots(ctx context.Context, req *unirpc.AssetRootRequest) (*unirpc.AssetRootResponse, error)
- func (r Server) CancelBatch(_ context.Context, _ *mintrpc.CancelBatchRequest) (*mintrpc.CancelBatchResponse, error)
- func (r Server) DebugLevel(ctx context.Context, req *taprpc.DebugLevelRequest) (*taprpc.DebugLevelResponse, error)
- func (r Server) DecodeAddr(_ context.Context, in *taprpc.DecodeAddrRequest) (*taprpc.Addr, error)
- func (r Server) DecodeProof(ctx context.Context, in *taprpc.DecodeProofRequest) (*taprpc.DecodeProofResponse, error)
- func (r Server) DeleteAssetRoot(ctx context.Context, req *unirpc.DeleteRootQuery) (*unirpc.DeleteRootResponse, error)
- func (r Server) DeleteFederationServer(ctx context.Context, in *unirpc.DeleteFederationServerRequest) (*unirpc.DeleteFederationServerResponse, error)
- func (r Server) ExportProof(ctx context.Context, in *taprpc.ExportProofRequest) (*taprpc.ProofFile, error)
- func (r Server) FetchAssetMeta(ctx context.Context, in *taprpc.FetchAssetMetaRequest) (*taprpc.AssetMeta, error)
- func (r Server) FinalizeBatch(_ context.Context, _ *mintrpc.FinalizeBatchRequest) (*mintrpc.FinalizeBatchResponse, error)
- func (r Server) FundVirtualPsbt(ctx context.Context, in *wrpc.FundVirtualPsbtRequest) (*wrpc.FundVirtualPsbtResponse, error)
- func (r Server) GetInfo(context.Context, *taprpc.GetInfoRequest) (*taprpc.GetInfoResponse, error)
- func (r Server) ImportProof(ctx context.Context, in *taprpc.ImportProofRequest) (*taprpc.ImportProofResponse, error)
- func (r Server) Info(ctx context.Context, req *unirpc.InfoRequest) (*unirpc.InfoResponse, error)
- func (r Server) InsertProof(ctx context.Context, req *unirpc.AssetProof) (*unirpc.AssetProofResponse, error)
- func (r Server) ListAssets(ctx context.Context, req *taprpc.ListAssetRequest) (*taprpc.ListAssetResponse, error)
- func (r Server) ListBalances(ctx context.Context, in *taprpc.ListBalancesRequest) (*taprpc.ListBalancesResponse, error)
- func (r Server) ListBatches(_ context.Context, req *mintrpc.ListBatchRequest) (*mintrpc.ListBatchResponse, error)
- func (r Server) ListFederationServers(ctx context.Context, in *unirpc.ListFederationServersRequest) (*unirpc.ListFederationServersResponse, error)
- func (r Server) ListGroups(ctx context.Context, _ *taprpc.ListGroupsRequest) (*taprpc.ListGroupsResponse, error)
- func (r Server) ListTransfers(ctx context.Context, in *taprpc.ListTransfersRequest) (*taprpc.ListTransfersResponse, error)
- func (r Server) ListUtxos(ctx context.Context, _ *taprpc.ListUtxosRequest) (*taprpc.ListUtxosResponse, error)
- func (r Server) MintAsset(ctx context.Context, req *mintrpc.MintAssetRequest) (*mintrpc.MintAssetResponse, error)
- func (r Server) NewAddr(ctx context.Context, in *taprpc.NewAddrRequest) (*taprpc.Addr, error)
- func (r Server) NextInternalKey(ctx context.Context, req *wrpc.NextInternalKeyRequest) (*wrpc.NextInternalKeyResponse, error)
- func (r Server) NextScriptKey(ctx context.Context, req *wrpc.NextScriptKeyRequest) (*wrpc.NextScriptKeyResponse, error)
- func (r Server) ProveAssetOwnership(ctx context.Context, in *wrpc.ProveAssetOwnershipRequest) (*wrpc.ProveAssetOwnershipResponse, error)
- func (r Server) QueryAddrs(ctx context.Context, in *taprpc.QueryAddrRequest) (*taprpc.QueryAddrResponse, error)
- func (r Server) QueryAssetRoots(ctx context.Context, req *unirpc.AssetRootQuery) (*unirpc.QueryRootResponse, error)
- func (r Server) QueryAssetStats(ctx context.Context, req *unirpc.AssetStatsQuery) (*unirpc.UniverseAssetStats, error)
- func (r Server) QueryProof(ctx context.Context, req *unirpc.UniverseKey) (*unirpc.AssetProofResponse, error)
- func (r Server) RegisterWithGrpcServer(grpcServer *grpc.Server) error
- func (r Server) RegisterWithRestProxy(restCtx context.Context, restMux *proxy.ServeMux, ...) error
- func (s *Server) RunUntilShutdown(mainErrChan <-chan error) error
- func (r Server) SendAsset(_ context.Context, in *taprpc.SendAssetRequest) (*taprpc.SendAssetResponse, error)
- func (r Server) SignVirtualPsbt(_ context.Context, in *wrpc.SignVirtualPsbtRequest) (*wrpc.SignVirtualPsbtResponse, error)
- func (r Server) Start() error
- func (s *Server) StartAsSubserver(lndGrpc *lndclient.GrpcLndServices) error
- func (s *Server) Stop() error
- func (r Server) StopDaemon(_ context.Context, _ *taprpc.StopRequest) (*taprpc.StopResponse, error)
- func (r Server) SubscribeSendAssetEventNtfns(in *taprpc.SubscribeSendAssetEventNtfnsRequest, ...) error
- func (r Server) SyncUniverse(ctx context.Context, req *unirpc.SyncRequest) (*unirpc.SyncResponse, error)
- func (r Server) UniverseStats(ctx context.Context, req *unirpc.StatsRequest) (*unirpc.StatsResponse, error)
- func (s *Server) ValidateMacaroon(ctx context.Context, requiredPermissions []bakery.Op, fullMethod string) error
- func (r Server) VerifyAssetOwnership(ctx context.Context, in *wrpc.VerifyAssetOwnershipRequest) (*wrpc.VerifyAssetOwnershipResponse, error)
- func (r Server) VerifyProof(ctx context.Context, in *taprpc.ProofFile) (*taprpc.VerifyProofResponse, error)
- type ValidatorV0
Constants ¶
const ( // AppMajor defines the major version of this binary. AppMajor uint = 0 // AppMinor defines the minor version of this binary. AppMinor uint = 2 // AppPatch defines the application patch for this binary. AppPatch uint = 2 // AppPreRelease MUST only contain characters from semanticAlphabet // per the semantic versioning spec. AppPreRelease = "alpha" )
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.RotatingLogWriter, 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 CheckFederationServer ¶ added in v0.2.1
func CheckFederationServer(localRuntimeID int64, connectTimeout time.Duration, server universe.ServerAddr) error
CheckFederationServer attempts to connect to the target server and ensure that it is a valid federation server that isn't the local daemon.
func ConnectUniverse ¶ added in v0.2.1
func ConnectUniverse( serverAddr universe.ServerAddr) (unirpc.UniverseClient, error)
ConnectUniverse connects to a remote Universe server using the provided server address.
func MarshalAsset ¶
func NewRpcUniverseDiff ¶
func NewRpcUniverseDiff( serverAddr universe.ServerAddr) (universe.DiffEngine, error)
NewRpcUniverseDiff creates a new RpcUniverseDiff instance that dials out to the target remote universe server address.
func NewRpcUniverseRegistrar ¶ added in v0.2.1
func NewRpcUniverseRegistrar( serverAddr universe.ServerAddr) (universe.Registrar, error)
NewRpcUniverseRegistrar creates a new RpcUniverseRegistrar instance that dials out to the target remote universe server address.
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.RotatingLogWriter, 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.RotatingLogWriter, 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 UnmarshalKeyDescriptor ¶
func UnmarshalKeyDescriptor( rpcDesc *taprpc.KeyDescriptor) (keychain.KeyDescriptor, error)
UnmarshalKeyDescriptor parses the RPC key descriptor into the native counterpart.
func UnmarshalOutpoint ¶ added in v0.2.1
unmarshalOutpoint unmarshals an outpoint from a string received via RPC.
func UnmarshalScriptKey ¶
UnmarshalScriptKey parses the RPC script key into the native counterpart.
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 Config ¶
type Config struct { DebugLevel string // RuntimeID is a pseudo-random ID that is generated when the server // starts. It is used to identify the server to itself, to avoid // connecting to itself as a federation member. RuntimeID int64 AcceptRemoteUniverseProofs bool // TODO(roasbeef): use the Taproot Asset chain param wrapper here? ChainParams chaincfg.Params Lnd *lndclient.LndServices SignalInterceptor signal.Interceptor AssetMinter tapgarden.Planter AssetCustodian *tapgarden.Custodian ChainBridge tapgarden.ChainBridge AddrBook *address.Book ProofArchive proof.Archiver AssetWallet tapfreighter.Wallet ChainPorter tapfreighter.Porter BaseUniverse *universe.MintingArchive UniverseSyncer universe.Syncer UniverseFederation *universe.FederationEnvoy UniverseStats universe.Telemetry // LogWriter is the root logger that all of the daemon's subloggers are // hooked up to. LogWriter *build.RotatingLogWriter *RPCConfig *DatabaseConfig }
Config is the main config of the Taproot Assets server.
type DatabaseConfig ¶
type DatabaseConfig struct { RootKeyStore *tapdb.RootKeyStore MintingStore tapgarden.MintingStore AssetStore *tapdb.AssetStore TapAddrBook *tapdb.TapAddressBook UniverseForest *tapdb.BaseUniverseForest FederationDB *tapdb.UniverseFederationDB }
DatabaseConfig is the config that holds all the persistence related structs and interfaces needed for tapd to function.
type KeyLookup ¶
type KeyLookup interface { // IsLocalKey returns true if the key is under the control of the // wallet and can be derived by it. IsLocalKey(ctx context.Context, desc keychain.KeyDescriptor) bool }
KeyLookup is used to determine whether a key is under the control of the local wallet.
type LndRpcChainBridge ¶
type LndRpcChainBridge struct {
// contains filtered or unexported fields
}
LndRpcChainBridge is an implementation of the tapgarden.ChainBridge interface backed by an active remote lnd node.
func NewLndRpcChainBridge ¶
func NewLndRpcChainBridge(lnd *lndclient.LndServices) *LndRpcChainBridge
NewLndRpcChainBridge creates a new chain bridge from an active lnd services client.
func (*LndRpcChainBridge) CurrentHeight ¶
func (l *LndRpcChainBridge) CurrentHeight(ctx context.Context) (uint32, error)
CurrentHeight return the current height of the main chain.
func (*LndRpcChainBridge) EstimateFee ¶
func (l *LndRpcChainBridge) EstimateFee(ctx context.Context, confTarget uint32) (chainfee.SatPerKWeight, error)
EstimateFee returns a fee estimate for the confirmation target.
func (*LndRpcChainBridge) GetBlock ¶
func (l *LndRpcChainBridge) GetBlock(ctx context.Context, hash chainhash.Hash) (*wire.MsgBlock, error)
GetBlock returns a chain block given its hash.
func (*LndRpcChainBridge) PublishTransaction ¶
PublishTransaction attempts to publish a new transaction to the network.
func (*LndRpcChainBridge) RegisterConfirmationsNtfn ¶
func (l *LndRpcChainBridge) RegisterConfirmationsNtfn(ctx context.Context, txid *chainhash.Hash, pkScript []byte, numConfs, heightHint uint32, includeBlock bool) (*chainntnfs.ConfirmationEvent, chan error, error)
RegisterConfirmationsNtfn registers an intent to be notified once txid reaches numConfs confirmations.
type LndRpcGenSigner ¶
type LndRpcGenSigner struct {
// contains filtered or unexported fields
}
LndRpcGenSigner is an implementation of the asset.GenesisSigner interface backed by an active lnd node.
func NewLndRpcGenSigner ¶
func NewLndRpcGenSigner(lnd *lndclient.LndServices) *LndRpcGenSigner
NewLndRpcGenSigner returns a new gen signer instance backed by the passed connection to a remote lnd node.
func (*LndRpcGenSigner) SignGenesis ¶
func (l *LndRpcGenSigner) SignGenesis(keyDesc keychain.KeyDescriptor, initialGen asset.Genesis, currentGen *asset.Genesis) (*btcec.PublicKey, *schnorr.Signature, error)
SignGenesis tweaks the public key identified by the passed key descriptor with the the first passed Genesis description, and signs the second passed Genesis description with the tweaked public key. For minting the first asset in a group, only one Genesis object is needed, since we tweak with and sign over the same Genesis object. The final tweaked public key and the signature are returned.
type LndRpcKeyRing ¶
type LndRpcKeyRing struct {
// contains filtered or unexported fields
}
LndRpcKeyRing is an implementation of the keychain.KeyRing interface backed by an active remote lnd node.
func NewLndRpcKeyRing ¶
func NewLndRpcKeyRing(lnd *lndclient.LndServices) *LndRpcKeyRing
NewLndRpcKeyRing creates a new instance of the LndRpcKeyRing based on the passed ln client.
func (*LndRpcKeyRing) DeriveKey ¶
func (l *LndRpcKeyRing) DeriveKey(ctx context.Context, keyLoc keychain.KeyLocator) (keychain.KeyDescriptor, error)
DeriveKey attempts to derive an arbitrary key specified by the passed KeyLocator. This may be used in several recovery scenarios, or when manually rotating something like our current default node key.
func (*LndRpcKeyRing) DeriveNextKey ¶
func (l *LndRpcKeyRing) DeriveNextKey(ctx context.Context, keyFam keychain.KeyFamily) (keychain.KeyDescriptor, error)
DeriveNextKey attempts to derive the *next* key within the key family (account in BIP-0043) specified. This method should return the next external child within this branch.
func (*LndRpcKeyRing) DeriveNextTaprootAssetKey ¶
func (l *LndRpcKeyRing) DeriveNextTaprootAssetKey( ctx context.Context) (keychain.KeyDescriptor, error)
DeriveNextTaprootAssetKey attempts to derive the *next* key within the Taproot Asset key family.
func (*LndRpcKeyRing) IsLocalKey ¶
func (l *LndRpcKeyRing) IsLocalKey(ctx context.Context, desc keychain.KeyDescriptor) bool
IsLocalKey returns true if the key is under the control of the wallet and can be derived by it.
type LndRpcVirtualTxSigner ¶
type LndRpcVirtualTxSigner struct {
// contains filtered or unexported fields
}
LndRpcVirtualTxSigner is an implementation of the tapscript.Signer interface backed by an active lnd node.
func NewLndRpcVirtualTxSigner ¶
func NewLndRpcVirtualTxSigner(lnd *lndclient.LndServices) *LndRpcVirtualTxSigner
NewLndRpcVirtualTxSigner returns a new tx signer instance backed by the passed connection to a remote lnd node.
func (*LndRpcVirtualTxSigner) SignVirtualTx ¶
func (l *LndRpcVirtualTxSigner) SignVirtualTx(signDesc *lndclient.SignDescriptor, tx *wire.MsgTx, prevOut *wire.TxOut) (*schnorr.Signature, error)
SignVirtualTx generates a signature according to the passed signing descriptor and virtual TX.
type LndRpcWalletAnchor ¶
type LndRpcWalletAnchor struct {
// contains filtered or unexported fields
}
LndRpcWalletAnchor is an implementation of the tapgarden.WalletAnchor interfaced backed by an active remote lnd node.
func NewLndRpcWalletAnchor ¶
func NewLndRpcWalletAnchor(lnd *lndclient.LndServices) *LndRpcWalletAnchor
NewLndRpcWalletAnchor returns a new wallet anchor instance using the passed lnd node.
func (*LndRpcWalletAnchor) FundPsbt ¶
func (l *LndRpcWalletAnchor) FundPsbt(ctx context.Context, packet *psbt.Packet, minConfs uint32, feeRate chainfee.SatPerKWeight) (tapgarden.FundedPsbt, error)
FundPsbt attaches enough inputs to the target PSBT packet for it to be valid.
func (*LndRpcWalletAnchor) ImportTaprootOutput ¶
func (l *LndRpcWalletAnchor) ImportTaprootOutput(ctx context.Context, pub *btcec.PublicKey) (btcutil.Address, error)
ImportTaprootOutput imports a new public key into the wallet, as a P2TR output.
func (*LndRpcWalletAnchor) ListTransactions ¶
func (l *LndRpcWalletAnchor) ListTransactions(ctx context.Context, startHeight, endHeight int32, account string) ([]lndclient.Transaction, error)
ListTransactions returns all known transactions of the backing lnd node. It takes a start and end block height which can be used to limit the block range that we query over. These values can be left as zero to include all blocks. To include unconfirmed transactions in the query, endHeight must be set to -1.
func (*LndRpcWalletAnchor) ListUnspentImportScripts ¶
func (l *LndRpcWalletAnchor) ListUnspentImportScripts( ctx context.Context) ([]*lnwallet.Utxo, error)
ListUnspentImportScripts lists all UTXOs of the imported Taproot scripts.
func (*LndRpcWalletAnchor) SignAndFinalizePsbt ¶
func (l *LndRpcWalletAnchor) SignAndFinalizePsbt(ctx context.Context, pkt *psbt.Packet) (*psbt.Packet, error)
SignAndFinalizePsbt fully signs and finalizes the target PSBT packet.
func (*LndRpcWalletAnchor) SignPsbt ¶
func (l *LndRpcWalletAnchor) SignPsbt(ctx context.Context, packet *psbt.Packet) (*psbt.Packet, error)
SignPsbt...
func (*LndRpcWalletAnchor) SubscribeTransactions ¶
func (l *LndRpcWalletAnchor) SubscribeTransactions( ctx context.Context) (<-chan lndclient.Transaction, <-chan error, error)
SubscribeTransactions creates a uni-directional stream from the server to the client in which any newly discovered transactions relevant to the wallet are sent over.
func (*LndRpcWalletAnchor) UnlockInput ¶
func (l *LndRpcWalletAnchor) UnlockInput(ctx context.Context) error
UnlockInput unlocks the set of target inputs after a batch is abandoned.
type RPCConfig ¶
type RPCConfig struct { LisCfg *lnd.ListenerCfg RPCListeners []net.Addr RESTListeners []net.Addr GrpcServerOpts []grpc.ServerOption RestDialOpts []grpc.DialOption RestListenFunc func(net.Addr) (net.Listener, error) WSPingInterval time.Duration WSPongWait time.Duration RestCORS []string NoMacaroons bool MacaroonPath string LetsEncryptDir string LetsEncryptListen string LetsEncryptDomain string LetsEncryptEmail string }
RPCConfig is a sub-config of the main server that packages up everything needed to start the RPC server.
type RpcUniverseDiff ¶
type RpcUniverseDiff struct {
// contains filtered or unexported fields
}
RpcUniverseDiff is an implementation of the universe.DiffEngine interface that uses an RPC connection to target Universe.
func (*RpcUniverseDiff) FetchIssuanceProof ¶
func (r *RpcUniverseDiff) FetchIssuanceProof(ctx context.Context, id universe.Identifier, key universe.BaseKey) ([]*universe.IssuanceProof, error)
FetchIssuanceProof attempts to fetch an issuance proof for the target base leaf based on the universe identifier (assetID/groupKey).
TODO(roasbeef): actually add this somewhere else? * rn kinda asymmetric, as just need this to complete final portion of diff
func (*RpcUniverseDiff) MintingKeys ¶
func (r *RpcUniverseDiff) MintingKeys(ctx context.Context, id universe.Identifier) ([]universe.BaseKey, error)
MintingKeys returns all the keys inserted in the universe.
func (*RpcUniverseDiff) RootNode ¶
func (r *RpcUniverseDiff) RootNode(ctx context.Context, id universe.Identifier) (universe.BaseRoot, error)
RootNode returns the root node for a given base universe.
type RpcUniverseRegistrar ¶ added in v0.2.1
type RpcUniverseRegistrar struct {
// contains filtered or unexported fields
}
RpcUniverseRegistrar is an implementation of the universe.Registrar interface that uses an RPC connection to target Universe.
func (*RpcUniverseRegistrar) RegisterIssuance ¶ added in v0.2.1
func (r *RpcUniverseRegistrar) RegisterIssuance(ctx context.Context, id universe.Identifier, key universe.BaseKey, leaf *universe.MintingLeaf) (*universe.IssuanceProof, error)
RegisterIssuance is an implementation of the universe.Registrar interface that uses a remote Universe server as the Registry instance.
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 (Server) AddFederationServer ¶
func (r Server) AddFederationServer(ctx context.Context, in *unirpc.AddFederationServerRequest, ) (*unirpc.AddFederationServerResponse, error)
AddFederationServer adds a new server to the federation of the local Universe server. Once a server is added, this call can also optionally be used to trigger a sync of the remote server.
func (Server) AddrReceives ¶
func (r Server) AddrReceives(ctx context.Context, in *taprpc.AddrReceivesRequest) (*taprpc.AddrReceivesResponse, error)
AddrReceives lists all receives for incoming asset transfers for addresses that were created previously.
func (Server) AnchorVirtualPsbts ¶
func (r Server) AnchorVirtualPsbts(ctx context.Context, in *wrpc.AnchorVirtualPsbtsRequest) (*taprpc.SendAssetResponse, error)
AnchorVirtualPsbts merges and then commits multiple virtual transactions in a single BTC level anchor transaction.
TODO(guggero): Actually implement accepting and merging multiple transactions.
func (Server) AssetLeafKeys ¶
func (r Server) AssetLeafKeys(ctx context.Context, req *unirpc.ID) (*unirpc.AssetLeafKeyResponse, error)
AssetLeafKeys queries for the set of Universe keys associated with a given asset_id or group_key. Each key takes the form: (outpoint, script_key), where outpoint is an outpoint in the Bitcoin blockchain that anchors a valid Taproot Asset commitment, and script_key is the script_key of the asset within the Taproot Asset commitment for the given asset_id or group_key.
func (Server) AssetLeaves ¶
AssetLeaves queries for the set of asset leaves (the values in the Universe MS-SMT tree) for a given asset_id or group_key. These represents either asset issuance events (they have a genesis witness) or asset transfers that took place on chain. The leaves contain a normal Taproot asset proof, as well as details for the asset.
func (Server) AssetRoots ¶
func (r Server) AssetRoots(ctx context.Context, req *unirpc.AssetRootRequest) (*unirpc.AssetRootResponse, error)
AssetRoots queries for the known Universe roots associated with each known asset. These roots represent the supply/audit state for each known asset.
func (Server) CancelBatch ¶
func (r Server) CancelBatch(_ context.Context, _ *mintrpc.CancelBatchRequest) (*mintrpc.CancelBatchResponse, error)
CancelBatch attempts to cancel the current pending batch.
func (Server) DebugLevel ¶
func (r Server) DebugLevel(ctx context.Context, req *taprpc.DebugLevelRequest) (*taprpc.DebugLevelResponse, error)
DebugLevel allows a caller to programmatically set the logging verbosity of tapd. The logging can be targeted according to a coarse daemon-wide logging level, or in a granular fashion to specify the logging for a target sub-system.
func (Server) DecodeAddr ¶
DecodeAddr decode a Taproot Asset address into a partial asset message that represents the asset it wants to receive.
func (Server) DecodeProof ¶ added in v0.2.1
func (r Server) DecodeProof(ctx context.Context, in *taprpc.DecodeProofRequest) (*taprpc.DecodeProofResponse, error)
DecodeProof attempts to decode a given proof file that claims to be anchored at the specified genesis point.
func (Server) DeleteAssetRoot ¶ added in v0.2.1
func (r Server) DeleteAssetRoot(ctx context.Context, req *unirpc.DeleteRootQuery) (*unirpc.DeleteRootResponse, error)
DeleteAssetRoot attempts to locate the current Universe root for a specific asset, and deletes the associated Universe tree if found.
func (Server) DeleteFederationServer ¶
func (r Server) DeleteFederationServer(ctx context.Context, in *unirpc.DeleteFederationServerRequest, ) (*unirpc.DeleteFederationServerResponse, error)
DeleteFederationServer removes a server from the federation of the local Universe server.
func (Server) ExportProof ¶
func (r Server) ExportProof(ctx context.Context, in *taprpc.ExportProofRequest) (*taprpc.ProofFile, error)
ExportProof exports the latest raw proof file anchored at the specified script_key.
func (Server) FetchAssetMeta ¶
func (r Server) FetchAssetMeta(ctx context.Context, in *taprpc.FetchAssetMetaRequest) (*taprpc.AssetMeta, error)
FetchAssetMeta allows a caller to fetch the reveal meta data for an asset either by the asset ID for that asset, or a meta hash.
func (Server) FinalizeBatch ¶
func (r Server) FinalizeBatch(_ context.Context, _ *mintrpc.FinalizeBatchRequest) (*mintrpc.FinalizeBatchResponse, error)
FinalizeBatch attempts to finalize the current pending batch.
func (Server) FundVirtualPsbt ¶
func (r Server) FundVirtualPsbt(ctx context.Context, in *wrpc.FundVirtualPsbtRequest) (*wrpc.FundVirtualPsbtResponse, error)
FundVirtualPsbt selects inputs from the available asset commitments to fund a virtual transaction matching the template.
func (Server) GetInfo ¶ added in v0.2.1
func (r Server) GetInfo(context.Context, *taprpc.GetInfoRequest) (*taprpc.GetInfoResponse, error)
GetInfo returns general information relating to the active daemon. For example: its version, network, and lnd version.
func (Server) ImportProof ¶
func (r Server) ImportProof(ctx context.Context, in *taprpc.ImportProofRequest) (*taprpc.ImportProofResponse, error)
ImportProof attempts to import a proof file into the daemon. If successful, a new asset will be inserted on disk, spendable using the specified target script key, and internal key.
func (Server) Info ¶ added in v0.2.1
func (r Server) Info(ctx context.Context, req *unirpc.InfoRequest) (*unirpc.InfoResponse, error)
Info returns a set of information about the current state of the Universe.
func (Server) InsertProof ¶
func (r Server) InsertProof(ctx context.Context, req *unirpc.AssetProof) (*unirpc.AssetProofResponse, error)
InsertProof attempts to insert a new issuance proof into the Universe tree specified by the UniverseKey. If valid, then the proof is inserted into the database, with a new Universe root returned for the updated asset_id/group_key.
func (Server) ListAssets ¶
func (r Server) ListAssets(ctx context.Context, req *taprpc.ListAssetRequest) (*taprpc.ListAssetResponse, error)
ListAssets lists the set of assets owned by the target daemon.
func (Server) ListBalances ¶
func (r Server) ListBalances(ctx context.Context, in *taprpc.ListBalancesRequest) (*taprpc.ListBalancesResponse, error)
ListBalances lists the asset balances owned by the daemon.
func (Server) ListBatches ¶
func (r Server) ListBatches(_ context.Context, req *mintrpc.ListBatchRequest) (*mintrpc.ListBatchResponse, error)
ListBatches lists the set of batches submitted for minting, including pending and cancelled batches.
func (Server) ListFederationServers ¶
func (r Server) ListFederationServers(ctx context.Context, in *unirpc.ListFederationServersRequest, ) (*unirpc.ListFederationServersResponse, error)
ListFederationServers lists the set of servers that make up the federation of the local Universe server. This servers are used to push out new proofs, and also periodically call sync new proofs from the remote server.
func (Server) ListGroups ¶
func (r Server) ListGroups(ctx context.Context, _ *taprpc.ListGroupsRequest) (*taprpc.ListGroupsResponse, error)
ListGroups lists known groups and the assets held in each group.
func (Server) ListTransfers ¶
func (r Server) ListTransfers(ctx context.Context, in *taprpc.ListTransfersRequest) (*taprpc.ListTransfersResponse, error)
ListTransfers lists all asset transfers managed by this deamon.
func (Server) ListUtxos ¶
func (r Server) ListUtxos(ctx context.Context, _ *taprpc.ListUtxosRequest) (*taprpc.ListUtxosResponse, error)
ListUtxos lists the UTXOs managed by the target daemon, and the assets they hold.
func (Server) MintAsset ¶
func (r Server) MintAsset(ctx context.Context, req *mintrpc.MintAssetRequest) (*mintrpc.MintAssetResponse, error)
MintAsset attempts to mint the set of assets (async by default to ensure proper batching) specified in the request.
func (Server) NextInternalKey ¶
func (r Server) NextInternalKey(ctx context.Context, req *wrpc.NextInternalKeyRequest) (*wrpc.NextInternalKeyResponse, error)
NextInternalKey derives the next internal key for the given key family and stores it as an internal key in the database to make sure it is identified as a local key later on when importing proofs. While an internal key can also be used as the internal key of a script key, it is recommended to use the NextScriptKey RPC instead, to make sure the tweaked Taproot output key is also recognized as a local key.
func (Server) NextScriptKey ¶
func (r Server) NextScriptKey(ctx context.Context, req *wrpc.NextScriptKeyRequest) (*wrpc.NextScriptKeyResponse, error)
NextScriptKey derives the next script key (and its corresponding internal key) and stores them both in the database to make sure they are identified as local keys later on when importing proofs.
func (Server) ProveAssetOwnership ¶
func (r Server) ProveAssetOwnership(ctx context.Context, in *wrpc.ProveAssetOwnershipRequest) (*wrpc.ProveAssetOwnershipResponse, error)
ProveAssetOwnership creates an ownership proof embedded in an asset transition proof. That ownership proof is a signed virtual transaction spending the asset with a valid witness to prove the prover owns the keys that can spend the asset.
func (Server) QueryAddrs ¶
func (r Server) QueryAddrs(ctx context.Context, in *taprpc.QueryAddrRequest) (*taprpc.QueryAddrResponse, error)
QueryAddrs queries the set of Taproot Asset addresses stored in the database.
func (Server) QueryAssetRoots ¶
func (r Server) QueryAssetRoots(ctx context.Context, req *unirpc.AssetRootQuery) (*unirpc.QueryRootResponse, error)
QueryAssetRoots attempts to locate the current Universe root for a specific asset. This asset can be identified by its asset ID or group key.
func (Server) QueryAssetStats ¶
func (r Server) QueryAssetStats(ctx context.Context, req *unirpc.AssetStatsQuery) (*unirpc.UniverseAssetStats, error)
QueryAssetStats returns a set of statistics for a given set of assets. Stats can be queried for all assets, or based on the: asset ID, name, or asset type. Pagination is supported via the offset and limit params. Results can also be sorted based on any of the main query params.
func (Server) QueryProof ¶
func (r Server) QueryProof(ctx context.Context, req *unirpc.UniverseKey) (*unirpc.AssetProofResponse, error)
QueryProof attempts to query for an issuance proof for a given asset based on its UniverseKey. A UniverseKey is composed of the Universe ID (asset_id/group_key) and also a leaf key (outpoint || script_key). If found, then the issuance proof is returned that includes an inclusion proof to the known Universe root, as well as a Taproot Asset state transition or issuance proof for the said asset.
func (Server) RegisterWithGrpcServer ¶
RegisterWithGrpcServer registers the rpcServer with the passed root gRPC server.
func (Server) RegisterWithRestProxy ¶
func (r Server) RegisterWithRestProxy(restCtx context.Context, restMux *proxy.ServeMux, restDialOpts []grpc.DialOption, restProxyDest string) error
RegisterWithRestProxy registers the RPC server with the given rest proxy.
func (*Server) RunUntilShutdown ¶
RunUntilShutdown runs the main Taproot Asset server loop until a signal is received to shut down the process.
func (Server) SendAsset ¶
func (r Server) SendAsset(_ context.Context, in *taprpc.SendAssetRequest) (*taprpc.SendAssetResponse, error)
SendAsset uses one or multiple passed Taproot Asset address(es) to attempt to complete an asset send. The method returns information w.r.t the on chain send, as well as the proof file information the receiver needs to fully receive the asset.
func (Server) SignVirtualPsbt ¶
func (r Server) SignVirtualPsbt(_ context.Context, in *wrpc.SignVirtualPsbtRequest) (*wrpc.SignVirtualPsbtResponse, error)
SignVirtualPsbt signs the inputs of a virtual transaction and prepares the commitments of the inputs and outputs.
func (Server) Start ¶
func (r Server) Start() error
Start signals that the RPC server starts accepting requests.
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) StopDaemon ¶
func (r Server) StopDaemon(_ context.Context, _ *taprpc.StopRequest) (*taprpc.StopResponse, error)
StopDaemon will send a shutdown request to the interrupt handler, triggering a graceful shutdown of the daemon.
func (Server) SubscribeSendAssetEventNtfns ¶
func (r Server) SubscribeSendAssetEventNtfns( in *taprpc.SubscribeSendAssetEventNtfnsRequest, ntfnStream taprpc.TaprootAssets_SubscribeSendAssetEventNtfnsServer) error
SubscribeSendAssetEventNtfns registers a subscription to the event notification stream which relates to the asset sending process.
func (Server) SyncUniverse ¶
func (r Server) SyncUniverse(ctx context.Context, req *unirpc.SyncRequest) (*unirpc.SyncResponse, error)
SyncUniverse takes host information for a remote Universe server, then attempts to synchronize either only the set of specified asset_ids, or all assets if none are specified. The sync process will attempt to query for the latest known root for each asset, performing tree based reconciliation to arrive at a new shared root.
func (Server) UniverseStats ¶
func (r Server) UniverseStats(ctx context.Context, req *unirpc.StatsRequest) (*unirpc.StatsResponse, error)
UniverseStats returns a set of aggregate statistics for the current state of the Universe.
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) VerifyAssetOwnership ¶
func (r Server) VerifyAssetOwnership(ctx context.Context, in *wrpc.VerifyAssetOwnershipRequest) (*wrpc.VerifyAssetOwnershipResponse, error)
VerifyAssetOwnership verifies the asset ownership proof embedded in the given transition proof of an asset and returns true if the proof is valid.
func (Server) VerifyProof ¶
func (r Server) VerifyProof(ctx context.Context, in *taprpc.ProofFile) (*taprpc.VerifyProofResponse, error)
VerifyProof attempts to verify a given proof file that claims to be anchored at the specified genesis point.
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) error
Execute creates and runs an instance of the Taproot Asset script V0 VM.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
internal
|
|
Package taprpc is a reverse proxy.
|
Package taprpc is a reverse proxy. |
assetwalletrpc
Package assetwalletrpc is a reverse proxy.
|
Package assetwalletrpc is a reverse proxy. |
mintrpc
Package mintrpc is a reverse proxy.
|
Package mintrpc is a reverse proxy. |
universerpc
Package universerpc is a reverse proxy.
|
Package universerpc is a reverse proxy. |