rpcserver

package
v0.8.0-rc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 81 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RPCSubsystem defines the logging code for the RPC subsystem.
	RPCSubsystem = "TRPC"

	// ServerSubsystem defines the logging code for the server subsystem.
	ServerSubsystem = "TSVR"

	// DaemonSubsystem defines the logging code for the daemon subsystem.
	DaemonSubsystem = "TAPD"
)
View Source
const (
	// AssetBurnConfirmationText is the text that needs to be set on the
	// RPC to confirm an asset burn.
	AssetBurnConfirmationText = "assets will be destroyed"
)

Variables

View Source
var (
	// MaxMsgReceiveSize is the largest message our client will receive. We
	// set this to 200MiB atm.
	MaxMsgReceiveSize = grpc.MaxCallRecvMsgSize(lnrpc.MaxGrpcMsgSize)

	// ServerMaxMsgReceiveSize is the largest message our server will
	// receive.
	ServerMaxMsgReceiveSize = grpc.MaxRecvMsgSize(lnrpc.MaxGrpcMsgSize)

	// P2TRChangeType is the type of change address that should be used for
	// funding PSBTs, as we'll always want to use P2TR change addresses.
	P2TRChangeType = walletrpc.ChangeAddressType_CHANGE_ADDRESS_TYPE_P2TR
)

Functions

func AllowCORS

func AllowCORS(handler http.Handler, origins []string) http.Handler

AllowCORS wraps the given http.Handler with a function that adds the Access-Control-Allow-Origin header to the response.

func CheckFederationServer

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

func ConnectUniverse(
	serverAddr universe.ServerAddr) (*universeClientConn, error)

ConnectUniverse connects to a remote Universe server using the provided server address.

func MarshalAssetFedSyncCfg

func MarshalAssetFedSyncCfg(
	config universe.FedUniSyncConfig) (*unirpc.AssetFederationSyncConfig,
	error)

MarshalAssetFedSyncCfg returns an RPC ready asset specific federation sync config.

func MarshalUniID

func MarshalUniID(id universe.Identifier) (*unirpc.ID, error)

MarshalUniID marshals the universe ID into the RPC counterpart.

func MarshalUniProofType

func MarshalUniProofType(
	proofType universe.ProofType) (unirpc.ProofType, error)

MarshalUniProofType marshals the universe proof type into the RPC counterpart.

func NewRpcSupplySync

func NewRpcSupplySync(
	serverAddr universe.ServerAddr) (supplyverifier.UniverseClient, error)

NewRpcSupplySync creates a new RpcSupplySync instance that dials out to the target remote universe server address.

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

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 UnmarshalGroupWitness

func UnmarshalGroupWitness(
	wit *taprpc.GroupWitness) (*tapgarden.PendingGroupWitness, error)

UnmarshalGroupWitness parses an asset group witness from the RPC variant.

func UnmarshalUniID

func UnmarshalUniID(rpcID *unirpc.ID) (universe.Identifier, error)

UnmarshalUniID parses the RPC universe ID into the native counterpart.

func UnmarshalUniProofType

func UnmarshalUniProofType(rpcType unirpc.ProofType) (universe.ProofType,
	error)

UnmarshalUniProofType parses the RPC universe proof type into the native counterpart.

func UseDaemonLogger

func UseDaemonLogger(logger btclog.Logger)

UseDaemonLogger uses a specified Logger to output daemon logging info.

func UseLogger

func UseLogger(logger btclog.Logger)

UseLogger uses a specified Logger to output package logging info.

func UseServerLogger

func UseServerLogger(logger btclog.Logger)

UseServerLogger uses a specified Logger to output server logging info.

Types

type EventStream

type EventStream[T any] interface {
	// Send sends an event object to the notification stream.
	Send(T) error
	grpc.ServerStream
}

EventStream is a generic interface type for notification streams.

type IgnoreAssetOutPointRequest

type IgnoreAssetOutPointRequest struct {
	// AssetAnchorPoint is the asset anchor point to ignore.
	AssetAnchorPoint asset.AnchorPoint

	// Amount is the amount of the asset at the anchor outpoint.
	Amount uint64
}

IgnoreAssetOutPointRequest is the request type for the IgnoreAssetOutPoint RPC method.

type RPCServer

RPCServer is the main RPC server for the Taproot Assets daemon that handles gRPC/REST/Websockets incoming requests.

func NewRPCServer

func NewRPCServer() *RPCServer

NewRPCServer creates a new RPC sever.

func (*RPCServer) AddAssetBuyOffer

AddAssetBuyOffer upserts a new buy offer for the given asset into the RFQ manager. If the offer already exists for the given asset, it will be updated.

