added documentation

Signed-off-by: michael1011 <michael101101@me.com>
This commit is contained in:
michael1011 2018-03-29 17:51:01 +02:00
parent eb1d19e8b1
commit 91b11e4be5
5 changed files with 36 additions and 10 deletions

View File

@ -1,2 +1,31 @@
# LightningTip
Get tips via the Lightning Network
A simple way to accept tips via the Lightning Network on your website.
<img src="https://i.imgur.com/ghPu0SR.gif" width="240">
## How to install
To get all necessary files for setting up LightningTip you can either [download a prebuilt version](https://github.com/michael1011/lightningtip/releases) or [compile from source](#how-to-install).
LightningTip is using [LND](https://github.com/lightningnetwork/lnd) as backend. Please make sure it is installed and fully synced before you install LightningTip.
The default config file location is `lightningTip.conf` in the directory you are executing LightningTip in. The [sample config](https://github.com/michael1011/lightningtip/blob/master/sample-lightningTip.conf) contains everything you need to know about the configuration. To use a custom config file location use the flag `--config filename`.
Embedding LightningTip is also quite easy. Upload all files excluding `lightningTip.html` to your webserver. Copy the contents of the head tag of the before mentioned HTML file into a HTML you want to show LightningTip in. The div below the head tag is LightningTip itself. Paste it into any place in the already edited HTML file on you server.
If you are not running LightningTip on the same domain or IP address as your werbserver or not on port 8081 change the variable `requestUrl` (which is in the first line) in the file `lightningTip.js` accordingly.
That's it! The only two things you need to take care about is keeping the LND node online and making sure that your channels are funded well enough to receive tips. LightningTip will take care of everything else.
## How to build
First of all make sure [Golang](https://golang.org/) and [Dep](https://github.com/golang/dep) are both correctly installed. Golang version 1.10 or newer is recommended.
```
go get github.com/michael1011/lightningtip.git
dep ensure
go install
```

View File

@ -1,3 +1,3 @@
gofmt -s -w .
go build -o lightningTip.
go build -o lightningTip

View File

@ -1,5 +1,4 @@
//var requestUrl = window.location.protocol + "//" + window.location.hostname + ":8081/";
var requestUrl = "http://localhost:8081/";
var requestUrl = window.location.protocol + "//" + window.location.hostname + ":8081/";
// To prohibit multiple requests at the same time
var running = false;
@ -18,7 +17,6 @@ function getInvoice() {
var tipValue = document.getElementById("lightningTipAmount");
if (tipValue.value !== "") {
if (!isNaN(tipValue.value)) {
var data = JSON.stringify({"Amount": parseInt(tipValue.value), "Message": document.getElementById("lightningTipMessage").value});

View File

@ -54,7 +54,6 @@ type errorResponse struct {
Error string
}
// TODO: write how to build and install in README
// TODO: add option to show URI of Lightning node
func main() {
initLog()

View File

@ -1,12 +1,12 @@
[Application Options]
# Location of the log file
logfile = lightningTip.log
# logfile = lightningTip.log
# Log level for log file and console. Options are: debug, info, warning and error
loglevel = info
# loglevel = info
# Host for the REST interface of LightningTip
resthost = localhost:8081
# resthost = localhost:8081
# The domain (or IP address) you are using LightningTip from
# Only needed if LightningTip is running on another port than the web server and no reverse proxy is used
@ -15,7 +15,7 @@ resthost = localhost:8081
# accessdomain =
# After how many seconds invoices should expire
tipexpiry = 3600
# tipexpiry = 3600
[LND]
# LightningTip should work out of the box with LND