From f72aa311326acf3867142bfa653bee88db8b1dfc Mon Sep 17 00:00:00 2001 From: Thomas Jay Rush Date: Mon, 19 Feb 2024 21:08:57 -0500 Subject: [PATCH] Updating and testing deployment --- .github/workflows/build-deploy-linkcheck.yaml | 51 ++-- .../build-deploy-linkcheck.yaml.disabled | 22 +- content/api/openapi.yaml | 219 +++++++++--------- 3 files changed, 148 insertions(+), 144 deletions(-) diff --git a/.github/workflows/build-deploy-linkcheck.yaml b/.github/workflows/build-deploy-linkcheck.yaml index b55dfac9b..2b0adba9f 100644 --- a/.github/workflows/build-deploy-linkcheck.yaml +++ b/.github/workflows/build-deploy-linkcheck.yaml @@ -19,6 +19,20 @@ jobs: - name: Install dependencies run: npm install + - name: Build API page + uses: seeebiii/redoc-cli-github-action@v10 + with: + args: "bundle --options.disableGoogleFont=true content/api/openapi.yaml -o public/api/index.html" + + # - name: Push to deploy branch + # uses: peaceiris/actions-gh-pages@v3 + # with: + # github_token: ${{ secrets.GITHUB_TOKEN }} + # publish_dir: ./public + # publish_branch: deploy + # - name: checkout deploy + # run: git checkout -f deploy + - name: Setup Hugo uses: peaceiris/actions-hugo@v2 with: @@ -28,37 +42,30 @@ jobs: - name: Build Hugo site run: hugo --minify - - name: Build API page - uses: seeebiii/redoc-cli-github-action@v10 - with: - args: "bundle --options.disableGoogleFont=true content/api/openapi.yaml -o public/api/index.html" - - - name: Push to deploy branch - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./public - publish_branch: deploy - - - name: Install linkinator - run: npm install -g linkinator - - - name: checkout deploy - run: git checkout -f deploy - - name: rsync deployments uses: burnett01/rsync-deployments@5.1 with: switches: -avzr --delete --exclude=".git" --exclude=".github" path: public/ - remote_path: /home/${{ secrets.DOCS_USER }}/trueblocks-website - remote_host: ${{ secrets.NEW_SERVER_HOST }} - remote_user: ${{ secrets.DOCS_USER }} - remote_key: ${{ secrets.DOCS_PRIVATE_KEY }} + remote_path: /home/docs/Websites/trueblocks.io + remote_host: ${{ secrets.HOST }} + remote_user: ${{ secrets.HOST_USER }} + remote_key: ${{ secrets.DEPLOY_SSH_KEY }} + + - name: Install linkinator + run: npm install -g linkinator - name: check links run: linkinator -r index.html docs/ papers/ data-model/ api/ --skip localhost:23456 --skip tokenomics.io --skip etherscan.io --skip https://twitter.com/trueblocks --skip intro + - name: Test Failure + uses: rjstone/discord-webhook-notify@v1 + if: failure() + with: + severity: error + details: Test Failed! + webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} + - name: Report job status run: | echo "This job's status is ${{ job.status }}" diff --git a/.github/workflows/build-deploy-linkcheck.yaml.disabled b/.github/workflows/build-deploy-linkcheck.yaml.disabled index 372ffdbd1..7455be6c0 100644 --- a/.github/workflows/build-deploy-linkcheck.yaml.disabled +++ b/.github/workflows/build-deploy-linkcheck.yaml.disabled @@ -40,9 +40,6 @@ jobs: publish_dir: ./public publish_branch: deploy - - name: Install linkinator - run: npm install -g linkinator - - name: checkout deploy run: git checkout -f deploy @@ -51,22 +48,17 @@ jobs: with: switches: -avzr --delete --exclude=".git" --exclude=".github" path: public/ - remote_path: /home/docs/Websites/trueblocks.io - remote_host: ${{ secrets.HOST }} - remote_user: ${{ secrets.HOST_USER }} - remote_key: ${{ secrets.DEPLOY_SSH_KEY }} + remote_path: /home/${{ secrets.DOCS_USER }}/trueblocks-website + remote_host: ${{ secrets.NEW_SERVER_HOST }} + remote_user: ${{ secrets.DOCS_USER }} + remote_key: ${{ secrets.DOCS_PRIVATE_KEY }} + + - name: Install linkinator + run: npm install -g linkinator - name: check links run: linkinator -r index.html docs/ papers/ data-model/ api/ --skip localhost:23456 --skip tokenomics.io --skip etherscan.io --skip https://twitter.com/trueblocks --skip intro - - name: Test Failure - uses: rjstone/discord-webhook-notify@v1 - if: failure() - with: - severity: error - details: Test Failed! - webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} - - name: Report job status run: | echo "This job's status is ${{ job.status }}" diff --git a/content/api/openapi.yaml b/content/api/openapi.yaml index 3516d948d..732334645 100644 --- a/content/api/openapi.yaml +++ b/content/api/openapi.yaml @@ -10,7 +10,7 @@ info: version: 2.5.8-release description: > - A REST layer over the TrueBlocks application. With `chifra daemon`, you can + A REST layer over the TrueBlocks chifra command line. With `chifra daemon`, you can run this on your own machine, and make calls to `localhost`. ## How to use this API effectively @@ -19,7 +19,7 @@ info: CLI application, and the query parameters mirror the commands' options and flags. If you want details, [the commands have their own documentation page](/chifra/introduction/). - For detailed descriptions of fields, see [the data model reference](/data-model/intro/). + For detailed descriptions of data returned by each command, see [the data model reference](/data-model/intro/). ### Before you begin @@ -201,19 +201,20 @@ paths: - $ref: "#/components/schemas/bounds" example: { - "data": [ - { - "address": "0xff9387a9aae1f5daab1cd8eb0e92113ea9d19ca3", - "blockNumber": 4037786, - "transactionIndex": 47 - }, - { - "address": "0xff9387a9aae1f5daab1cd8eb0e92113ea9d19ca3", - "blockNumber": 4037800, - "transactionIndex": 77 - }, - { "...": "..." }, - ] + "data": + [ + { + "address": "0xff9387a9aae1f5daab1cd8eb0e92113ea9d19ca3", + "blockNumber": 4037786, + "transactionIndex": 47, + }, + { + "address": "0xff9387a9aae1f5daab1cd8eb0e92113ea9d19ca3", + "blockNumber": 4037800, + "transactionIndex": 77, + }, + { "...": "..." }, + ], } "400": description: bad input parameter @@ -533,36 +534,38 @@ paths: - $ref: "#/components/schemas/parameter" example: { - "data": [ - { - "hash": "0x78a17b79e638190d72a3030a79645c32cf3420a133ea2835206778e5ab63fdc7", - "blockHash": "0xdf551eb24dd5275c22d497b9076f1111f483b71ca37002bee51d5db55d20d2fa", - "blockNumber": 4037786, - "transactionIndex": 47, - "timestamp": 1500352888, - "from": "0x29205869522cc9d1f84b0ad5279a8e74a7c66c15", - "to": "0xff9387a9aae1f5daab1cd8eb0e92113ea9d19ca3", - "value": 84353870000000000, - "gas": 90000, - "gasPrice": 20000000000, - "maxFeePerGas": 0, - "maxPriorityFeePerGas": 0, - "isError": 0, - "hasToken": 0, - "receipt": { - "contractAddress": "0x0", + "data": + [ + { + "hash": "0x78a17b79e638190d72a3030a79645c32cf3420a133ea2835206778e5ab63fdc7", + "blockHash": "0xdf551eb24dd5275c22d497b9076f1111f483b71ca37002bee51d5db55d20d2fa", + "blockNumber": 4037786, + "transactionIndex": 47, + "timestamp": 1500352888, + "from": "0x29205869522cc9d1f84b0ad5279a8e74a7c66c15", + "to": "0xff9387a9aae1f5daab1cd8eb0e92113ea9d19ca3", + "value": 84353870000000000, + "gas": 90000, + "gasPrice": 20000000000, + "maxFeePerGas": 0, + "maxPriorityFeePerGas": 0, + "isError": 0, + "hasToken": 0, + "receipt": + { + "contractAddress": "0x0", + "gasUsed": 21000, + "effectiveGasPrice": 20000000000, + "status": null, + }, + "compressedTx": "0x()", + "gasCost": 420000000000000, "gasUsed": 21000, - "effectiveGasPrice": 20000000000, - "status": null + "date": "2017-07-18 04:41:28 UTC", + "ether": 0.08435387, }, - "compressedTx": "0x()", - "gasCost": 420000000000000, - "gasUsed": 21000, - "date": "2017-07-18 04:41:28 UTC", - "ether": 0.08435387 - }, - { "...": "..." } - ] + { "...": "..." }, + ], } "400": description: bad input parameter @@ -930,41 +933,43 @@ paths: - $ref: "#/components/schemas/function" - $ref: "#/components/schemas/parameter" example: - { - "data": [ - { - "name": "PairCreated", - "type": "event", - "stateMutability": "nonpayable", - "signature": "PairCreated(address,address,address,uint256)", - "encoding": "0x0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9", - "inputs": [ - { - "type": "address", - "name": "token0", - "indexed": true, - "internalType": "address" - }, - { - "type": "address", - "name": "token1", - "indexed": true, - "internalType": "address" - }, - { - "type": "address", - "name": "pair", - "internalType": "address" - }, - { - "type": "uint256", - "name": "val_0", - "internalType": "uint256" - } - ] - } - ] - } + { + "data": + [ + { + "name": "PairCreated", + "type": "event", + "stateMutability": "nonpayable", + "signature": "PairCreated(address,address,address,uint256)", + "encoding": "0x0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9", + "inputs": + [ + { + "type": "address", + "name": "token0", + "indexed": true, + "internalType": "address", + }, + { + "type": "address", + "name": "token1", + "indexed": true, + "internalType": "address", + }, + { + "type": "address", + "name": "pair", + "internalType": "address", + }, + { + "type": "uint256", + "name": "val_0", + "internalType": "uint256", + }, + ], + }, + ], + } "400": description: bad input parameter /blocks: @@ -1820,20 +1825,21 @@ paths: items: $ref: "#/components/schemas/token" example: - { - "data": [ - { - "holder": "0x2910543af39aba0cd09dbb2d50200b3e800a63d2", - "balance": "624980000000000000", - "address": "0xbb9bc244d798123fde783fcc1c72d3bb8c189413", - "name": "The DAO Original", - "decimals": 1, - "isContract": true, - "isErc20": true, - "isErc721": true - } - ] - } + { + "data": + [ + { + "holder": "0x2910543af39aba0cd09dbb2d50200b3e800a63d2", + "balance": "624980000000000000", + "address": "0xbb9bc244d798123fde783fcc1c72d3bb8c189413", + "name": "The DAO Original", + "decimals": 1, + "isContract": true, + "isErc20": true, + "isErc721": true, + }, + ], + } "400": description: bad input parameter /config: @@ -2203,21 +2209,20 @@ paths: - $ref: "#/components/schemas/chunkPinReport" example: { - "data": [ - { - "fileName": "000000000-000000000", - "bloomHash": "QmbCQaYmfTR3sGNAvASoVjPynaY9UD31Hfxv7dGtzsptkb", - "indexHash": "QmPmfSrYT5HDpfjj4uYSycaFECo9EqPSuADQ3YPbVp3yu4" - }, - { - "fileName": "000000001-000590501", - "bloomHash": "QmSGuSQHgK4S9yiZQ3dKrykQVpLTmdFettY9sAwa537gPL", - "indexHash": "QmSaoxc3XA9DEaA3inhLW5ZKsk5C5LWvowSXpHwVHsMjQp" - }, - { - "...": "..." - } - ] + "data": + [ + { + "fileName": "000000000-000000000", + "bloomHash": "QmbCQaYmfTR3sGNAvASoVjPynaY9UD31Hfxv7dGtzsptkb", + "indexHash": "QmPmfSrYT5HDpfjj4uYSycaFECo9EqPSuADQ3YPbVp3yu4", + }, + { + "fileName": "000000001-000590501", + "bloomHash": "QmSGuSQHgK4S9yiZQ3dKrykQVpLTmdFettY9sAwa537gPL", + "indexHash": "QmSaoxc3XA9DEaA3inhLW5ZKsk5C5LWvowSXpHwVHsMjQp", + }, + { "...": "..." }, + ], } "400": description: bad input parameter