Commit graph

185 commits

Author SHA1 Message Date
Blockstream Satellite
f8dfa44c73 Remove pending orders from list of queued orders
An order is only "queued for transmission" after leaving the
pending (payment pending) state.
2021-12-28 10:01:04 -03:00
Blockstream Satellite
5882fddc49 Support retransmission of unconfirmed orders
This change implements a mechanism to retransmit orders if some of the
order's selected regions do not confirm transmission in due time. It
adds a worker to repeatedly check the orders and determine if they need
retransmission. Such orders will be added to a new table named
tx_retries. The tx_start function now first checks if there are regular
new paid orders to transmit. If not, it will check the retransmission
table and retransmit an order from there if one is available.

This patch also introduces a new order state called "retranmission". The
order enters this state while waiting for retransmission.
2021-12-28 10:01:04 -03:00
Blockstream Satellite
21ee2f212b Support API transmissions over selected regions
Users can provide a list of regions to POST /order requests. This list
indicates on which regions the order should be transmitted. It also
determines the expected transmission and reception confirmations.
2021-12-27 12:16:25 -03:00
Blockstream Satellite
2cfc39804e Remove tx loop and rely on tx confirmations
This change removes the infinite transmission loop with sleep periods
between each transmission. Now, a new transmission can start by a call
to "tx_start" on the following two conditions:

1) As soon as the application starts (if there is a previously paid
   order waiting already).
2) As soon as the current transmission ends. The server will immediately
   look for the next order ready for transmission and start it if
   available.

Meanwhile, the condition for ending the current transmission (i.e., for
calling "tx_end(order)") is when all Tx confirmations are received from
all regions.
2021-12-27 12:16:25 -03:00
nitramiz
0fc668d490 tf: update check-containers.sh 2021-09-24 07:48:03 -07:00
nitramiz
71ca226f6b tf: disable google-logging 2021-09-24 07:36:32 -07:00
nitramiz
6b6448437e tf: update prometheus instance 2021-09-02 08:30:19 -07:00
Blockstream Satellite
b45faeb54a Bump SSE server dependencies
- Update the node 16 image.
- Update dependencies to their latest versions.
- Update package lock file.
2021-07-22 10:18:15 -03:00
Blockstream Satellite
ef8b74e454 Add status badge for unit tests 2021-07-22 09:32:41 -03:00
Blockstream Satellite
e6cd148bc6 Support auth_token given as query string parameter 2021-07-21 14:43:44 -03:00
nitramiz
19a5e08e91 CI: add build job for tags; TF: cleanup 2021-07-21 10:34:58 -07:00
Blockstream Satellite
876c6de170 Fix line break on invoice callback URL 2021-07-21 13:52:45 -03:00
nitramiz
b6f14cbf73 CI: don't run test job on tags 2021-07-21 06:14:25 -07:00
Blockstream Satellite
69b97e9eae Randomize charge api token's getenv fallback value
If the env var is not defined, fall back to a random string. However,
note the random string won't work over gunicorn if using multiple
workers. In this case, it is necessary to define the env var.
2021-07-20 15:05:11 -03:00
nitramiz
608e61692a TF: update check_containers alert 2021-07-20 08:58:03 -07:00
nitramiz
ebe74cb80a CI: remove redundant plan_satapi job 2021-07-20 12:28:49 -03:00
nitramiz
c0c904d7ff TF: move iptables 4500 rule to correct service 2021-07-20 12:28:49 -03:00
nitramiz
ff1081033c TF: rename the tx-daemon and sse services 2021-07-20 12:28:49 -03:00
Blockstream Satellite
095034b7dd TF: Review the api-server and charge service order 2021-07-20 12:28:49 -03:00
nitramiz
a110135f6d CI job nits 2021-07-20 12:28:49 -03:00
nitramiz
a89d2f3e70 TF: systemd services nits 2021-07-20 12:28:49 -03:00
nitramiz
9d8f4f16eb CI: update job trigger rules 2021-07-20 12:28:49 -03:00
Blockstream Satellite
a6e5102641 TF: change lightningd prom metrics iptables port 2021-07-20 12:28:49 -03:00
Blockstream Satellite
4cf05d45f0 TF: make api-server PROACTIVE 2021-07-20 12:28:49 -03:00
nitramiz
79eb73f223 CI: manual image builds on all branches 2021-07-20 12:28:49 -03:00
nitramiz
5860c65540 CI: GCR docker auth; rename ionosphere to api-server
TF: add CI service account; add REDIS_URI to services
2021-07-20 12:28:49 -03:00
Blockstream Satellite
7f6d4b3a6b CI: Review CI to allow deployment from any branch
- If a staging_/prod_/misc_ tag is present, or if merging to master,
  push the Satellite API image upstream.