A buy offer is used by the node to selectively accept or reject incoming asset sell quote requests before price is considered.

func (*RPCServer) AddAssetBuyOrder

AddAssetBuyOrder upserts a new buy order for the given asset into the RFQ manager. If the order already exists for the given asset, it will be updated.

func (*RPCServer) AddAssetSellOffer

AddAssetSellOffer upserts a new sell offer for the given asset into the RFQ manager. If the offer already exists for the given asset, it will be updated.

func (*RPCServer) AddAssetSellOrder

AddAssetSellOrder upserts a new sell order for the given asset into the RFQ manager. If the order already exists for the given asset, it will be updated.

func (*RPCServer) AddFederationServer

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 (*RPCServer) AddInvoice

AddInvoice is a wrapper around lnd's lnrpc.AddInvoice method with asset specific parameters. It allows RPC users to create invoices that correspond to the specified asset amount.

func (*RPCServer) AddrReceives

AddrReceives lists all receives for incoming asset transfers for addresses that were created previously.

func (*RPCServer) AnchorVirtualPsbts

AnchorVirtualPsbts merges and then commits multiple virtual transactions in a single BTC level anchor transaction.

func (*RPCServer) AssetLeafKeys

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 (*RPCServer) AssetLeaves

func (r *RPCServer) AssetLeaves(ctx context.Context,
	req *unirpc.ID) (*unirpc.AssetLeafResponse, error)

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 (*RPCServer) AssetRoots

AssetRoots queries for the known Universe roots associated with each known asset. These roots represent the supply/audit state for each known asset.

func (*RPCServer) BakeMacaroon

BakeMacaroon allows the creation of a new macaroon with custom permissions. No first-party caveats are added since this can be done offline.

func (*RPCServer) BurnAsset

BurnAsset burns the given number of units of a given asset by sending them to a provably un-spendable script key. Burning means irrevocably destroying a certain number of assets, reducing the total supply of the asset. Because burning is such a destructive and non-reversible operation, some specific values need to be set in the request to avoid accidental burns.

func (*RPCServer) CancelBatch

CancelBatch attempts to cancel the current pending batch.

func (*RPCServer) CommitVirtualPsbts

CommitVirtualPsbts creates the output commitments and proofs for the given virtual transactions by committing them to the BTC level anchor transaction. In addition, the BTC level anchor transaction is funded and prepared up to the point where it is ready to be signed.

func (*RPCServer) DebugLevel

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 (*RPCServer) DeclareScriptKey

DeclareScriptKey declares a new script key to the wallet. This is useful when the script key contains scripts, which would mean it wouldn't be recognized by the wallet automatically. Declaring a script key will make any assets sent to the script key be recognized as being local assets.

func (*RPCServer) DecodeAddr

func (r *RPCServer) DecodeAddr(_ context.Context,
	req *taprpc.DecodeAddrRequest) (*taprpc.Addr, error)

DecodeAddr decode a Taproot Asset address into a partial asset message that represents the asset it wants to receive.

func (*RPCServer) DecodeAssetPayReq

func (r *RPCServer) DecodeAssetPayReq(ctx context.Context,
	payReq *tchrpc.AssetPayReq) (*tchrpc.AssetPayReqResponse, error)

DecodeAssetPayReq decodes an incoming invoice, then uses the RFQ system to map the BTC amount to the amount of asset units for the specified asset ID.

func (*RPCServer) DecodeProof

DecodeProof attempts to decode a given proof file that claims to be anchored at the specified genesis point.

func (*RPCServer) DeleteAssetLeaf

DeleteAssetLeaf deletes a single Universe leaf, identified by its universe ID and leaf key (outpoint + script key).

func (*RPCServer) DeleteAssetRoot

func (r *RPCServer) 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 (*RPCServer) DeleteFederationServer

DeleteFederationServer removes a server from the federation of the local Universe server.

func (*RPCServer) EncodeCustomRecords

EncodeCustomRecords allows RPC users to encode Taproot Asset channel related data into the TLV format that is used in the custom records of the lnd payment or other channel related RPCs. This RPC is completely stateless and does not perform any checks on the data provided, other than pure format validation.

func (*RPCServer) ExportAssetWalletBackup

ExportAssetWalletBackup exports a backup of all active assets in the wallet. The backup includes all data necessary to restore the assets in case of database or system failure.

func (*RPCServer) ExportProof

func (r *RPCServer) ExportProof(ctx context.Context,
	req *taprpc.ExportProofRequest) (*taprpc.ProofFile, error)

