You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 8, 2024. It is now read-only.
* reorganized docs for 1st iteration
* modified sidebar
* re-add images as part of reorg
* split up PayID CLI doc
* removed PayID CLI tutorial because covered by Verifiable PayID tutorial
* added tutorial for Xpring and PayID based on demo
* updates as suggested by reviewers
Copy file name to clipboardExpand all lines: docs/getting-started.md
+28-13Lines changed: 28 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ title: Getting Started
4
4
sidebar_label: Getting Started
5
5
---
6
6
7
-
PayID is a simple, web-based protocol designed to make it as easy to send someone money as it is to send them an email. This guide walks you through:
7
+
PayID is a simple, web-based protocol designed to make it as easy to send someone money as it is to send them an email. This guide walks you through the following.
8
8
9
9
-[Experiment With the PayID Sandbox](#experiment-with-the-payid-sandbox)
10
10
-[Run a PayID Server](#run-a-payid-server)
@@ -21,13 +21,24 @@ The [PayID Sandbox](https://payid.org/sandbox) lets you experiment with PayID in
21
21
22
22
To use [PayID Sandbox](https://payid.org/sandbox), log in with your Github account and follow the prompts. You can quickly set up a virtual test server, and then create users with simple PayID addresses that map to addresses on various networks such as XRPL, Interledger, BTC, and ETH. Using the provided cURL or Javascript code, you can create, update, and delete users, and get payment information about a PayID address. While the session is running, you can also run operations from your command line.
23
23
24
-
## Set up your own PayID server
24
+
## Run a PayID Server
25
25
26
-
You have several options to set up your own PayID server. See [Deployment Options](intro-deploy). For preliminary development and testing, try deploying locally, with or without Docker.
26
+
To familiarize yourself and experiment with PayID, you can set up a local PayID server. Here is a simple method. For more options, including PayID deployment for production environments, see [Deployment Overview](intro-deploy).
27
+
28
+
1. If you haven't already, install [Docker](https://docks.docker.com/get-docker/) and [Node](https://nodejs.org/en/) on your machine.
29
+
30
+
2. The reference implementation server is available at [https://github.com/payid-org/payid](https://github.com/payid-org/payid). You can download the reference implementation server by cloning the repository at the command line:
3. Go to the `/payid` directory that you just created:
34
+
`cd payid`
35
+
36
+
4. Boot up the PayID HTTP server and a Postgres database to develop against:
37
+
`npm run devEnvUp`
27
38
28
39
## Create a PayID
29
40
30
-
Now that you have a PayID server running, you can create a PayID. If your server was publicly accessible, other people could query your account information from your PayID server.
41
+
Now that you have a PayID server running, you can create a PayID. If your server is publicly accessible, other people could query your account information from your PayID server.
31
42
32
43
To create a PayID, with an [XRP Ledger Testnet account](https://xrpl.org/xrp-testnet-faucet.html), send this request to your server:
33
44
@@ -115,9 +126,21 @@ If you want to clean up the Docker containers, you can run `npm run devDown`.
115
126
116
127
Now that you've set up the basics, [learn more](#learn-more) about PayID and what you can do with it.
117
128
129
+
## Xpring SDK Integration
130
+
131
+
PayID support is integrated into [Xpring SDK](https://github.com/xpring-eng/xpring-sdk).
132
+
133
+
Xpring SDK provides the ability to work with PayID. It provides three language libraries:
These libraries help you connect your application to PayID without having to worry about the specifics of PayID. Try [Get Started With Xpring SDK and PayID](xpring-sdk-payid-get-started).
140
+
118
141
## Learn More
119
142
120
-
After setting up the basics, you have a good foundation for learning more about the PayID Protocol. Here are some next steps you can take:
143
+
You now have a good foundation for learning more about the PayID Protocol. Here are some next steps you can take:
121
144
122
145
-[How to convert](https://github.com/xpring-eng/xpring-js#usage-payid) the `user$domain.com` format to a URL
123
146
- Learn how to use relevant [HTTP headers](payid-headers)
@@ -133,11 +156,3 @@ Learn about:
133
156
-[How to contribute to PayID](https://github.com/payid-org/payid/blob/master/CONTRIBUTING.md)
134
157
-[PayID RFCs](https://github.com/payid-org/rfcs), which discuss potential changes and additions to the PayID Protocol
135
158
- The [PayID Whitepaper](https://payid.org/whitepaper.pdf), which provides background context around the problems that PayID solves
136
-
137
-
## Xpring SDK Integration
138
-
139
-
PayID is integrated into [Xpring SDK](https://github.com/xpring-eng/xpring-sdk).
140
-
141
-
Xpring SDK provides the ability to work with PayID, using libraries provided in [JavaScript](https://github.com/xpring-eng/xpring-js), [Java](https://github.com/xpring-eng/xpring4j), and [Swift](https://github.com/xpring-eng/xpringkit).
142
-
143
-
These libraries help you connect your application to PayID without having to worry about the specifics of PayID.
Copy file name to clipboardExpand all lines: docs/intro-deploy.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,3 +15,5 @@ When you want to experiment with or deploy a PayID server, you have several opti
15
15
-[Deploy on AWS Lambda](aws-lambda-deploy)
16
16
17
17
You can use the same principles to deploy a PayID server on other cloud providers, or on your own machines. See the suggested [requirements](payid-server-requirements).
18
+
19
+
When you have set up your PayID server, you can also configure an [NGINX reverse proxy and SSL](nginx-ssl-deploy) to improve load bearing and security.
## Deploy a PayID server with Docker, and pull PayID metrics into Prometheus
8
+
9
+
In this tutorial, you will deploy a PayID server and run Prometheus locally using Docker, and you will create a configuration file for the PayID server so that PayID metrics are pulled into Prometheus.
10
+
11
+
### Prerequisites
12
+
13
+
Install the following software on your machine, if not already present.
### Build a Docker container for setting up a PayID server
20
+
21
+
Run these commands to build a Docker container for a PayID server.
22
+
23
+
```bash
24
+
git clone https://github.com/payid-org/payid.git
25
+
cd payid
26
+
docker build -t payid-server .
27
+
```
28
+
29
+
### Create Docker network for PayID
30
+
31
+
You will run several containers in Docker that must talk to each other. To set up these containers, create a docker network called `payid-network`.
32
+
33
+
```bash
34
+
docker network create payid-network
35
+
```
36
+
37
+
### Start a Postgres Database
38
+
39
+
To have a PayID server, you require a Postgres database to store PayID accounts and address mappings. To do this, run the postgres database in docker with a default password of `password`, and tell the database to use the `payid-network` that you previously created. Name this docker container `payid-postgres`, so that you can reference the container by name when you connect your PayID server. Note that both the default database and the user are named `postgres`, as described at [Postgres Docker Official Images](https://hub.docker.com/_/postgres).
To start the PayID server, run the PayID server in docker using the image you created. You must also use the docker network `payid-network` so that it can connect to the `payid-postgres` container.
In this step, you will run prometheus in docker and configure it to scrape the PayID server’s metrics. To do this, you need to create a `prometheus.yml` file on the host machine and mount it in the docker container.
82
+
83
+
Create a file named `prometheus.yml` with these contents.
84
+
85
+
```yml
86
+
global:
87
+
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
88
+
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
89
+
90
+
scrape_configs:
91
+
- job_name: 'payid-metric'
92
+
honor_labels: true
93
+
static_configs:
94
+
- targets: ['payid-server:8081']
95
+
```
96
+
97
+
Start the docker container:
98
+
99
+
```bash
100
+
docker run -d --network payid-network -p 9090:9090 -v $PWD/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus`
101
+
```
102
+
103
+
You can verify Prometheus is running by opening `http://localhost:9090/graph` in a browser.
104
+
105
+
You can verify metrics collection metrics are being collected by entering the following expression into the form:
106
+
107
+
`sum(payid_count)`
108
+
109
+
Click `Execute`. If successful, the results look like this:
110
+
111
+

112
+
113
+
Click the **Graph** tab to display the results in graph format.
114
+
115
+
Here are some other example expressions:
116
+
117
+
-`sum(payid_count) by (paymentNetwork)` - Sum of `payid` count by payment network, such as XRPL, BTC, and so forth.
118
+
-`sum(payid_lookup_request)` - Total number of `payid` lookup requests.
119
+
-`rate(payid_lookup_request[5m])` - Rate of `payid` lookup requests per second.
After you set up a PayID server using your preferred [deployment option](intro-deploy.md), you can set up NGINX Reverse Proxy + SSL for load balancing and security.
8
+
9
+
## NGINX Reverse Proxy + SSL setup
10
+
11
+
1. Change the PayID server to run on port 8080 (default).
12
+
2. Set up a Server Block on NGINX for your domain, following [these instructions](https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-18-04).
13
+
3. Install Certbot, as follows.
14
+
```bash
15
+
apt-get update
16
+
apt-get install software-properties-common
17
+
add-apt-repository ppa:certbot/certbot
18
+
apt-get update
19
+
apt-get install python-certbot-nginx
20
+
```
21
+
4. Generate a certificate (choose to redirect)
22
+
`certbot --nginx`
23
+
5. Change the location parameter in the NGINX conf file to reverse proxy to the PayID server (running on port 8080):
24
+
`try_files $uri $uri/ =404;`
25
+
to:
26
+
```nginx
27
+
proxy_pass http://127.0.0.1:8080;
28
+
proxy_set_header Host $http_host;
29
+
```
30
+
**Note:** The second line is required to preserve the original URL, which is used to find the user.
31
+
**Note:** You can expand your certificate to cover any subdomain used in a PayID using:
7.[Optional] Update the NGINX configuration that catches PayID headers and forwards them to the PayID server; otherwise, send these headers to the web server.
36
+
37
+
**Note:** You will need to add additional proxy passing statements for each additional network supported, or otherwise use a generic regex to identify all PayID headers.
38
+
39
+
```bash
40
+
sudo nano /etc/nginx/sites-available/<your-site>
41
+
```
42
+
43
+
```nginx
44
+
location / {
45
+
proxy_set_header Host $http_host;
46
+
# needed for CORS
47
+
add_header Access-Control-Allow-Origin *;
48
+
add_header Access-Control-Allow-Headers *;
49
+
50
+
# proxy passing needed for all supported networks
51
+
# modify port to the one used by your PayID server
0 commit comments