Documentation
¶
Index ¶
- Constants
- Variables
- func AddSubLogger(root *build.RotatingLogWriter, subsystem string, ...)
- func SetSubLogger(root *build.RotatingLogWriter, subsystem string, logger btclog.Logger, ...)
- func SetupLoggers(root *build.RotatingLogWriter, interceptor signal.Interceptor)
- func Tags() []string
- func Version() string
- type Config
- type DatabaseConfig
- 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) 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) DeriveNextTaroKey(ctx context.Context) (keychain.KeyDescriptor, error)
- type LndRpcVirtualTxSigner
- type LndRpcWalletAnchor
- func (l *LndRpcWalletAnchor) FundPsbt(ctx context.Context, packet *psbt.Packet, minConfs uint32, ...) (tarogarden.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 Server
- 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 = 1 // AppPatch defines the application patch for this binary. AppPatch uint = 0 // 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 )
var ( // RequiredPermissions is a map of all taro RPC methods and their // required macaroon permissions to access tarod. // // TODO(roasbeef): re think these and go instead w/ the * approach? RequiredPermissions = map[string][]bakery.Op{ "/tarorpc.Taro/StopDaemon": {{ Entity: "daemon", Action: "write", }}, "/tarorpc.Taro/DebugLevel": {{ Entity: "daemon", Action: "write", }}, "/tarorpc.Taro/MintAsset": {{ Entity: "assets", Action: "write", }}, "/tarorpc.Taro/ListAssets": {{ Entity: "assets", Action: "read", }}, "/tarorpc.Taro/ListBalances": {{ Entity: "assets", Action: "read", }}, "/tarorpc.Taro/ListTransfers": {{ Entity: "assets", Action: "read", }}, "/tarorpc.Taro/QueryAddrs": {{ Entity: "addresses", Action: "read", }}, "/tarorpc.Taro/NewAddr": {{ Entity: "addresses", Action: "write", }}, "/tarorpc.Taro/DecodeAddr": {{ Entity: "addresses", Action: "read", }}, "/tarorpc.Taro/AddrReceives": {{ Entity: "addresses", Action: "read", }}, "/tarorpc.Taro/VerifyProof": {{ Entity: "proofs", Action: "read", }}, "/tarorpc.Taro/ExportProof": {{ Entity: "proofs", Action: "read", }}, "/tarorpc.Taro/ImportProof": {{ Entity: "proofs", Action: "write", }}, "/tarorpc.Taro/SendAsset": {{ Entity: "assets", Action: "write", }}, } )
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 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 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 // TODO(roasbeef): use the taro chain param wrapper here? ChainParams chaincfg.Params SignalInterceptor signal.Interceptor AssetMinter tarogarden.Planter AssetCustodian *tarogarden.Custodian AddrBook *address.Book ProofArchive proof.Archiver ChainPorter tarofreighter.Porter // 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 Taro server.
type DatabaseConfig ¶
type DatabaseConfig struct { RootKeyStore *tarodb.RootKeyStore MintingStore tarogarden.MintingStore AssetStore *tarodb.AssetStore TaroAddrBook *tarodb.TaroAddressBook }
DatabaseConfig is the config that holds all the persistence related structs and interfaces needed for tarod to function.
type LndRpcChainBridge ¶
type LndRpcChainBridge struct {
// contains filtered or unexported fields
}
LndRpcChainBridge is an implementation of the tarogarden.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) 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, assetGen asset.Genesis) (*btcec.PublicKey, *schnorr.Signature, error)
SignGenesis signs the passed Genesis description using the public key identified by the passed key descriptor. 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 BIP43) specified. This method should return the next external child within this branch.
func (*LndRpcKeyRing) DeriveNextTaroKey ¶
func (l *LndRpcKeyRing) DeriveNextTaroKey( ctx context.Context) (keychain.KeyDescriptor, error)
DeriveNextTaroKey attempts to derive the *next* key within the Taro key family.
type LndRpcVirtualTxSigner ¶
type LndRpcVirtualTxSigner struct {
// contains filtered or unexported fields
}
LndRpcVirtualTxSigner is an implementation of the taroscript.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.
NOTE: We currently assume the signature requested is for the BIP 86 spending type, and that the passed key is the internal key.
type LndRpcWalletAnchor ¶
type LndRpcWalletAnchor struct {
// contains filtered or unexported fields
}
LndRpcWalletAnchor is an implementation of the tarogarden.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) (tarogarden.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 }
RPCConfig is a sub-config of the main server that packages up everything needed to start the RPC server.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the main daemon construct for the Taro server. It handles spinning up the RPC sever, the database, and any other components that the taro server needs to function.
func (*Server) RunUntilShutdown ¶
RunUntilShutdown runs the main Taro server loop until a signal is received to shut down the process.
type ValidatorV0 ¶
type ValidatorV0 struct{}
ValidatorV0 is an implementation of the taroscript.TxValidator interface that supports Taro script version 0.
func (*ValidatorV0) Execute ¶
func (v *ValidatorV0) Execute(newAsset *asset.Asset, splitAsset *commitment.SplitAsset, prevAssets commitment.InputSet) error
Execute creates and runs an instance of the Taro script V0 VM.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
cmd
|
|
internal
|
|
Package tarorpc is a reverse proxy.
|
Package tarorpc is a reverse proxy. |