ExportProof exports the latest raw proof file anchored at the specified script_key.

func (*RPCServer) FetchAsset

FetchAsset fetches asset(s) by asset ID or group key, with optional filters.

func (*RPCServer) FetchAssetMeta

func (*RPCServer) FetchSupplyCommit

FetchSupplyCommit fetches the on-chain supply commitment for a specific asset group.

func (*RPCServer) FetchSupplyLeaves

FetchSupplyLeaves fetches the supply leaves for a specific asset group within a specified block height range. The leaves include issuance, burn, and ignore leaves, which represent the supply changes for the asset group.

func (*RPCServer) FinalizeBatch

FinalizeBatch attempts to finalize the current pending batch.

func (*RPCServer) ForwardingHistory

ForwardingHistory queries the historical records of asset forwarding events.

func (*RPCServer) FundBatch

FundBatch attempts to fund the current pending batch.

func (*RPCServer) FundChannel

FundChannel initiates the channel funding negotiation with a peer for the creation of a channel that contains a specified amount of a given asset.

func (*RPCServer) FundVirtualPsbt

FundVirtualPsbt selects inputs from the available asset commitments to fund a virtual transaction matching the template.

func (*RPCServer) GetInfo

GetInfo returns general information relating to the active daemon. For example: its version, network, and lnd version.

func (*RPCServer) IgnoreAssetOutPoint

IgnoreAssetOutPoint allows an asset issuer to mark a specific asset outpoint as ignored. An ignored outpoint will be included in the next universe commitment transaction that is published.

func (*RPCServer) ImportAssetsFromBackup

ImportAssetsFromBackup imports assets from a backup blob that was previously created using ExportAssetWalletBackup.

func (*RPCServer) ImportProof

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 (*RPCServer) Info

Info returns a set of information about the current state of the Universe and allows a caller to check that a universe server is reachable and configured correctly to allow proof courier access without macaroons.

func (*RPCServer) InsertProof

func (r *RPCServer) InsertProof(ctx context.Context,
	req *unirpc.AssetProof) (*unirpc.AssetProofResponse, error)

InsertProof attempts to insert a new issuance or transfer 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 (*RPCServer) InsertSupplyCommit

InsertSupplyCommit stores a verified supply commitment for the given asset group in the node's local database.

func (*RPCServer) ListAssets

ListAssets lists the set of assets owned by the target daemon.

func (*RPCServer) ListBalances

ListBalances lists the asset balances owned by the daemon.

func (*RPCServer) ListBatches

ListBatches lists the set of batches submitted for minting, including pending and cancelled batches.

func (*RPCServer) ListBurns

ListBurns returns a list of burnt assets. Some filters may be defined in the request to return more specific results.

func (*RPCServer) ListFederationServers

ListFederationServers lists the set of servers that make up the federation of the local Universe server. These servers are used to push out new proofs, and also periodically call sync new proofs from the remote server.

func (*RPCServer) ListGroups

ListGroups lists known groups and the assets held in each group.

func (*RPCServer) ListTransfers

ListTransfers returns a list of all asset transfers managed by this daemon. This includes both confirmed and unconfirmed transfers.

func (*RPCServer) ListUtxos

ListUtxos lists the UTXOs managed by the target daemon, and the assets they hold.

func (*RPCServer) MarshalChainAsset

func (r *RPCServer) MarshalChainAsset(ctx context.Context, a asset.ChainAsset,
	meta *proof.MetaReveal, withWitness bool,
	keyRing rpcutils.KeyLookup) (*taprpc.Asset, error)

MarshalChainAsset marshals the given chain asset into an RPC asset.

func (*RPCServer) MintAsset

MintAsset attempts to mint the set of assets (async by default to ensure proper batching) specified in the request.

func (*RPCServer) MultiverseRoot

MultiverseRoot returns the root of the multiverse tree. This is useful to determine the equality of two multiverse trees, since the root can directly be compared to another multiverse root to find out if a sync is required.

func (*RPCServer) NewAddr

func (r *RPCServer) NewAddr(ctx context.Context,
	req *taprpc.NewAddrRequest) (*taprpc.Addr, error)

NewAddr makes a new address from the set of request params.

func (*RPCServer) NextInternalKey

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 (*RPCServer) NextScriptKey

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 (*RPCServer) ProofVerifierCtx

func (r *RPCServer) ProofVerifierCtx(ctx context.Context) proof.VerifierCtx

ProofVerifierCtx returns a proof.VerifierCtx that can be used to verify proofs in the RPC server.

func (*RPCServer) ProveAssetOwnership

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 (*RPCServer) PublishAndLogTransfer