- Tag images with the commit SHA and the commit ref slug (.e.g, branch
  name) for caching. Tag with latest if merging to master.

- Deploy the image specified by commit SHA.
2021-07-20 12:28:49 -03:00
Blockstream Satellite
fd36995b66 CI: Push Docker images to gcloud registry 2021-07-20 12:28:42 -03:00
Blockstream Satellite
afbd02f759 TF: prepare staging 2021-07-20 12:28:28 -03:00
Blockstream Satellite
be67323a24 CI/TF: Updates for python-ported version 2021-07-20 12:28:28 -03:00
Blockstream Satellite
3d7a5b764d Add expired invoice error and rename paid error
- Add new error: INVOICE_ALREADY_EXPIRED.
- Rename ORDER_ALREADY_PAID to INVOICE_ALREADY_PAID.
2021-07-20 12:28:08 -03:00
Blockstream Satellite
90f7c12783 Remove unused/obsolete API error codes
The new server implementation in Python implements request validation
using the Marshamallow package. With that, some requests are validated
directly by the marshmallow validator and do not return custom error
codes. Drop those error codes and other unused ones. Review the README
docs accordingly.
2021-07-20 12:28:08 -03:00
Blockstream Satellite
24a4c5ccb7 Do not round the order's bid_per_byte value
Store the fractional value on the db. Let the frontend round if
necessary but keep it non-rounded on the backend.
2021-07-20 12:28:08 -03:00
Blockstream Satellite
1568ee54f2 Add a new error code for fetching info
Return a json response with a custom error code like most other API
endpoints.
2021-07-20 12:28:08 -03:00
Blockstream Satellite
d8e7516f01 Add date filter and paging on all orders/ states
- Add date filtering (before parameter) to /queued.
- Add page limit to /sent and /pending.
2021-07-20 12:28:08 -03:00
Blockstream Satellite
9d421771e7 Port the satellite API to python
- Preserve the SQLite database and use SQLAlchemy to wrap db
  interactions.
- Use Alembic for database migrations.
- Organize all the python modules on the new server/ directory.
- Use pytest for unit tests and organize test modules at server/tests/.
2021-07-20 12:28:08 -03:00
Blockstream Satellite
8a332afcb0 TF: cleanup unused postgres service 2021-07-20 12:28:08 -03:00
Blockstream Satellite
825d04b651 CI: remove testnet_staging jobs 2021-07-20 12:28:08 -03:00
nitramiz
0dbeb9feab CI: terraform 0.14.5 2021-03-29 08:34:55 -07:00
nitramiz
417b52ad5e
update lightningd to 0.9.3
remove LB autoscaler
2021-03-29 08:10:23 -07:00
nitramiz
905e7e6a87
CI: update misc jobs 2021-02-23 07:33:03 -08:00
nitramiz
a4281072b6 update DNS; output LB's internal IP 2021-02-23 07:23:07 -08:00
nitramiz
c4be27d1cb tf: update auth endpoint 2021-02-22 10:42:49 -08:00
nitramiz
77e920be6f
increase max file size for btc-src orders 2021-01-28 10:16:34 -08:00
Igor Freire
35b61e0685 Handle auth/ and btc-src/ via LB 2021-01-28 07:03:12 -08:00
Igor Freire
2ae72ccc59 Add lower limit of one satoshi on bids
Many Lightning wallets do not support payments below 1 sat (in
millisatoshis). For wider compliance, set a lower limit of 1 sat on orders,
while preserving the minimum bid per byte requirement for orders whose absolute
bid exceeds 1 sat.
2021-01-22 17:16:45 -03:00
Igor Freire
d27e5152f1 Update default minimum bid per byte 2021-01-22 17:16:44 -03:00
nitramiz
8140500367 CI: update docker and alpine + remove cache_from + add network=host to build_ci_image job (and test_build job) 2021-01-19 14:30:29 -08:00
nitramiz
414341b3fa
tf: update the LB's cert-renewer.service to reload nginx 2020-12-31 07:35:39 -08:00
nitramiz
9c04dd66d0
lower min per byte bid to 1msat/byte 2020-12-07 12:45:48 -08:00