Skip to content

Module dev_faff.erl

A module that implements a 'friends and family' pricing policy.

Description

It will allow users to process requests only if their addresses are in the allow-list for the node.

Fundamentally against the spirit of permissionlessness, but it is useful if you are running a node for your own purposes and would not like to allow others to make use of it -- even for a fee. It also serves as a useful example of how to implement a custom pricing policy, as it implements stubs for both the pricing and ledger P4 APIs.

Function Index

charge/3Charge the user's account if the request is allowed.
estimate/3Decide whether or not to service a request from a given address.
is_admissible/2*Check whether all of the signers of the request are in the allow-list.

Function Details

charge/3

charge(X1, Req, NodeMsg) -> any()

Charge the user's account if the request is allowed.

estimate/3

estimate(X1, Msg, NodeMsg) -> any()

Decide whether or not to service a request from a given address.

is_admissible/2 *

is_admissible(Msg, NodeMsg) -> any()

Check whether all of the signers of the request are in the allow-list.