func (r *RPCServer) PublishAndLogTransfer(ctx context.Context,
	req *wrpc.PublishAndLogRequest) (*taprpc.SendAssetResponse, error)

PublishAndLogTransfer accepts a fully committed and signed anchor transaction and publishes it to the Bitcoin network. It also logs the transfer of the given active and passive assets in the database and ships any outgoing proofs to the counterparties.

func (*RPCServer) PushProof

PushProof attempts to query the local universe for a proof specified by a UniverseKey. If found, a connection is made to a remote Universe server to attempt to upload the asset leaf.

func (*RPCServer) QueryAddrs

QueryAddrs queries the set of Taproot Asset addresses stored in the database.

func (*RPCServer) QueryAssetRoots

func (r *RPCServer) 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 (*RPCServer) QueryAssetStats

func (r *RPCServer) 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 (*RPCServer) QueryEvents

QueryEvents returns the number of sync and proof events for a given time period, grouped by day.

func (*RPCServer) QueryFederationSyncConfig

QueryFederationSyncConfig queries the universe federation sync configuration settings.

func (*RPCServer) QueryInternalKey

QueryInternalKey returns the key descriptor for the given internal key.

func (*RPCServer) QueryPeerAcceptedQuotes

QueryPeerAcceptedQuotes is used to query for quotes that were requested by our node and have been accepted our peers.

func (*RPCServer) QueryProof

QueryProof attempts to query for an issuance or transfer 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, the target universe proof leaf is returned in addition to inclusion proofs for the Universe and Multiverse MS-SMTs. This allows a caller to verify the known Universe root, Multiverse root, and transition or issuance proof for the target asset.

func (*RPCServer) QueryScriptKey

QueryScriptKey returns the full script key descriptor for the given tweaked script key.

func (*RPCServer) RegisterTransfer

RegisterTransfer informs the daemon about a new inbound transfer that has happened. This is used for interactive transfers where no TAP address is involved and the recipient is aware of the transfer through an out-of-band protocol but the daemon hasn't been informed about the completion of the transfer. For this to work, the proof must already be in the recipient's local universe (e.g. through the use of the universerpc.InsertProof RPC or the universe proof courier and universe sync mechanisms) and this call simply instructs the daemon to detect the transfer as an asset it owns.

func (*RPCServer) RegisterWithGrpcServer

func (r *RPCServer) RegisterWithGrpcServer(
	registrar grpc.ServiceRegistrar) error

RegisterWithGrpcServer registers the RPCServer with the passed root gRPC server.

func (*RPCServer) RegisterWithRestProxy

func (r *RPCServer) RegisterWithRestProxy(restCtx context.Context,
	restMux *proxy.ServeMux, restDialOpts []grpc.DialOption,
	restProxyDest string) error

RegisterWithRestProxy registers the RPC server with the given rest proxy.

func (*RPCServer) RemoveUTXOLease

RemoveUTXOLease removes the lease/lock/reservation of the given managed UTXO.

func (*RPCServer) SealBatch

SealBatch attempts to seal the current pending batch, validating provided asset group witnesses and generating asset group witnesses as needed.

func (*RPCServer) SendAsset

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 (*RPCServer) SendPayment

SendPayment is a wrapper around lnd's routerrpc.SendPaymentV2 RPC method with asset specific parameters. It allows RPC users to send asset keysend payments (direct payments) or payments to an invoice with a specified asset amount.

func (*RPCServer) SetFederationSyncConfig

SetFederationSyncConfig sets the configuration of the universe federation sync.

func (*RPCServer) SignVirtualPsbt

SignVirtualPsbt signs the inputs of a virtual transaction and prepares the commitments of the inputs and outputs.

func (*RPCServer) Start

func (r *RPCServer) Start(cfg *tapconfig.Config) error

Start signals that the RPC server starts accepting requests.

func (*RPCServer) Stop

func (r *RPCServer) Stop() error

Stop signals that the RPC server should attempt a graceful shutdown and cancel any outstanding requests.

func (*RPCServer) StopDaemon

StopDaemon will send a shutdown request to the interrupt handler, triggering a graceful shutdown of the daemon.

func (*RPCServer) SubscribeMintEvents

func (r *RPCServer) SubscribeMintEvents(req *mintrpc.SubscribeMintEventsRequest,
	ntfnStream mintEventStream) error

SubscribeMintEvents allows a caller to subscribe to mint events for asset creation batches.

func (*RPCServer) SubscribeReceiveAssetEventNtfns

func (r *RPCServer) SubscribeReceiveAssetEventNtfns(
	_ *tapdevrpc.SubscribeReceiveAssetEventNtfnsRequest,
	ntfnStream devReceiveEventStream) error

