cln-plugin: Configuration struct

Represents the "configuration" part of the "init" message during
plugin initialization.

Changelog-Added: cln_plugin: persist cln configuration from init msg
This commit is contained in:
Justin Moon
2022-05-21 10:17:50 -05:00
committed by Christian Decker
parent 318b6e803e
commit 5ec424bc86
2 changed files with 29 additions and 9 deletions

View File

@@ -1,5 +1,4 @@
use crate::options::ConfigOption;
use crate::Configuration;
use serde::de::{self, Deserializer};
use serde::{Deserialize, Serialize};
use serde_json::Value;
@@ -67,6 +66,29 @@ pub(crate) struct InitCall {
pub(crate) configuration: Configuration,
}
#[derive(Clone, Deserialize, Debug)]
pub struct Configuration {
#[serde(rename = "lightning-dir")]
pub lightning_dir: String,
#[serde(rename = "rpc-file")]
pub rpc_file: String,
pub startup: bool,
pub network: String,
pub feature_set: HashMap<String, String>,
pub proxy: ProxyInfo,
#[serde(rename = "torv3-enabled")]
pub torv3_enabled: bool,
pub always_use_proxy: bool,
}
#[derive(Clone, Debug, Deserialize)]
pub struct ProxyInfo {
#[serde(alias = "type")]
pub typ: String,
pub address: String,
pub port: i64,
}
#[derive(Debug)]
pub enum JsonRpc<N, R> {
Request(usize, R),