cardano-up 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/cardano-up +6 -4
- data/lib/cardano-up/tail.rb +3 -2
- data/lib/cardano-up/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26ea3b59240dc0a0c2eca674edf54ba66fba8e8bb276f40f1f3aecd4b1e13c8b
|
4
|
+
data.tar.gz: 0f278da8551b805df01aa2c714fdfbba1272b5af3edea3e8101821a1cdae3263
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c4f5f88c56f90fcc20e3b78bc994a2067760d70698f2bca1a4619d4b6fc809433fe6404776a0962c8be62b77ab08a41b1348589427a74631b79043c56f10bf5
|
7
|
+
data.tar.gz: 6796a8d67a93cbb5b0b99a2d8b0c97f9416baefb67e911b50b46ccd6a0c3177f68dac2039a58210460e47668099f7814a6bc2cc68898d8f5b3edcaba2f59c850
|
data/bin/cardano-up
CHANGED
@@ -14,7 +14,7 @@ doc = <<~DOCOPT
|
|
14
14
|
#{File.basename(__FILE__)} ls
|
15
15
|
#{File.basename(__FILE__)} config [--set-default] [--bindir <path>] [--configdir <path>] [--logdir <path>] [--statedir <path>]
|
16
16
|
#{File.basename(__FILE__)} <env> [(node|wallet)] [(up|down|ping)] [--port <port>] [--session <name>]
|
17
|
-
#{File.basename(__FILE__)} <env> (node|wallet) tail [--session <name>]
|
17
|
+
#{File.basename(__FILE__)} <env> (node|wallet) tail [--lines <num_lines>] [--session <name>]
|
18
18
|
#{File.basename(__FILE__)} -v | --version
|
19
19
|
#{File.basename(__FILE__)} -e | --examples
|
20
20
|
#{File.basename(__FILE__)} -h | --help
|
@@ -29,6 +29,7 @@ doc = <<~DOCOPT
|
|
29
29
|
ones from latest release.
|
30
30
|
down Stop particular service.
|
31
31
|
tail Follow logs for particular service.
|
32
|
+
-n --lines <num_lines> Number of lines to show from the end of the log file. [default: 10]
|
32
33
|
ping Ping service to check its status.
|
33
34
|
ls List sessions.
|
34
35
|
-p --port <port> Specify wallet port. [default: 8090]
|
@@ -122,7 +123,7 @@ Check health of node and wallet on mainnet:
|
|
122
123
|
Monitor mainnet wallet and node logs (Ctrl + c to stop):
|
123
124
|
|
124
125
|
$ #{File.basename(__FILE__)} mainnet node tail
|
125
|
-
$ #{File.basename(__FILE__)} mainnet wallet tail
|
126
|
+
$ #{File.basename(__FILE__)} mainnet wallet tail -n 100
|
126
127
|
|
127
128
|
Stop preprod node:
|
128
129
|
|
@@ -316,14 +317,15 @@ Stop mainnet node and wallet:
|
|
316
317
|
elsif o['tail'] == true
|
317
318
|
env = o['<env>']
|
318
319
|
session_name = o['--session']
|
320
|
+
lines = o['--lines'].to_i
|
319
321
|
begin
|
320
322
|
log_dir = File.join(CardanoUp.config[:log_dir], session_name, env)
|
321
323
|
if o['node']
|
322
324
|
log_file = File.join(log_dir, 'node.log')
|
323
|
-
CardanoUp::Tail.tail(log_file)
|
325
|
+
CardanoUp::Tail.tail(log_file, lines)
|
324
326
|
elsif o['wallet']
|
325
327
|
log_file = File.join(log_dir, 'wallet.log')
|
326
|
-
CardanoUp::Tail.tail(log_file)
|
328
|
+
CardanoUp::Tail.tail(log_file, lines)
|
327
329
|
end
|
328
330
|
rescue CardanoUp::EnvNotSupportedError => e
|
329
331
|
warn(e.message)
|
data/lib/cardano-up/tail.rb
CHANGED
@@ -3,11 +3,12 @@
|
|
3
3
|
module CardanoUp
|
4
4
|
# Tail log file
|
5
5
|
module Tail
|
6
|
-
def self.tail(file_path)
|
6
|
+
def self.tail(file_path, lines = nil)
|
7
|
+
lines_back = lines || 10
|
7
8
|
File.open(file_path) do |log|
|
8
9
|
log.extend(File::Tail)
|
9
10
|
log.interval
|
10
|
-
log.backward(
|
11
|
+
log.backward(lines_back.to_i)
|
11
12
|
log.tail { |line| warn line }
|
12
13
|
end
|
13
14
|
end
|
data/lib/cardano-up/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cardano-up
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Stachyra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: docopt
|