SubscribeReceiveAssetEventNtfns registers a subscription to the event notification stream which relates to the asset receiving process.

func (*RPCServer) SubscribeReceiveEvents

func (r *RPCServer) SubscribeReceiveEvents(
	req *taprpc.SubscribeReceiveEventsRequest,
	ntfnStream receiveEventStream) error

SubscribeReceiveEvents registers a subscription to the event notification stream which relates to the asset receiving process.

func (*RPCServer) SubscribeRfqEventNtfns

SubscribeRfqEventNtfns subscribes to RFQ event notifications.

func (*RPCServer) SubscribeSendAssetEventNtfns

func (r *RPCServer) SubscribeSendAssetEventNtfns(
	_ *tapdevrpc.SubscribeSendAssetEventNtfnsRequest,
	ntfnStream devSendEventStream) error

SubscribeSendAssetEventNtfns registers a subscription to the event notification stream which relates to the asset sending process.

func (*RPCServer) SubscribeSendEvents

func (r *RPCServer) SubscribeSendEvents(req *taprpc.SubscribeSendEventsRequest,
	ntfnStream sendEventStream) error

SubscribeSendEvents registers a subscription to the event notification stream which relates to the asset sending process.

func (*RPCServer) SyncUniverse

func (r *RPCServer) 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 (*RPCServer) UniverseStats

func (r *RPCServer) UniverseStats(ctx context.Context,
	_ *unirpc.StatsRequest) (*unirpc.StatsResponse, error)

UniverseStats returns a set of aggregate statistics for the current state of the Universe.

func (*RPCServer) UnpackProofFile

UnpackProofFile unpacks a proof file into a list of the individual raw proofs in the proof chain.

func (*RPCServer) UpdateSupplyCommit

UpdateSupplyCommit updates the on-chain supply commitment for a specific asset group.

func (*RPCServer) VerifyAssetOwnership

VerifyAssetOwnership verifies the asset ownership proof embedded in the given transition proof of an asset and returns true if the proof is valid.

func (*RPCServer) VerifyProof

func (r *RPCServer) VerifyProof(ctx context.Context,
	req *taprpc.ProofFile) (*taprpc.VerifyProofResponse, error)

VerifyProof attempts to verify a given proof file that claims to be anchored at the specified genesis point.

type RpcSupplySync

type RpcSupplySync struct {
	// contains filtered or unexported fields
}

RpcSupplySync is an implementation of the universe.SupplySyncer interface that uses an RPC connection to target a remote universe server.

func (*RpcSupplySync) Close

func (r *RpcSupplySync) Close() error

Close closes the RPC connection to the universe server.

func (*RpcSupplySync) FetchSupplyCommit

func (r *RpcSupplySync) FetchSupplyCommit(ctx context.Context,
	assetSpec asset.Specifier,
	spentCommitOutpoint fn.Option[wire.OutPoint]) (
	supplycommit.FetchSupplyCommitResult, error)

FetchSupplyCommit fetches a supply commitment for a specific asset group from the remote universe server.

func (*RpcSupplySync) InsertSupplyCommit

func (r *RpcSupplySync) InsertSupplyCommit(ctx context.Context,
	assetSpec asset.Specifier, commitment supplycommit.RootCommitment,
	leaves supplycommit.SupplyLeaves,
	chainProof supplycommit.ChainProof) error

InsertSupplyCommit inserts a supply commitment for a specific asset group into the remote universe 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) Close

func (r *RpcUniverseDiff) Close() error

Close closes the underlying RPC connection to the remote universe server.

func (*RpcUniverseDiff) FetchProofLeaf

func (r *RpcUniverseDiff) FetchProofLeaf(ctx context.Context,
	id universe.Identifier,
	key universe.LeafKey) ([]*universe.Proof, error)

FetchProofLeaf attempts to fetch a proof leaf for the target leaf key and given a 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) RootNode

RootNode returns the root node for a given universe.

func (*RpcUniverseDiff) RootNodes

RootNodes returns the complete set of known root nodes for the set of assets tracked in the universe.

func (*RpcUniverseDiff) UniverseLeafKeys

UniverseLeafKeys returns all the keys inserted in the universe.

type RpcUniverseRegistrar

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) Close

func (r *RpcUniverseRegistrar) Close() error

Close closes the underlying RPC connection to the remote Universe server.

func (*RpcUniverseRegistrar) UpsertProofLeaf

UpsertProofLeaf is an implementation of the universe.Registrar interface that uses a remote Universe server as the Registry instance.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL