unchained-capital / caravan

Bitcoin multisig coordination software
https://unchained-capital.github.io/caravan/
MIT License
203 stars 177 forks source link

Can't build caravan docker image with README.md instructions #359

Closed jbrauck-unchained closed 8 months ago

jbrauck-unchained commented 10 months ago

I'm submitting a…

Expected Behavior

Following the README.md instructions, running docker build . -t caravan:latest I would hope an image builds with no problems

Current Behavior

Getting an error at step 10/12 of the image build

Step 10/12 : RUN npm run build
 ---> Running in 8f235ea16183

> caravan@0.7.0 build
> npm run check && __GIT_SHA__=`git rev-parse --short HEAD` tsc && vite build

> caravan@0.7.0 check
> npm run lint && npm run test:ci

> caravan@0.7.0 lint
> eslint --ext .js,.jsx,.ts,.tsx src/

> caravan@0.7.0 test:ci
> CI=true jest --coverage

PASS src/selectors/wallet.test.js
PASS src/utils/utils.test.js
PASS src/utils/slices.test.js
PASS src/components/__tests__/BitcoinIcon.test.jsx
PASS src/reducers/transactionReducer.test.js (5.059 s)
  ● Console

    console.warn
      Deprecation Warning: TransactionBuilder will be removed in the future. (v6.x.x or later) Please use the Psbt class instead. Examples of usage are available in the transactions-psbt.js integration test file on our Github. A high level explanation is available in the psbt.ts and psbt.js files as well.

      291 |   } catch (e) {
      292 |     // probably has an input that isn't braid aware.
    > 293 |     unsignedTransaction = unsignedMultisigTransaction(
          |                                                      ^
      294 |       state.network,
      295 |       state.inputs,
      296 |       state.outputs

      at new TransactionBuilder (node_modules/bitcoinjs-lib/src/transaction_builder.js:60:13)
      at unsignedMultisigTransaction (node_modules/unchained-bitcoin/lib/transactions.js:67:28)
      at finalizeOutputs (src/reducers/transactionReducer.js:293:54)
      at finalizeOutputs (src/reducers/transactionReducer.js:426:14)
      at Object.<anonymous> (src/reducers/transactionReducer.test.js:288:24)

PASS src/components/Wallet/__tests__/WalletInfoCard.text.jsx (8.686 s)
PASS src/components/__tests__/EditableName.test.jsx (8.679 s)
------------------------------|---------|----------|---------|---------|---------------------------------------------------------------------------------------
File                          | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
------------------------------|---------|----------|---------|---------|---------------------------------------------------------------------------------------
All files                     |   42.57 |    35.16 |    29.9 |   42.95 |
 src                          |    3.03 |        0 |       0 |    3.12 |
  bitcoind.js                 |       0 |        0 |       0 |       0 | 8-143
  block_explorer.js           |    3.57 |        0 |       0 |     3.7 | 7-91
  blockchain.js               |     7.4 |        0 |       0 |    7.69 | 22-111
 src/actions                  |      20 |        0 |       0 |   20.42 |
  errorNotificationActions.js |      50 |      100 |       0 |      50 | 5-12
  settingsActions.js          |      50 |      100 |       0 |      50 | 9-44
  transactionActions.js       |   18.88 |        0 |       0 |   19.28 | 47-421
  walletActions.js            |   16.04 |        0 |       0 |   16.45 | 40-346
 src/components               |   96.87 |       75 |      90 |   96.87 |
  BitcoinIcon.tsx             |     100 |    66.66 |     100 |     100 | 13
  EditableName.tsx            |   96.55 |    77.77 |   88.88 |   96.55 | 66
  theme.js                    |     100 |      100 |     100 |     100 |
 src/components/Wallet        |     100 |    66.66 |     100 |     100 |
  WalletInfoCard.jsx          |     100 |    66.66 |     100 |     100 | 32,76-80
 src/reducers                 |   61.37 |    46.15 |      76 |   61.15 |
  transactionReducer.js       |   61.11 |    46.15 |      75 |   60.86 | 50-64,116-118,143,146,248-250,263,288,313-315,328-338,357-387,410-412,418,430,434-450
  utils.js                    |     100 |      100 |     100 |     100 |
 src/selectors                |    55.2 |       50 |   32.55 |   62.33 |
  wallet.js                   |    55.2 |       50 |   32.55 |   62.33 | 19,21,23-30,36-46,63-72,127,173,181,191-192,202,211,219,251,279-286
 src/utils                    |   64.42 |    49.24 |      68 |    65.9 |
  WrapText.jsx                |       0 |        0 |       0 |       0 | 4-14
  constants.js                |     100 |      100 |     100 |     100 |
  custom-test-queries.js      |   71.42 |      100 |   33.33 |   71.42 | 11,13
  fixtures.js                 |     100 |      100 |     100 |     100 |
  index.js                    |   70.58 |       50 |   71.42 |   68.75 | 9-38
  slices.js                   |   56.92 |       47 |    62.5 |   60.78 | 13-54,71,93
  test-utils.js               |     100 |      100 |     100 |     100 |
------------------------------|---------|----------|---------|---------|---------------------------------------------------------------------------------------

Test Suites: 7 passed, 7 total
Tests:       46 passed, 46 total
Snapshots:   0 total
Time:        9.738 s
Ran all test suites.
sh: 1: git: not found
src/components/Footer.tsx(6,18): error TS2307: Cannot find module '../images/logo.png' or its corresponding type declarations.
src/components/TestSuiteRun/KeystorePicker.tsx(13,8): error TS7016: Could not find a declaration file for module 'unchained-wallets'. '/var/app/node_modules/unchained-wallets/lib/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/unchained-wallets` if it exists or add a new declaration (.d.ts) file containing `declare module 'unchained-wallets';`
src/components/TestSuiteRun/index.tsx(4,33): error TS7016: Could not find a declaration file for module 'unchained-wallets'. '/var/app/node_modules/unchained-wallets/lib/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/unchained-wallets` if it exists or add a new declaration (.d.ts) file containing `declare module 'unchained-wallets';`
The command '/bin/sh -c npm run build' returned a non-zero code: 2

Possible Solution

Unsure right now, going to investigate further and will provide more context as I come across it.

Steps to Reproduce (for bugs)

Try to build the image using docker

  1. Clone repo
  2. run docker build . -t caravan:latest
npm ls caravan unchained-bitcoin unchained-wallets; echo -e npm: `npm -v` \\nnode: `node -v`;  uname -a | xargs echo | cut -d " " -f 1,3-15 || sw_vers
caravan@0.7.0 /home/[name]/caravan
└── (empty)

npm: 8.5.1
node: v12.22.9
Linux 5.15.0-91-generic #101-Ubuntu SMP Tue Nov 14 13:30:08 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
jbrauck-unchained commented 10 months ago

Okay I got somewhere with this. If it confirmed works, I will put a PR with my solution. Its ugly fixes tho so I would appreciate some eyes on it for a cleaned up solution.

jbrauck-unchained commented 10 months ago

Okay PR is opened

bucko13 commented 8 months ago

Thanks for looking into it! Docker builds should be resolved in the new monorepo version now. Let us know over there if you have any issues though!