cns 0.4.3 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +5 -5
- data/lib/cns/bigquery.rb +42 -37
- data/lib/cns/version.rb +1 -1
- data/lib/cns.rb +17 -9
- 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: 014ea62e8e58d2b652f5e814f446b9894215f56ffc79399b9d5f15c828c85ff9
|
4
|
+
data.tar.gz: 9bb4dba34b5c53fb5daa9fe84fc6c3a68d2138d4df1ece9bc97a48d5fbee934e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 779ffef3648acbada200479d4f8f0c0fadd64d6323be8729c64903410ce3e1653ee386691832c98048f45ffcde47f8e1f1f9b02ca3aa23a9283e01fe5670780e
|
7
|
+
data.tar.gz: b3c5fb68a478d1342ce4b655ad7495a6fd6917d71fd8ab8bab486f5f0d58d3558f5ca8bba2246531e5736dc3ab5f9078d8dcd340eb760b5a43a7b446eb27e84a
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cns (0.4.
|
4
|
+
cns (0.4.5)
|
5
5
|
curb
|
6
6
|
faraday
|
7
7
|
google-cloud-bigquery
|
@@ -20,12 +20,12 @@ GEM
|
|
20
20
|
curb (1.0.5)
|
21
21
|
declarative (0.0.20)
|
22
22
|
e2mmap (0.1.0)
|
23
|
-
faraday (2.7.
|
23
|
+
faraday (2.7.12)
|
24
24
|
base64
|
25
25
|
faraday-net_http (>= 2.0, < 3.1)
|
26
26
|
ruby2_keywords (>= 0.0.4)
|
27
27
|
faraday-net_http (3.0.2)
|
28
|
-
google-apis-bigquery_v2 (0.
|
28
|
+
google-apis-bigquery_v2 (0.61.0)
|
29
29
|
google-apis-core (>= 0.11.0, < 2.a)
|
30
30
|
google-apis-core (0.11.2)
|
31
31
|
addressable (~> 2.5, >= 2.5.1)
|
@@ -64,14 +64,14 @@ GEM
|
|
64
64
|
kwalify (0.7.2)
|
65
65
|
mini_mime (1.1.5)
|
66
66
|
multi_json (1.15.0)
|
67
|
-
nokogiri (1.15.
|
67
|
+
nokogiri (1.15.5-x86_64-linux)
|
68
68
|
racc (~> 1.4)
|
69
69
|
os (1.1.4)
|
70
70
|
parallel (1.23.0)
|
71
71
|
parser (2.7.2.0)
|
72
72
|
ast (~> 2.4.1)
|
73
73
|
psych (3.3.4)
|
74
|
-
public_suffix (5.0.
|
74
|
+
public_suffix (5.0.4)
|
75
75
|
racc (1.7.3)
|
76
76
|
rainbow (3.1.1)
|
77
77
|
rake (12.3.3)
|
data/lib/cns/bigquery.rb
CHANGED
@@ -47,68 +47,73 @@ module Cns
|
|
47
47
|
apies.mostra_resumo
|
48
48
|
end
|
49
49
|
|
50
|
+
# mostra situacao completa entre etherscan & bigquery
|
51
|
+
def mostra_seth
|
52
|
+
apies.mostra_resumo
|
53
|
+
end
|
54
|
+
|
50
55
|
# insere (caso existam) dados novos kraken/bitcoinde/paymium/therock/etherscan/greymass/beaconchain no bigquery
|
51
56
|
def processa_tudo
|
52
|
-
processa_us
|
53
|
-
processa_de
|
54
|
-
#processa_frmt
|
55
|
-
processa_eth
|
56
|
-
processa_eos
|
57
|
-
#processa_bc
|
57
|
+
puts(Time.now.strftime("%d-%m-%Y %H:%M TRANSACOES ") + processa_us + ", " + processa_de + ", " + processa_eth + ", " + processa_eos)
|
58
58
|
end
|
59
59
|
|
60
|
-
# insere (caso existam) dados novos kraken/etherscan
|
60
|
+
# insere (caso existam) dados novos kraken/etherscan no bigquery
|
61
61
|
def processa_wkrk
|
62
|
-
processa_us
|
63
|
-
processa_eth
|
64
|
-
end
|
65
|
-
|
66
|
-
# insere transacoes blockchain novas nas tabelas etht (norml), ethi (internas), ethp (block), ethw (withdrawals), ethk (token)
|
67
|
-
def processa_eth
|
68
|
-
puts(format("%<n>4i TRANSACOES ETH NORMAIS\tINSERIDAS etht", n: apies.novtx.empty? ? 0 : dml(etht_ins)))
|
69
|
-
puts(format("%<n>4i TRANSACOES ETH INTERNAS\tINSERIDAS ethi", n: apies.novix.empty? ? 0 : dml(ethi_ins)))
|
70
|
-
puts(format("%<n>4i TRANSACOES ETH BLOCK\tINSERIDAS ethp", n: apies.novpx.empty? ? 0 : dml(ethp_ins)))
|
71
|
-
puts(format("%<n>4i TRANSACOES ETH WITHDRAWALS\tINSERIDAS ethw", n: apies.novwx.empty? ? 0 : dml(ethw_ins)))
|
72
|
-
puts(format("%<n>4i TOKENS\tETH\t\tINSERIDAS ethk", n: apies.novkx.empty? ? 0 : dml(ethk_ins)))
|
62
|
+
puts(Time.now.strftime("%d-%m-%Y %H:%M TRANSACOES ") + processa_us + ", " + processa_eth)
|
73
63
|
end
|
74
64
|
|
75
|
-
# insere
|
65
|
+
# insere (caso existam) dados novos etherscan no bigquery
|
76
66
|
def processa_weth
|
77
|
-
|
78
|
-
processa_eth
|
67
|
+
puts(Time.now.strftime("%d-%m-%Y %H:%M TRANSACOES ") + processa_eth)
|
79
68
|
end
|
80
69
|
|
81
70
|
private
|
82
71
|
|
72
|
+
# insere transacoes blockchain novas nas tabelas etht (norml), ethi (internas), ethp (block), ethw (withdrawals), ethk (token)
|
73
|
+
def processa_eth
|
74
|
+
str = "ETH"
|
75
|
+
str << format(" %<n>i etht", n: dml(etht_ins)) if apies.novtx.count > 0
|
76
|
+
str << format(" %<n>i ethi", n: dml(ethi_ins)) if apies.novix.count > 0
|
77
|
+
str << format(" %<n>i ethp", n: dml(ethp_ins)) if apies.novpx.count > 0
|
78
|
+
str << format(" %<n>i ethw", n: dml(ethw_ins)) if apies.novwx.count > 0
|
79
|
+
str << format(" %<n>i ethk", n: dml(ethk_ins)) if apies.novkx.count > 0
|
80
|
+
str
|
81
|
+
end
|
82
|
+
|
83
83
|
# insere transacoes exchange kraken novas nas tabelas ust (trades), usl (ledger)
|
84
84
|
def processa_us
|
85
|
-
|
86
|
-
|
85
|
+
str = "KRAKEN"
|
86
|
+
str << format(" %<n>i ust", n: dml(ust_ins)) if apius.trades.count > 0
|
87
|
+
str << format(" %<n>i usl", n: dml(usl_ins)) if apius.ledger.count > 0
|
88
|
+
str
|
87
89
|
end
|
88
90
|
|
89
91
|
# insere transacoes exchange bitcoinde novas nas tabelas det (trades), del (ledger)
|
90
92
|
def processa_de
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
# insere transacoes exchange paymium/therock novas na tabela fr/mt (ledger)
|
96
|
-
def processa_frmt
|
97
|
-
puts(format("%<n>4i LEDGER\tPAYMIUM\t\tINSERIDAS fr", n: apifr.ledger.empty? ? 0 : dml(frl_ins)))
|
98
|
-
puts(format("%<n>4i LEDGER\tTHEROCK\t\tINSERIDAS mt", n: apimt.ledger.empty? ? 0 : dml(mtl_ins)))
|
93
|
+
str = "BITCOINDE"
|
94
|
+
str << format(" %<n>i det", n: dml(det_ins)) if apide.trades.count > 0
|
95
|
+
str << format(" %<n>i del", n: dml(del_ins)) if apide.ledger.count > 0
|
96
|
+
str
|
99
97
|
end
|
100
98
|
|
101
99
|
# insere transacoes blockchain novas na tabela eos
|
102
100
|
def processa_eos
|
103
|
-
|
101
|
+
str = "EOS"
|
102
|
+
str << format(" %<n>i eos ", n: dml(eost_ins)) if apigm.novax.count > 0
|
103
|
+
str
|
104
104
|
end
|
105
105
|
|
106
|
+
# insere transacoes exchange paymium/therock novas na tabela fr/mt (ledger)
|
107
|
+
# def processa_frmt
|
108
|
+
# puts(format("%<n>4i LEDGER\tPAYMIUM\t\tINSERIDAS fr", n: apifr.ledger.empty? ? 0 : dml(frl_ins)))
|
109
|
+
# puts(format("%<n>4i LEDGER\tTHEROCK\t\tINSERIDAS mt", n: apimt.ledger.empty? ? 0 : dml(mtl_ins)))
|
110
|
+
# end
|
106
111
|
# insere historico sados novos na tabela eth2bh
|
107
|
-
def processa_bc
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
end
|
112
|
+
# def processa_bc
|
113
|
+
# puts(format("%<n>4i ATTESTATIONS INSERIDAS eth2at", n: apibc.novtx.empty? ? 0 : dml(eth2at_ins)))
|
114
|
+
# puts(format("%<n>4i PROPOSALS INSERIDAS eth2pr", n: apibc.novkx.empty? ? 0 : dml(eth2pr_ins)))
|
115
|
+
# puts(format("%<n>4i BALANCES\tETH2\t\tINSERIDOS eth2bh", n: apibc.nov.empty? ? 0 : dml(eth2bh_ins)))
|
116
|
+
# end
|
112
117
|
|
113
118
|
# cria job bigquery & verifica execucao
|
114
119
|
#
|
data/lib/cns/version.rb
CHANGED
data/lib/cns.rb
CHANGED
@@ -16,6 +16,14 @@ require('cns/version')
|
|
16
16
|
module Cns
|
17
17
|
# classe para carregar/mostrar dados transacoes eth & eos no bigquery
|
18
18
|
class CLI < Thor
|
19
|
+
desc 'seth', 'mostra eth transacoes'
|
20
|
+
option :v, type: :boolean, default: true, desc: 'mostra transacoes'
|
21
|
+
option :t, type: :boolean, default: false, desc: 'mostra transacoes todas ou somente novas'
|
22
|
+
# mostra eth transacoes
|
23
|
+
def seth
|
24
|
+
Bigquery.new(options).mostra_seth
|
25
|
+
end
|
26
|
+
|
19
27
|
desc 'weth', 'carrega transacoes eth no bigquery'
|
20
28
|
option :h, type: :hash, default: {}, desc: 'configuracao ajuste reposicionamento temporal'
|
21
29
|
# carrega transacoes eth no bigquery
|
@@ -23,6 +31,14 @@ module Cns
|
|
23
31
|
Bigquery.new(options).processa_weth
|
24
32
|
end
|
25
33
|
|
34
|
+
desc 'skrk', 'mostra kraken/eth transacoes'
|
35
|
+
option :v, type: :boolean, default: true, desc: 'mostra transacoes'
|
36
|
+
option :t, type: :boolean, default: false, desc: 'mostra transacoes todas ou somente novas'
|
37
|
+
# mostra kraken/eth transacoes
|
38
|
+
def skrk
|
39
|
+
Bigquery.new(options).mostra_skrk
|
40
|
+
end
|
41
|
+
|
26
42
|
desc 'wkrk', 'carrega transacoes kraken/eth no bigquery'
|
27
43
|
option :h, type: :hash, default: {}, desc: 'configuracao ajuste reposicionamento temporal'
|
28
44
|
# carrega transacoes kraken/eth no bigquery
|
@@ -45,14 +61,6 @@ module Cns
|
|
45
61
|
Bigquery.new(options).mostra_tudo
|
46
62
|
end
|
47
63
|
|
48
|
-
|
49
|
-
option :v, type: :boolean, default: true, desc: 'mostra transacoes'
|
50
|
-
option :t, type: :boolean, default: false, desc: 'mostra transacoes todas ou somente novas'
|
51
|
-
# mostra kraken/eth transacoes
|
52
|
-
def skrk
|
53
|
-
Bigquery.new(options).mostra_skrk
|
54
|
-
end
|
55
|
-
|
56
|
-
default_task :skrk
|
64
|
+
default_task :seth
|
57
65
|
end
|
58
66
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hernâni Rodrigues Vaz
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|