cns 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of cns might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cc5b551cbe1640989e78c17c34c848e288c2e4f4362728b80f1f66b105b37330
4
- data.tar.gz: 2dc4fa72a53d44b8414e22c5e823de2536acfdf2d44ba4f91ab13819264db712
3
+ metadata.gz: 8e61b3461245de25a2e73914ac9e8afcfff01bc0598c679a41e4d4654f0a9ba9
4
+ data.tar.gz: e5265de933fd944aef41c0a30e00c53a761b543d6f262c1e19dbf0a7fc0983da
5
5
  SHA512:
6
- metadata.gz: 338cefa7800ece67c7b846a14b14aae3613cf510362a68fb41c3684216c7cc09108ca5386f94b423731435787c2de5c6bca8318ff30ff8b9ff860c76dec52f44
7
- data.tar.gz: 9541c7a135edfb7a272b3118083714c4629b5ef46b065db710f32c41791f9385a3b75188521b123db6a699605b00ec3c27de71b9cdfaf8f398f70e3419ad7c70
6
+ metadata.gz: c7327a29d73c059f50591553f942eaab9de060fe48d693c4e1623dab3c2886b785c5200d23f5b22ab1e55946e95a230abc968c00a917effb17af1de0b81a75d9
7
+ data.tar.gz: f4ae7e7b6be23c67ebe65a653a36af33154ad232e27d4358dced5638b2898b0e0bf2f122026d7f36445fdb48a469fbce4f495c98fdba7414b9490608ccfebdc7
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cns (0.1.8)
4
+ cns (0.1.9)
5
5
  curb
6
6
  faraday
7
7
  google-cloud-bigquery
@@ -12,7 +12,7 @@ module Cns
12
12
  def data_bc(uri)
13
13
  res = JSON.parse(conn_bc.get(uri).body, symbolize_names: true)[:data] || []
14
14
  # calls are rate limited to 10 requests/minute/IP
15
- sleep(1.5)
15
+ sleep(3)
16
16
  res.is_a?(Array) ? res : [res]
17
17
  rescue StandardError
18
18
  []
@@ -55,38 +55,38 @@ module Cns
55
55
 
56
56
  # insere transacoes exchange kraken novas nas tabelas ust (trades), usl (ledger)
57
57
  def processa_us
58
- puts(format("%<n>2i TRADES KRAKEN INSERIDAS #{BD}.ust", n: apius.trades.empty? ? 0 : dml(ust_ins)))
59
- puts(format("%<n>2i LEDGER KRAKEN INSERIDAS #{BD}.usl", n: apius.ledger.empty? ? 0 : dml(usl_ins)))
58
+ puts(format("%<n>4i TRADES KRAKEN INSERIDAS #{BD}.ust", n: apius.trades.empty? ? 0 : dml(ust_ins)))
59
+ puts(format("%<n>4i LEDGER KRAKEN INSERIDAS #{BD}.usl", n: apius.ledger.empty? ? 0 : dml(usl_ins)))
60
60
  end
61
61
 
62
62
  # insere transacoes exchange bitcoinde novas nas tabelas det (trades), del (ledger)
63
63
  def processa_de
64
- puts(format("%<n>2i TRADES BITCOINDE INSERIDAS #{BD}.det", n: apide.trades.empty? ? 0 : dml(det_ins)))
65
- puts(format("%<n>2i LEDGER BITCOINDE INSERIDAS #{BD}.del", n: apide.ledger.empty? ? 0 : dml(del_ins)))
64
+ puts(format("%<n>4i TRADES BITCOINDE INSERIDAS #{BD}.det", n: apide.trades.empty? ? 0 : dml(det_ins)))
65
+ puts(format("%<n>4i LEDGER BITCOINDE INSERIDAS #{BD}.del", n: apide.ledger.empty? ? 0 : dml(del_ins)))
66
66
  end
67
67
 
68
68
  # insere transacoes exchange paymium/therock novas na tabela fr/mt (ledger)
69
69
  def processa_frmt
