Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bumi/lightning.ws-ruby
Example ruby client for the lightning.ws webservices
https://github.com/bumi/lightning.ws-ruby
Last synced: 4 days ago
JSON representation
Example ruby client for the lightning.ws webservices
- Host: GitHub
- URL: https://github.com/bumi/lightning.ws-ruby
- Owner: bumi
- Created: 2018-11-23T20:31:39.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-20T15:21:54.000Z (almost 2 years ago)
- Last Synced: 2023-04-10T23:12:49.820Z (over 1 year ago)
- Language: Ruby
- Size: 8.79 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ruby client for lightning.ws services
This is an example of a ruby client for webservices provided by [lightning.ws](lightning.ws)
It uses the [lightning faraday middleware](https://github.com/bumi/faraday_ln_paywall/) to handle the lightning payments.
## Usage
See use.rb example.
you can run the example by:
$ bundle install # install dependencies
$ ruby use.rbTo configure your lightning node set environment variables:
$ MACAROON_PATH=/path/admin.macaroon CREDENTIALS_PATH=/path/tls.cert ADDRESS=host:port ruby use.rb
```ruby
require "./lightning_ws"client = LightningWs.new({
max_amount: 1000,
macaroon_path: ENV['MACAROON_PATH'],
credentials_path: ENV['CREDENTIALS_PATH'],
address: ENV['ADDRESS']
})puts client.translate("hallo welt")
puts client.ocr("https://upload.wikimedia.org/wikipedia/commons/thumb/e/ee/Blocksatz-Beispiel_deutsch%2C_German_text_sample_with_fully_justified_text.svg/1500px-Blocksatz-Beispiel_deutsch%2C_German_text_sample_with_fully_justified_text.svg.png")```