-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #220 from babylonchain/merge-main-into-dev-branch-2
Merge main into dev branch 2
- Loading branch information
Showing
41 changed files
with
1,383 additions
and
180 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: ci | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
lint_test: | ||
uses: babylonchain/.github/.github/workflows/[email protected] | ||
with: | ||
run-unit-tests: true | ||
run-integration-tests: false | ||
run-lint: false | ||
|
||
docker_pipeline: | ||
uses: babylonchain/.github/.github/workflows/[email protected] | ||
secrets: inherit | ||
with: | ||
publish: false | ||
dockerfile: ./contrib/images/staking-api-service/Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: docker_publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
- 'dev' | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
lint_test: | ||
uses: babylonchain/.github/.github/workflows/[email protected] | ||
with: | ||
run-unit-tests: true | ||
run-integration-tests: false | ||
run-lint: false | ||
|
||
docker_pipeline: | ||
needs: ["lint_test"] | ||
uses: babylonchain/.github/.github/workflows/[email protected] | ||
secrets: inherit | ||
with: | ||
publish: true | ||
dockerfile: ./contrib/images/staking-api-service/Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Ordinals in API system | ||
|
||
The Babylon Staking API allows for the option to deploy additional endpoints | ||
that check whether a UTXO contains an inscription or not, with the aim to help | ||
staking applications identify whether they should avoid spending a particular UTXO. | ||
This is accomplished through a connection to the | ||
[Ordinal Service](https://github.com/ordinals/ord) and | ||
a connection to the Unisat API. | ||
Due to Unisat being a payed service and applying rate limits, | ||
the API initially tries to get the status of a UTXO through the Ordinals Service, | ||
and if that fails, then contacts the Unisat API, | ||
effectively using it as a back-up mechanism to handle downtime from the Ordinals Service. | ||
|
||
NOTE: To enable the optional ordinal API endpoint, you will need to provide the | ||
`ordinal` and `unisat` configurations under `assets` | ||
|
||
## Ordinal service Client | ||
|
||
WIP | ||
|
||
## Unisat Service Client | ||
|
||
You can find more information about Unisat's Ordinal/BRC-20/Runes related endpoints at: | ||
https://docs.unisat.io/ | ||
|
||
In our service, we only utilize the following endpoint: | ||
- `/v1/indexer/address/{{address}}/inscription-utxo-data` | ||
|
||
### How to Use It | ||
|
||
1. Log in via https://developer.unisat.io/account/login (create an account if you don't have one). | ||
2. Copy the `API-Key`. | ||
3. Set the key as an environment variable named `UNISAT_TOKEN`. | ||
4. Configure the values for `unisat.host`, `limit`, `timeout`, etc. Refer to `config-docker.yml`. | ||
5. Ensure you also set up the `ordinals` configuration, as this is a dependency. | ||
6. Call the POST endpoint `/v1/ordinals/verify-utxos` as shown in the example below: | ||
7. The calls to unisat will only be triggered if the ordinal service is not responding or returning errors | ||
```POST | ||
{ | ||
"utxos": [ | ||
{ | ||
"txid": "143c33b4ff4450a60648aec6b4d086639322cb093195226c641ae4f0ae33c3f5", | ||
"vout": 2 | ||
}, | ||
{ | ||
"txid": "be3877c8dedd716f026cc77ef3f04f940b40b064d1928247cff5bb08ef1ba58e", | ||
"vout": 0 | ||
}, | ||
{ | ||
"txid": "d7f65a37f59088b3b4e4bc119727daa0a0dd8435a645c49e6a665affc109539d", | ||
"vout": 0 | ||
} | ||
], | ||
"address": "tb1pyqjxwcdv6pfcaj2l565ludclz2pwu2k5azs6uznz8kml74kkma6qm0gzlv" | ||
} |
Oops, something went wrong.