Page MenuHomePhabricator

[token-server, cashtab-faucet] Split token-server into two apps for faucet and token icon mgmt
ClosedPublic

Authored by bytesofman on Jul 13 2025, 23:18.

Details

Summary

These apps do not belong together. They both happen to use API endpoints.

We should split these up. Have some improvements that should get in for both of these apps, but it would be convoluted to add them to this frankenstein combo server.

So first, split the apps without altering any functionality.

Test Plan

npm test in each, will need some CI config work for cashtab-faucet ... will mb have to test in prod a bit with teamcity deployments but that's ok for this type of thing

docker build -f token-server.Dockerfile -t token-server_local .

docker build -f cashtab-faucet.Dockerfile -t cashtab-facuet_local .

tbh this will probably break stuff when it lands. I will back up the icons before landing. For these apps, if I need to do some troubleshooting to iterate back to their current prod state, that's acceptable. Both of the apps need lots of upgrades, and even taking 4 hrs of downtime to get them to an upgradeable state would be worth it.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
token-server-split
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 33857
Build 67192: Build Difftoken-server-tests
Build 67191: arc lint + arc unit

Event Timeline

Tail of the build log:

/work/apps/token-server /work/abc-ci-builds/token-server-tests
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated glob@8.1.0: Glob versions prior to v9 are no longer supported
npm warn deprecated har-validator@5.1.5: this library is no longer supported
npm warn deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm warn deprecated superagent@8.1.2: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net
npm warn deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.

added 575 packages, and audited 579 packages in 6s

127 packages are looking for funding
  run `npm fund` for details

