![]() ![]() You may provide a file containing the examples to search over, or you can explicitly specify examples in your request. The actual cost per token is based upon which models you select to perform both the search and the completion, which are controlled by the search_model and model parameters respectively. Internally this endpoint makes calls to the search and completions endpoints, so its costs are a function of the costs of those endpoints. Public_key strategy makes a token ‘bucket’ for each public key.Classifications requests are billed based on the number of tokens in the inputs you provide.If you use Accounts, this strategy is ideal because it allows for faster querying of tokens that belong to accounts. External_ID strategy can be used to group states from many public keys connected to a given unique user ID.Token_Only selection strategy indexes states only using token type and identifier. ![]() As always - you can tune different use cases for better performance by selecting the appropriate indexing strategy. This improves querying time (and ultimately the performance of your application). An indexing strategy is used to apply an index to recorded records of Token States in in the VaultWatcherService. To initialise this service, you must select an indexingStrategy. To use in-memory selection, you must ensure the CorDapp VaultWatcherService is installed and the service is running. addMoveFungibleTokens must always use database selection. ![]() ![]() You can use generic versions of MoveTokensFlow or addMoveTokens (not addMoveFungibleTokens), because you already performed selection and provide input and output states directly. In the example below, multiple fungible token moves are added to a token using DB fun addMoveFungibleTokens ( transactionBuilder : TransactionBuilder, serviceHub : ServiceHub, partiesAndAmounts : List >, changeHolder : AbstractParty, quer圜riteria : Quer圜riteria ? = null ): TransactionBuilder In move flows of multiple tokens using database selection, you specify the method of selection to modify the TransactionBuilder, along with the preferred selection source of payment. In the Tokens SDK, database (DB) selection is the default method of selection for each transaction. This will lead to the notary throwing a double-spend error. This doesn’t work in a multi-threaded environment and multiple threads running at the same time may end up selecting the same token state to be spent. In DB selection, token states must be queried from the vault and “selected” by soft locking the record in the database. Tokens are simply selected, added to a transaction and spent. This means the query time to select available tokens is extremely fast, preventing the need for soft-locking tokens in the DB. This is because a cache of available tokens balances are maintained for querying in the JVM. You can only use in-memory selection in a multithreaded environment. Token selection with multithreaded SMMĪ multithreaded environment is characterised by running tokens with Corda Enterprise where the number of flow workers is configured to be > 1. However, you may decide you prefer Database selection as it keeps the database as the only active source of truth for your tokens. In-memory selection is a much faster method of choosing the right token reserves to use in a transaction. In-memory data, which is like a cache of a node’s current token data.You can write flows for moving your tokens that allow selection from either: When you move or redeem tokens using the Tokens SDK, you can choose which balance of tokens you want to use, and how much from each reserve, in any given transaction. Redeem tokens using LocalTokenSelection. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |