ckb-extension-fee-estimator

Crates.iockb-extension-fee-estimator
lib.rsckb-extension-fee-estimator
version0.1.0
sourcesrc
created_at2020-11-19 10:41:30.313073
updated_at2020-11-19 10:41:30.313073
descriptionCKB extension to estimate transaction fees.
homepagehttps://github.com/yangby-cryptape/ckb-extension-fee-estimator
repositoryhttps://github.com/yangby-cryptape/ckb-extension-fee-estimator
max_upload_size
id313952
size115,660
Boyu Yang (yangby-cryptape)

documentation

README

[Experimental] CKB Extension: Fee Estimator

License Travis CI

CKB extension to estimate transaction fees.

:warning: Warning

Not Production Ready!

Usage

  • Compile:

    cargo build --release
    
  • Run a CKB node.

  • Run the fee estimator service:

    RUST_LOG="info,ckb_fee_estimator=trace" \
        ./target/release/ckb-fee-estimator \
            --subscribe-addr "${CKB_RPC_TCP_ADDRESS}" \
            --listen-addr "localhost:8080"
    
  • Waiting for collecting enough data.

  • Query via HTTP JSON-RPC:

    curl -H 'content-type: application/json' \
        -d '{"id": 2,"jsonrpc": "2.0","method": "estimate_fee_rate","params": [{"algorithm":"vbytes-flow", "probability":0.90, "target_minutes": 10}]}' \
        "http://localhost:8080"
    

JSON-RPC Methods

estimate_fee_rate

  • Parameter:

    • algorithm: The algorithm which used for estimating fee rate.

      Currently, there is only one algorithm vbytes-flow.

    • Algorithm-related parameters:

      • For vbytes-flow algorithm, the probability (a 32-bit floating point) and target_minutes (a 32-bit unsigned integer) should be provided.
  • Returns

    • Fee rate (a 64-bit unsigned integer) or null.

      With the returned fee rate, the probability of the transaction to be committed in target_minutes should be equal or greater than probability.

Algorithms

vbytes-flow

Follow the Weight-Units Flow Fee Estimator for Bitcoin

License

Licensed under MIT License.

Commit count: 24

cargo fmt