10 vulnerabilities (2 low, 6 moderate, 2 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
CI configured to test build. Building...

> token-server@0.0.0 prebuild
> ts-node scripts/prepSecrets.ts

secrets.ts does not exist, copying secrets.sample.ts...

> token-server@0.0.0 build
> tsc -p ./tsconfig.build.json

index.ts(9,31): error TS2307: Cannot find module 'chronik-client' or its corresponding type declarations.
index.ts(12,21): error TS2307: Cannot find module 'ecash-lib' or its corresponding type declarations.
index.ts(13,27): error TS2307: Cannot find module 'express-rate-limit' or its corresponding type declarations.
index.ts(18,42): error TS2339: Property 'chronikUrls' does not exist on type 'TokenServerConfig'.
index.ts(44,13): error TS2554: Expected 4 arguments, but got 8.
index.ts(46,30): error TS2339: Property 'limiter' does not exist on type 'TokenServerConfig'.
index.ts(47,30): error TS2339: Property 'tokenLimiter' does not exist on type 'TokenServerConfig'.
scripts/getHistoryAfterTimestamp.ts(19,31): error TS2307: Cannot find module 'chronik-client' or its corresponding type declarations.
scripts/getHistoryAfterTimestamp.ts(20,42): error TS2307: Cannot find module '../src/chronik/clientHandler' or its corresponding type declarations.
scripts/getHistoryAfterTimestamp.ts(21,32): error TS2307: Cannot find module '../src/chronik/parse' or its corresponding type declarations.
scripts/getHistoryAfterTimestamp.ts(24,42): error TS2339: Property 'chronikUrls' does not exist on type 'TokenServerConfig'.
scripts/getHistoryAfterTimestamp.ts(46,5): error TS7006: Parameter 'result' implicitly has an 'any' type.
scripts/getHistoryAfterTimestamp.ts(76,5): error TS7006: Parameter 'err' implicitly has an 'any' type.
scripts/getWallet.ts(17,31): error TS2307: Cannot find module 'chronik-client' or its corresponding type declarations.
scripts/getWallet.ts(19,61): error TS2307: Cannot find module '../src/wallet' or its corresponding type declarations.
scripts/getWallet.ts(22,42): error TS2339: Property 'chronikUrls' does not exist on type 'TokenServerConfig'.
secrets.sample.ts(5,30): error TS2307: Cannot find module './src/wallet' or its corresponding type declarations.
secrets.ts(5,30): error TS2307: Cannot find module './src/wallet' or its corresponding type declarations.
Build token-server-tests failed with exit code 2

.env out, into .gitignore, no newline

Tail of the build log:

/work/apps/token-server /work/abc-ci-builds/token-server-tests
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated glob@8.1.0: Glob versions prior to v9 are no longer supported
npm warn deprecated har-validator@5.1.5: this library is no longer supported
npm warn deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm warn deprecated superagent@8.1.2: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net
npm warn deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.

added 575 packages, and audited 579 packages in 6s

127 packages are looking for funding
  run `npm fund` for details

10 vulnerabilities (2 low, 6 moderate, 2 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
CI configured to test build. Building...

> token-server@0.0.0 prebuild
> ts-node scripts/prepSecrets.ts

secrets.ts does not exist, copying secrets.sample.ts...

> token-server@0.0.0 build
> tsc -p ./tsconfig.build.json

index.ts(9,31): error TS2307: Cannot find module 'chronik-client' or its corresponding type declarations.
index.ts(12,21): error TS2307: Cannot find module 'ecash-lib' or its corresponding type declarations.
index.ts(13,27): error TS2307: Cannot find module 'express-rate-limit' or its corresponding type declarations.
index.ts(18,42): error TS2339: Property 'chronikUrls' does not exist on type 'TokenServerConfig'.
index.ts(44,13): error TS2554: Expected 4 arguments, but got 8.
index.ts(46,30): error TS2339: Property 'limiter' does not exist on type 'TokenServerConfig'.
index.ts(47,30): error TS2339: Property 'tokenLimiter' does not exist on type 'TokenServerConfig'.
scripts/getHistoryAfterTimestamp.ts(19,31): error TS2307: Cannot find module 'chronik-client' or its corresponding type declarations.
scripts/getHistoryAfterTimestamp.ts(20,42): error TS2307: Cannot find module '../src/chronik/clientHandler' or its corresponding type declarations.
scripts/getHistoryAfterTimestamp.ts(21,32): error TS2307: Cannot find module '../src/chronik/parse' or its corresponding type declarations.
scripts/getHistoryAfterTimestamp.ts(24,42): error TS2339: Property 'chronikUrls' does not exist on type 'TokenServerConfig'.
scripts/getHistoryAfterTimestamp.ts(46,5): error TS7006: Parameter 'result' implicitly has an 'any' type.
scripts/getHistoryAfterTimestamp.ts(76,5): error TS7006: Parameter 'err' implicitly has an 'any' type.
scripts/getWallet.ts(17,31): error TS2307: Cannot find module 'chronik-client' or its corresponding type declarations.
scripts/getWallet.ts(19,61): error TS2307: Cannot find module '../src/wallet' or its corresponding type declarations.
scripts/getWallet.ts(22,42): error TS2339: Property 'chronikUrls' does not exist on type 'TokenServerConfig'.
secrets.sample.ts(5,30): error TS2307: Cannot find module './src/wallet' or its corresponding type declarations.
secrets.ts(5,30): error TS2307: Cannot find module './src/wallet' or its corresponding type declarations.
Build token-server-tests failed with exit code 2

Tail of the build log:

/work/apps/token-server /work/abc-ci-builds/token-server-tests
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated glob@8.1.0: Glob versions prior to v9 are no longer supported
npm warn deprecated har-validator@5.1.5: this library is no longer supported
npm warn deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm warn deprecated superagent@8.1.2: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net
npm warn deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.

added 575 packages, and audited 579 packages in 6s

127 packages are looking for funding
  run `npm fund` for details

10 vulnerabilities (2 low, 6 moderate, 2 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
CI configured to test build. Building...

> token-server@0.0.0 prebuild
> ts-node scripts/prepSecrets.ts

secrets.ts does not exist, copying secrets.sample.ts...

> token-server@0.0.0 build
> tsc -p ./tsconfig.build.json

index.ts(9,31): error TS2307: Cannot find module 'chronik-client' or its corresponding type declarations.
index.ts(12,21): error TS2307: Cannot find module 'ecash-lib' or its corresponding type declarations.
index.ts(13,27): error TS2307: Cannot find module 'express-rate-limit' or its corresponding type declarations.
index.ts(18,42): error TS2339: Property 'chronikUrls' does not exist on type 'TokenServerConfig'.
index.ts(44,13): error TS2554: Expected 4 arguments, but got 8.
index.ts(46,30): error TS2339: Property 'limiter' does not exist on type 'TokenServerConfig'.
index.ts(47,30): error TS2339: Property 'tokenLimiter' does not exist on type 'TokenServerConfig'.
scripts/getHistoryAfterTimestamp.ts(19,31): error TS2307: Cannot find module 'chronik-client' or its corresponding type declarations.
scripts/getHistoryAfterTimestamp.ts(20,42): error TS2307: Cannot find module '../src/chronik/clientHandler' or its corresponding type declarations.
scripts/getHistoryAfterTimestamp.ts(21,32): error TS2307: Cannot find module '../src/chronik/parse' or its corresponding type declarations.
scripts/getHistoryAfterTimestamp.ts(24,42): error TS2339: Property 'chronikUrls' does not exist on type 'TokenServerConfig'.
scripts/getHistoryAfterTimestamp.ts(46,5): error TS7006: Parameter 'result' implicitly has an 'any' type.
scripts/getHistoryAfterTimestamp.ts(76,5): error TS7006: Parameter 'err' implicitly has an 'any' type.
scripts/getWallet.ts(17,31): error TS2307: Cannot find module 'chronik-client' or its corresponding type declarations.
scripts/getWallet.ts(19,61): error TS2307: Cannot find module '../src/wallet' or its corresponding type declarations.
scripts/getWallet.ts(22,42): error TS2339: Property 'chronikUrls' does not exist on type 'TokenServerConfig'.
secrets.sample.ts(5,30): error TS2307: Cannot find module './src/wallet' or its corresponding type declarations.
secrets.ts(5,30): error TS2307: Cannot find module './src/wallet' or its corresponding type declarations.
Build token-server-tests failed with exit code 2

make sure we can docker build token-server, update index, remove faucet-related scripts

bytesofman edited the test plan for this revision. (Show Details)
emack added a subscriber: emack.
emack added inline comments.
apps/cashtab-faucet/config.ts
1 ↗(On Diff #54827)

[insert fabien's what year is it meme]

apps/cashtab-faucet/index.ts
1 ↗(On Diff #54827)

[insert fabien's what year is it meme]

This revision is now accepted and ready to land.Jul 14 2025, 12:11

move port, update header years