Package nxt.blockchain
Class Bundler
java.lang.Object
nxt.blockchain.Bundler
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interfaceBundling filter - transactions for which theBundler.Filter.ok(Bundler, ChildTransaction)method returns false are not processed by theBundler.Rulestatic classstatic classstatic classBundling rule - transactions that match the filter and minimum rate of the rule are bundled. -
Method Summary
Modifier and TypeMethodDescriptionstatic BundleraddBundlingRule(ChildChain childChain, byte[] privateKey, Bundler.Rule rule) static BundleraddOrChangeBundler(ChildChain childChain, byte[] privateKey, long totalFeesLimitFQT, List<Bundler.Rule> bundlingRules) static Bundler.FiltercreateBundlingFilter(String name, String parameter) static Bundler.RulecreateBundlingRule(long minRateNQTPerFXT, long overpayFQTPerFXT, String feeCalculatorName, List<Bundler.Filter> filters) static longenrichChildBlockList(List<ChildTransaction> childTransactions, ChildChain childChain, int timestamp, short deadline, long totalFeesLimitFQT, List<Bundler.Rule> bundlingRules) Enrich a prospective child block list with child transactions according to the specifiedbundlingRulesand thetotalFeesLimitFQT.getAccountBundlers(long accountId) final longstatic Collection<Bundler.FeeCalculator>static Collection<Bundler.Filter>static BundlergetBundler(ChildChain childChain, long accountId) final BundlerRatestatic List<BundlerRate>final ChildChaingetChildChainBundlers(ChildChain childChain) final longfinal longfinal byte[]final longstatic voidinit()static voidstopAccountBundlers(long accountId) static voidstatic BundlerstopBundler(ChildChain childChain, long accountId) static voidstopChildChainBundlers(ChildChain childChain)
-
Method Details
-
getBundler
-
createBundlingFilter
-
createBundlingRule
public static Bundler.Rule createBundlingRule(long minRateNQTPerFXT, long overpayFQTPerFXT, String feeCalculatorName, List<Bundler.Filter> filters) -
addOrChangeBundler
public static Bundler addOrChangeBundler(ChildChain childChain, byte[] privateKey, long totalFeesLimitFQT, List<Bundler.Rule> bundlingRules) -
addBundlingRule
-
enrichChildBlockList
public static long enrichChildBlockList(List<ChildTransaction> childTransactions, ChildChain childChain, int timestamp, short deadline, long totalFeesLimitFQT, List<Bundler.Rule> bundlingRules) throws NxtException.NotValidException Enrich a prospective child block list with child transactions according to the specifiedbundlingRulesand thetotalFeesLimitFQT.The
totalFeesLimitFQTis internally adjusted by subtracting the minimum required fee for each transaction already present in the providedchildTransactionslist.- Parameters:
childTransactions- The list of child transactions that are currently planned for inclusion in the child block.childChain- The child chain from which transactions to be added to the list.timestamp- The timestamp of the prospective ChildBlock transactiondeadline- The deadline of the prospective ChildBlock transactiontotalFeesLimitFQT- Limit on the fee that the child block transactions can consumebundlingRules- Bundling rules for filtering or prioritizing the additional transactions- Returns:
- The minimum fee the ChildBlock transaction must pay
- Throws:
NxtException.NotValidException- If total fee is not enough to cover the minimum fee for the existing transactions
-
getAllBundlers
-
getChildChainBundlers
-
getAccountBundlers
-
getBundlerRates
-
stopBundler
-
stopAccountBundlers
public static void stopAccountBundlers(long accountId) -
stopChildChainBundlers
-
stopAllBundlers
public static void stopAllBundlers() -
getAvailableFilters
-
getAvailableFeeCalculators
-
init
public static void init() -
getChildChain
-
getPublicKey
public final byte[] getPublicKey() -
getAccountId
public final long getAccountId() -
getTotalFeesLimitFQT
public final long getTotalFeesLimitFQT() -
getCurrentTotalFeesFQT
public final long getCurrentTotalFeesFQT() -
getConfirmedTotalFeesFQT
public final long getConfirmedTotalFeesFQT() -
getBundlingRules
-
getBundlerRate
- Returns:
- Minimum rate among unfiltered rules,
nullif all rules are filtered
-