huginn_callisto_network_agent 0.1.2 → 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/lib/huginn_callisto_network_agent/callisto_network_agent.rb +11 -12
- 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: d058f981b8a16d044cfa1d71946599cb529b9d9b428b69a87daf240a8e6e10b3
|
4
|
+
data.tar.gz: 1edd0b7377275a447051465ce42a65b61aa0720475dd708f73f0f431bcfbdd9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a28c965d12b063197abb1415e2641999d8c630667cf1245cf5cd8ddc8a15b440f4ccb8453e2ee5e587d0f02274f7cdd03ae20aa48b3eee5092c230cd82dbb567
|
7
|
+
data.tar.gz: 9f09fbd78f53aa29c85c0a8d96f123c461a2fe2f745f7776041c6a6e330653af194ca1976e740d5484dbfc5655296a87ab5dd467ff8f40883c251b0262eabfa1
|
@@ -69,8 +69,8 @@ module Agents
|
|
69
69
|
form_configurable :round, type: :string
|
70
70
|
form_configurable :wallet_dest, type: :string
|
71
71
|
form_configurable :filter_for_method_id, type: :string
|
72
|
-
form_configurable :first_block, type: :
|
73
|
-
form_configurable :last_block, type: :
|
72
|
+
form_configurable :first_block, type: :string
|
73
|
+
form_configurable :last_block, type: :string
|
74
74
|
def validate_options
|
75
75
|
errors.add(:base, "type has invalid value: should be 'get_balance' 'net_peerCount' 'net_version' 'eth_protocolVersion' 'eth_gasPrice' 'eth_getTransactionCount' 'stake_reward_clo' 'get_tokens_balance' 'eth_getBlockByNumber' 'soy_farming_soy_clo_pending_rewards' 'soy_farming_soy_cloe_pending_rewards' 'stake_reward_soy' 'soy_farming_soy_btt_pending_rewards' 'soy_cs_pending_rewards' 'clo_sendtx' 'get_tx_by_address_with_filter' 'start_cs_clo' 'withdraw_cs_clo' 'get_tx_stats'") if interpolated['type'].present? && !%w(get_balance net_peerCount net_version eth_protocolVersion eth_gasPrice eth_getTransactionCount stake_reward_clo get_tokens_balance eth_getBlockByNumber soy_farming_soy_clo_pending_rewards soy_farming_soy_cloe_pending_rewards stake_reward_soy soy_farming_soy_btt_pending_rewards soy_cs_pending_rewards clo_sendtx get_tx_by_address_with_filter start_cs_clo withdraw_cs_clo get_tx_stats).include?(interpolated['type'])
|
76
76
|
|
@@ -143,8 +143,8 @@ module Agents
|
|
143
143
|
private
|
144
144
|
|
145
145
|
def to_hex(value, length = 64, with_0x = false)
|
146
|
-
log value
|
147
|
-
log value.class
|
146
|
+
# log value
|
147
|
+
# log value.class
|
148
148
|
hex = value.to_s(16)
|
149
149
|
hex = hex.rjust(length, '0')
|
150
150
|
hex = hex.sub(/^0x/, '') unless with_0x
|
@@ -154,9 +154,8 @@ module Agents
|
|
154
154
|
|
155
155
|
def log_curl_output(code,body)
|
156
156
|
|
157
|
-
log "request status : #{code}"
|
158
|
-
|
159
157
|
if interpolated['debug'] == 'true'
|
158
|
+
log "request status : #{code}"
|
160
159
|
log "body"
|
161
160
|
log body
|
162
161
|
end
|
@@ -205,8 +204,8 @@ module Agents
|
|
205
204
|
end
|
206
205
|
|
207
206
|
def percentage(number, total)
|
208
|
-
log number
|
209
|
-
log total
|
207
|
+
# log number
|
208
|
+
# log total
|
210
209
|
(number/total.to_f*100).round(2)
|
211
210
|
end
|
212
211
|
|
@@ -251,12 +250,12 @@ module Agents
|
|
251
250
|
top_tx = most_common_from(tx_list)
|
252
251
|
top_count = tx_list.count { |hash| hash['from'] == top_tx }
|
253
252
|
miners_count = tx_list.select { |hash| all_miners.include?(hash['from']) }
|
254
|
-
log "miners_count #{miners_count.count}"
|
253
|
+
# log "miners_count #{miners_count.count}"
|
255
254
|
shitty_count = tx_list.select { |hash| shitty_wallets.include?(hash['from']) }
|
256
|
-
log "shitty_count #{shitty_count.count}"
|
255
|
+
# log "shitty_count #{shitty_count.count}"
|
257
256
|
active = tx_list.map { |p| p['from'] }.uniq.count
|
258
|
-
log "top_count : #{top_count}"
|
259
|
-
log "total : #{tx_list.count}"
|
257
|
+
# log "top_count : #{top_count}"
|
258
|
+
# log "total : #{tx_list.count}"
|
260
259
|
create_event :payload => { 'total_tx' => "#{tx_list.count}", 'total_active' => "#{active}", 'burnt_clo' => "#{burnt_ether}", 'top_wallet': {'address' => "#{top_tx}", 'percentage' => "#{percentage(top_count.to_i,tx_list.count.to_i)}"}, 'shitty': {'address': 'shitty', 'shitty_percentage' => "#{percentage(shitty_count.count,tx_list.count.to_i)}"}, 'miners': {'address': "miners", 'percentage' => "#{percentage(miners_count.count,tx_list.count.to_i)}"}}
|
261
260
|
|
262
261
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: huginn_callisto_network_agent
|
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
|
- Nicolas Germain
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-10-
|
11
|
+
date: 2023-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|