#fluence #commitment #capacity #prover #protocols #cpu #run

capacity-commitment-prover

The core project of the capacity commitment prover for the Fluence protocol

1 unstable release

0.7.1 Mar 12, 2024

#20 in #prover

Download history 120/week @ 2024-03-11 1/week @ 2024-03-18 20/week @ 2024-04-01

141 downloads per month

Apache-2.0

2MB
21K SLoC

C++ 8K SLoC // 0.1% comments Rust 7K SLoC // 0.2% comments Visual Studio Project 2K SLoC GNU Style Assembly 1.5K SLoC // 0.1% comments C 1K SLoC // 0.2% comments Assembly 1K SLoC // 0.2% comments Bitbake 262 SLoC Visual Studio Solution 176 SLoC PowerShell 33 SLoC // 0.5% comments

Capacity commitment prover (CCP)

CCP is a part of the Fluence Capacity Commitment protocol, which run on the capacity provider part to prove that a certain capacity unit was really allocated to the Fluence network during some epoch. CCP is heavily relies on RandomX algorithm.

Example

Try running from the project root:

tty1$ mkdir -p ../test
tty1$ CCP_LOG=debug cargo run --release -p ccp-main -- ./main/default.toml
<lot of logs>
tty2$ curl --data @main/examples/on_active_commitment.json -H 'content-type: application/json' http://localhost:9383
{"jsonrpc":"2.0","result":null,"id":"42"}
<cpus stay busy>
tty2$ sleep 5m
<cpus stay busy>
tty2$ curl --data @main/examples/on_no_active_commitment.json -H 'content-type: application/json' http://localhost:9383
{"jsonrpc":"2.0","result":null,"id":"45"}
<cpus are free>

Dependencies

~21–36MB
~515K SLoC