pub struct OpenChannelParams {Show 14 fields
pub pubkey: Pubkey,
pub funding_amount: u128,
pub public: Option<bool>,
pub one_way: Option<bool>,
pub funding_udt_type_script: Option<Script>,
pub shutdown_script: Option<Script>,
pub commitment_delay_epoch: Option<EpochNumberWithFraction>,
pub commitment_fee_rate: Option<u64>,
pub funding_fee_rate: Option<u64>,
pub tlc_expiry_delta: Option<u64>,
pub tlc_min_value: Option<u128>,
pub tlc_fee_proportional_millionths: Option<u128>,
pub max_tlc_value_in_flight: Option<u128>,
pub max_tlc_number_in_flight: Option<u64>,
}Expand description
Parameters for opening a channel.
Fields§
§pubkey: PubkeyThe public key of the peer to open a channel with. The peer must be connected through the connect_peer rpc first.
funding_amount: u128The amount of CKB or UDT to fund the channel with.
public: Option<bool>Whether this is a public channel (will be broadcasted to network, and can be used to forward TLCs), an optional parameter, default value is true.
one_way: Option<bool>Whether this is a one-way channel (will not be broadcasted to network, and can only be used to send payment one way), an optional parameter, default value is false.
funding_udt_type_script: Option<Script>The type script of the UDT to fund the channel with, an optional parameter.
shutdown_script: Option<Script>The script used to receive the channel balance, an optional parameter, default value is the secp256k1_blake160_sighash_all script corresponding to the configured private key.
commitment_delay_epoch: Option<EpochNumberWithFraction>The delay time for the commitment transaction, must be an EpochNumberWithFraction in u64 format, an optional parameter, default value is 1 epoch, which is 4 hours.
commitment_fee_rate: Option<u64>The fee rate for the commitment transaction, an optional parameter.
funding_fee_rate: Option<u64>The fee rate for the funding transaction, an optional parameter.
tlc_expiry_delta: Option<u64>The expiry delta to forward a tlc, in milliseconds, default to 4 hours, which is 4 * 60 * 60 * 1000 milliseconds
Expect it >= 2/3 commitment_delay_epoch.
This parameter can be updated with rpc update_channel later.
tlc_min_value: Option<u128>The minimum value for a TLC our side can send,
an optional parameter, default is 0, which means we can send any TLC is larger than 0.
This parameter can be updated with rpc update_channel later.
tlc_fee_proportional_millionths: Option<u128>The fee proportional millionths for a TLC, proportional to the amount of the forwarded tlc.
The unit is millionths of the amount. default is 1000 which means 0.1%.
This parameter can be updated with rpc update_channel later.
Not that, we use outbound channel to calculate the fee for TLC forwarding. For example,
if we have a path A -> B -> C, then the fee B requires for TLC forwarding, is calculated
the channel configuration of B and C, not A and B.
max_tlc_value_in_flight: Option<u128>The maximum total value of in-flight TLCs our side will accept from the peer, an optional parameter. This parameter can not be updated after channel is opened.
max_tlc_number_in_flight: Option<u64>The maximum number of in-flight TLCs our side will accept from the peer, an optional parameter, default is 125 This parameter can not be updated after channel is opened.
Trait Implementations§
Source§impl Debug for OpenChannelParams
impl Debug for OpenChannelParams
Source§impl<'de> Deserialize<'de> for OpenChannelParams
impl<'de> Deserialize<'de> for OpenChannelParams
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for OpenChannelParams
impl JsonSchema for OpenChannelParams
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more