Skip to content

Commit 08dae0c

Browse files
committed
feat: add simln support to eclair
1 parent ab1b575 commit 08dae0c

File tree

4 files changed

+23
-6
lines changed

4 files changed

+23
-6
lines changed

src/components/designer/default/AddSimulationModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ const AddSimulationModal: React.FC<Props> = ({ network }) => {
105105
name="source"
106106
label={l('source')}
107107
nodeStatus={Status.Started}
108-
implementation={'LND'}
108+
implementation={['LND', 'eclair']}
109109
nodes={nodes}
110110
/>
111111
</Col>
@@ -115,7 +115,7 @@ const AddSimulationModal: React.FC<Props> = ({ network }) => {
115115
name="destination"
116116
label={l('destination')}
117117
nodeStatus={Status.Started}
118-
implementation={'LND'}
118+
implementation={['LND', 'eclair']}
119119
nodes={nodes}
120120
/>
121121
</Col>

src/lib/docker/dockerService.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
SimulationNodeConfig,
2828
} from 'types';
2929
import { legacyDataPath, networksPath, nodePath } from 'utils/config';
30-
import { APP_VERSION, dockerConfigs } from 'utils/constants';
30+
import { APP_VERSION, dockerConfigs, eclairCredentials } from 'utils/constants';
3131
import { exists, read, renameFile, rm, write } from 'utils/files';
3232
import { migrateNetworksFile } from 'utils/migrations';
3333
import { isLinux, isMac } from 'utils/system';
@@ -434,6 +434,16 @@ class DockerService implements DockerLibrary {
434434
};
435435
break;
436436

437+
case 'eclair':
438+
const eclair = node as EclairNode;
439+
simNode = {
440+
id: eclair.name,
441+
base_url: `http://host.docker.internal:${eclair.ports.rest}`,
442+
api_username: '',
443+
api_password: eclairCredentials.pass,
444+
};
445+
break;
446+
437447
default:
438448
throw new Error(`unsupported node implementation: ${node.implementation}`);
439449
}

src/types/index.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,13 @@ export interface SimulationConfig {
323323

324324
export interface SimulationNodeConfig {
325325
id: string;
326-
address: string;
327-
macaroon: string;
326+
address?: string;
327+
base_url?: string;
328+
macaroon?: string;
328329
cert?: string;
330+
ca_cert?: string;
331+
client_cert?: string;
332+
client_key?: string;
333+
api_username?: string;
334+
api_password?: string;
329335
}

src/utils/constants.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ export const dockerConfigs: Record<NodeImplementationWithSimln, DockerConfig> =
191191
'--on-chain-fees.feerate-tolerance.ratio-high=10000.0',
192192
'--channel.max-htlc-value-in-flight-percent=100',
193193
'--channel.max-htlc-value-in-flight-msat=5000000000000', // 50 BTC in msats
194+
'--features.keysend=optional',
194195
].join('\n '),
195196
// if vars are modified, also update composeFile.ts & the i18n strings for cmps.nodes.CommandVariables
196197
variables: ['name', 'eclairPass', 'backendName', 'rpcUser', 'rpcPass'],
@@ -322,7 +323,7 @@ export const dockerConfigs: Record<NodeImplementationWithSimln, DockerConfig> =
322323
},
323324
simln: {
324325
name: 'simln',
325-
imageName: 'bitcoindevproject/simln:0.2.0',
326+
imageName: 'bitcoindevproject/simln:0.2.4',
326327
logo: '',
327328
platforms: ['mac', 'linux', 'windows'],
328329
volumeDirName: 'simln',

0 commit comments

Comments
 (0)