Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit 10fb35c

Browse files
Implement CLI logs only
1 parent 8017441 commit 10fb35c

File tree

5 files changed

+93
-1
lines changed

5 files changed

+93
-1
lines changed

src/action/nav.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class NavAction {
113113
}
114114

115115
goCLI() {
116-
// this._store.route = 'CLI';
116+
this._store.route = 'CLI';
117117
}
118118

119119
goCreateChannel() {

src/component/style.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export const color = {
3030
notifyLight: 'rgba(255,255,255,0.5)',
3131
seedBorder: 'rgba(151,151,151,0.26)',
3232
seedBackground: 'rgba(130,129,129,0.09)',
33+
cliBackground: '#171D2C',
3334
};
3435

3536
export const font = {

src/view/cli.js

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import React from 'react';
2+
import { StyleSheet } from 'react-native';
3+
import PropTypes from 'prop-types';
4+
import Background from '../component/background';
5+
import MainContent from '../component/main-content';
6+
import { Header, Title } from '../component/header';
7+
import Text from '../component/text';
8+
import { Button, BackButton } from '../component/button';
9+
import { color, font } from '../component/style';
10+
11+
//
12+
// CLI View
13+
//
14+
15+
const styles = StyleSheet.create({
16+
content: {
17+
alignItems: 'flex-start',
18+
paddingBottom: 30,
19+
paddingLeft: 50,
20+
paddingRight: 50,
21+
},
22+
list: {
23+
flex: 1,
24+
justifyContent: 'center',
25+
width: 400,
26+
},
27+
});
28+
29+
const CLIView = ({ store, nav }) => (
30+
<Background color={color.blackDark} style={styles.wrapper}>
31+
<Header separator>
32+
<BackButton onPress={() => nav.goSettings()} />
33+
<Title title="CLI" />
34+
<Button disabled onPress={() => {}} />
35+
</Header>
36+
<Background color={color.cliBackground}>
37+
<MainContent style={styles.content}>
38+
{store.logs.map((log, i) => <LogItem text={log} key={i} />)}
39+
</MainContent>
40+
</Background>
41+
</Background>
42+
);
43+
44+
CLIView.propTypes = {
45+
store: PropTypes.object.isRequired,
46+
nav: PropTypes.object.isRequired,
47+
};
48+
49+
const iStyles = StyleSheet.create({
50+
text: {
51+
textAlign: 'left',
52+
lineHeight: 34,
53+
fontSize: font.sizeM,
54+
},
55+
});
56+
57+
const LogItem = ({ text }) => <Text style={iStyles.text}>{text}</Text>;
58+
59+
LogItem.propTypes = {
60+
text: PropTypes.string,
61+
};
62+
63+
export default CLIView;

src/view/main.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import Setting from './setting';
3030
import SettingUnit from './setting-unit';
3131
import SettingFiat from './setting-fiat';
3232
import Notification from './notification';
33+
import CLI from './cli';
3334
import TransactionDetail from './transaction-detail';
3435
import {
3536
nav,
@@ -85,6 +86,7 @@ class MainView extends Component {
8586
<SettingFiat store={store} nav={nav} setting={setting} />
8687
)}
8788
{route === 'Notifications' && <Notification store={store} nav={nav} />}
89+
{route === 'CLI' && <CLI store={store} nav={nav} />}
8890
{route === 'Pay' && (
8991
<Payment store={store} payment={payment} nav={nav} />
9092
)}

stories/screen.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import Transaction from '../src/view/transaction';
1919
import Setting from '../src/view/setting';
2020
import SettingUnit from '../src/view/setting-unit';
2121
import SettingFiat from '../src/view/setting-fiat';
22+
import CLI from '../src/view/cli';
2223
import Notification from '../src/view/notification';
2324
import TransactionDetail from '../src/view/transaction-detail';
2425
import Channel from '../src/view/channel';
@@ -111,6 +112,7 @@ storiesOf('Screens', module)
111112
<SettingFiat store={store} nav={nav} setting={setting} />
112113
))
113114
.add('Notifications', () => <Notification store={store} nav={nav} />)
115+
.add('CLI', () => <CLI store={store} nav={nav} />)
114116
.add('Transactions', () => (
115117
<Transaction store={store} transaction={transaction} nav={nav} />
116118
))
@@ -244,3 +246,27 @@ store.seedMnemonic = [
244246
'quit',
245247
'cashew',
246248
];
249+
store.logs = [
250+
'[14:00:24.995] [info] Using lnd in path lnd',
251+
'Checking for update',
252+
'[14:00:25.047] [info] lnd: 2018-06-28 14:00:25.039 [WRN] LTND: open /home/valentine/.config/lightning-app/lnd/lnd.conf: no such file or directory',
253+
'2018-06-28 14:00:25.039 [INF] LTND: Version 0.4.2-beta commit=884c51dfdc85284ba8d063c4547d2b5665eba010',
254+
'2018-06-28 14:00:25.039 [INF] LTND: Active chain: Bitcoin (network=testnet)',
255+
'2018-06-28 14:00:25.039 [INF] CHDB: Checking for schema update: latest_version=1, db_version=1',
256+
'[14:00:25.170] [info] lnd: 2018-06-28 14:00:25.055 [INF] RPCS: password RPC server listening on 127.0.0.1:10009',
257+
'2018-06-28 14:00:25.055 [INF] RPCS: password gRPC proxy started at 127.0.0.1:8080',
258+
'2018-06-28 14:00:25.055 [INF] LTND: Waiting for wallet encryption password. Use `lncli create` to create a wallet, `lncli unlock` to unlock an existing wallet, or `lncli changepassword` to change the password of an existing wallet and unlock it.',
259+
'[14:00:25.541] [info] Loaded initial state',
260+
'[14:00:25.557] [info] GRPC unlockerReady',
261+
'Found version 0.2.0-prealpha.9 (url: Lightning-linux-x86_64v0.2.0-prealpha.9.AppImage)',
262+
'Downloading update from Lightning-linux-x86_64v0.2.0-prealpha.9.AppImage',
263+
'No cached update available',
264+
'File has 2893 changed blocks',
265+
'Full: 106,265.24 KB, To download: 59,575.39 KB (56%)',
266+
'Differential download: https://github.com/lightninglabs/lightning-app/releases/download/v0.2.0-prealpha.9/Lightning-linux-x86_64v0.2.0-prealpha.9.AppImage',
267+
'Redirect to https://github-production-release-asset-2e65be.s3.amazonaws.com/76898197/428914b4-7561-11e8-8826-08fde1bd29aa',
268+
'[14:00:33.730] [info] lnd: 2018-06-28 14:00:33.730 [INF] LNWL: Opened wallet',
269+
'[14:00:33.731] [info] lnd: 2018-06-28 14:00:33.730 [INF] LTND: Primary chain is set to: bitcoin',
270+
'[14:00:33.879] [info] lnd: 2018-06-28 14:00:33.879 [INF] BTCN: Loaded 1032 addresses from file /home/valentine/.config/lightning-app/lnd/data/chain/bitcoin/testnet/peers.json',
271+
'[14:00:33.893] [info] lnd: 2018-06-28 14:00:33.892 [INF] CMGR: DNS discovery failed on seed x49.seed.tbtc.petertodd.org: lookup x49.seed.tbtc.petertodd.org: No address associated with hostname',
272+
];

0 commit comments

Comments
 (0)