Skip to content

Instantly share code, notes, and snippets.

Created February 15, 2018 08:53
Show Gist options
  • Save anonymous/29378c4be6f383dd45ea342c49a186fe to your computer and use it in GitHub Desktop.
Save anonymous/29378c4be6f383dd45ea342c49a186fe to your computer and use it in GitHub Desktop.
require "grpc"
require "json"
require "helloworld_services_pb"
class LightningRPCServer < Lnservice::Lnd::Service
# get_wallet_balance implements the SayHello rpc method.
def get_wallet_balance(wallet_req, _unused_call)
walletbalance = JSON.parse(`/home/user/.go/bin/lncli walletbalance`)
puts walletbalance
Lnservice::WalletBalanceReply.new(wallet_balance: walletbalance)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment