Compare commits
6 Commits
v0.4.0
...
fbf163740a
| Author | SHA1 | Date | |
|---|---|---|---|
| fbf163740a | |||
|
|
1fc1457e97 | ||
| 1f57bbd9c2 | |||
|
2a2793ae44
|
|||
|
8773bf5f9e
|
|||
|
d9970c126a
|
@@ -46,11 +46,11 @@ test:
|
||||
# <<: *AUTHORIZATIONS
|
||||
|
||||
production:
|
||||
host: ldap.kosmos.org
|
||||
port: 636
|
||||
host: ldap.kosmos.local
|
||||
port: 389
|
||||
attribute: cn
|
||||
base: ou=kosmos.org,cn=users,dc=kosmos,dc=org
|
||||
admin_user: <%= Rails.application.credentials.ldap[:username] rescue nil %>
|
||||
admin_password: <%= Rails.application.credentials.ldap[:password] rescue nil %>
|
||||
ssl: simple_tls
|
||||
# ssl: false
|
||||
# <<: *AUTHORIZATIONS
|
||||
|
||||
@@ -5,4 +5,20 @@ namespace :lndhub do
|
||||
CreateLndhubWalletJob.perform_later(user)
|
||||
end
|
||||
end
|
||||
|
||||
desc "List wallet balances"
|
||||
task :balances => :environment do |t, args|
|
||||
sum = 0
|
||||
User.all.each do |user|
|
||||
lndhub = Lndhub.new
|
||||
auth_token = lndhub.authenticate(user)
|
||||
data = lndhub.balance(auth_token)
|
||||
balance = data["BTC"]["AvailableBalance"] rescue nil
|
||||
if balance && balance > 0
|
||||
sum += balance
|
||||
puts "#{user.address}: #{balance} sats"
|
||||
end
|
||||
end
|
||||
puts "--\nSum of user balances: #{sum} sats"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user