lib/cns/bigquery1.rb in cns-0.1.6 vs lib/cns/bigquery1.rb in cns-0.1.8
- old
+ new
@@ -28,28 +28,29 @@
# @see https://cloud.google.com/bigquery/docs/authentication/getting-started
@api = Google::Cloud::Bigquery.new
@ops = pop
end
- # mostra situacao completa entre kraken/bitcoinde/paymium/therock/etherscan/greymass & bigquery
+ # mostra situacao completa entre kraken/bitcoinde/paymium/therock/etherscan/greymass/beaconchain & bigquery
def mostra_tudo
apius.mostra_resumo
apide.mostra_resumo
apifr.mostra_resumo
apimt.mostra_resumo
apies.mostra_resumo
apigm.mostra_resumo
+ apibc.mostra_resumo
end
- # insere (caso existam) transacoes novas kraken/bitcoinde/paymium/therock/etherscan/greymass no bigquery
+ # insere (caso existam) dados novos kraken/bitcoinde/paymium/therock/etherscan/greymass/beaconchain no bigquery
def processa_tudo
processa_us
processa_de
- processa_fr
- processa_mt
+ processa_frmt
processa_eth
processa_eos
+ processa_bc
end
private
# insere transacoes exchange kraken novas nas tabelas ust (trades), usl (ledger)
@@ -62,17 +63,13 @@
def processa_de
puts(format("%<n>2i TRADES BITCOINDE INSERIDAS #{BD}.det", n: apide.trades.empty? ? 0 : dml(det_ins)))
puts(format("%<n>2i LEDGER BITCOINDE INSERIDAS #{BD}.del", n: apide.ledger.empty? ? 0 : dml(del_ins)))
end
- # insere transacoes exchange paymium novas na tabela fr (ledger)
- def processa_fr
+ # insere transacoes exchange paymium/therock novas na tabela fr/mt (ledger)
+ def processa_frmt
puts(format("%<n>2i LEDGER PAYMIUM INSERIDAS #{BD}.fr", n: apifr.ledger.empty? ? 0 : dml(frl_ins)))
- end
-
- # insere transacoes exchange therock novas na tabela mt (ledger)
- def processa_mt
puts(format("%<n>2i LEDGER THEROCK INSERIDAS #{BD}.mt", n: apimt.ledger.empty? ? 0 : dml(mtl_ins)))
end
# insere transacoes blockchain novas nas tabelas etht (norml), ethk (token)
def processa_eth
@@ -81,9 +78,16 @@
end
# insere transacoes blockchain novas na tabela eos
def processa_eos
puts(format("%<n>2i TRANSACOES EOS INSERIDAS #{BD}.eos ", n: apigm.novax.empty? ? 0 : dml(eost_ins)))
+ end
+
+ # insere historico sados novos na tabela eth2bh
+ def processa_bc
+ # puts(format("%<n>2i ATTESTATIONS INSERIDAS #{BD}.eth2at", n: apibc.novtx.empty? ? 0 : dml(eth2at_ins)))
+ # puts(format("%<n>2i PROPOSALS INSERIDAS #{BD}.eth2pr", n: apibc.novkx.empty? ? 0 : dml(eth2pr_ins)))
+ puts(format("%<n>2i BALANCES INSERIDOS #{BD}.eth2bh", n: apibc.nov.empty? ? 0 : dml(eth2bh_ins)))
end
# cria job bigquery & verifica execucao
#
# @param cmd (see sql)