70
- puts(format("%<n>2i LEDGER PAYMIUM INSERIDAS #{BD}.fr", n: apifr.ledger.empty? ? 0 : dml(frl_ins)))
71
- puts(format("%<n>2i LEDGER THEROCK INSERIDAS #{BD}.mt", n: apimt.ledger.empty? ? 0 : dml(mtl_ins)))
70
+ puts(format("%<n>4i LEDGER PAYMIUM INSERIDAS #{BD}.fr", n: apifr.ledger.empty? ? 0 : dml(frl_ins)))
71
+ puts(format("%<n>4i LEDGER THEROCK INSERIDAS #{BD}.mt", n: apimt.ledger.empty? ? 0 : dml(mtl_ins)))
72
72
  end
73
73
 
74
74
  # insere transacoes blockchain novas nas tabelas etht (norml), ethk (token)
75
75
  def processa_eth
76
- puts(format("%<n>2i TRANSACOES ETH INSERIDAS #{BD}.etht", n: apies.novtx.empty? ? 0 : dml(etht_ins)))
77
- puts(format("%<n>2i TOKEN EVENTS ETH INSERIDAS #{BD}.ethk", n: apies.novkx.empty? ? 0 : dml(ethk_ins)))
76
+ puts(format("%<n>4i TRANSACOES ETH INSERIDAS #{BD}.etht", n: apies.novtx.empty? ? 0 : dml(etht_ins)))
77
+ puts(format("%<n>4i TOKEN EVENTS ETH INSERIDAS #{BD}.ethk", n: apies.novkx.empty? ? 0 : dml(ethk_ins)))
78
78
  end
79
79
 
80
80
  # insere transacoes blockchain novas na tabela eos
81
81
  def processa_eos
82
- puts(format("%<n>2i TRANSACOES EOS INSERIDAS #{BD}.eos ", n: apigm.novax.empty? ? 0 : dml(eost_ins)))
82
+ puts(format("%<n>4i TRANSACOES EOS INSERIDAS #{BD}.eos ", n: apigm.novax.empty? ? 0 : dml(eost_ins)))
83
83
  end
84
84
 
85
85
  # insere historico sados novos na tabela eth2bh
86
86
  def processa_bc
87
- # puts(format("%<n>2i ATTESTATIONS INSERIDAS #{BD}.eth2at", n: apibc.novtx.empty? ? 0 : dml(eth2at_ins)))
88
- # puts(format("%<n>2i PROPOSALS INSERIDAS #{BD}.eth2pr", n: apibc.novkx.empty? ? 0 : dml(eth2pr_ins)))
89
- puts(format("%<n>2i BALANCES INSERIDOS #{BD}.eth2bh", n: apibc.nov.empty? ? 0 : dml(eth2bh_ins)))
87
+ # puts(format("%<n>4i ATTESTATIONS INSERIDAS #{BD}.eth2at", n: apibc.novtx.empty? ? 0 : dml(eth2at_ins)))
88
+ # puts(format("%<n>4i PROPOSALS INSERIDAS #{BD}.eth2pr", n: apibc.novkx.empty? ? 0 : dml(eth2pr_ins)))
89
+ puts(format("%<n>4i BALANCES INSERIDOS #{BD}.eth2bh", n: apibc.nov.empty? ? 0 : dml(eth2bh_ins)))
90
90
  end
91
91
 
92
92
  # cria job bigquery & verifica execucao
@@ -15,7 +15,7 @@ module Cns
15
15
  # @return [String] comando insert SQL formatado eth2bh
16
16
  def eth2bh_ins
17
17
  "insert #{BD}.eth2bh(balance,effectivebalance,epoch,validatorindex" \
18
- ") VALUES#{apibc.nov[0..900].map { |obj| eth2bh_1val(obj) }.join(',')}"
18
+ ") VALUES#{apibc.nov[0..1000].map { |obj| eth2bh_1val(obj) }.join(',')}"
19
19
  end
20
20
 
21
21
  # @return [Etherscan] API blockchain ETH
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cns
4
- VERSION = '0.1.8'
4
+ VERSION = '0.1.9'
5
5
  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.1.8
4
+ version: 0.1.9
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: 2021-01-07 00:00:00.000000000 Z
11
+ date: 2021-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler