Pages:
Author

Topic: Trying to run Coinbase multisig-tool locally on Linux - page 2. (Read 715 times)

legendary
Activity: 2268
Merit: 18771
-snip-
This is essentially my experience on two different machines, one running Debian and the other Ubuntu, albeit with slightly different versions.

Running the clean and compile commands that I gave earlier only deletes and then recompiles the multisig.js file. There is no reason it would make http.server start throwing errors. There is something strange in OP's set up which is messing everything up.
legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
I did quick testing on Debian 11 and it seems to works. But i can't verify whether it works on next step since i only have 3 xpub generated from https://coinb.in/#newHDaddress. Here are the steps,

1. Check my environment.

Code:
$ node --version
v12.22.12
$ npm --version
7.5.2
$ python3 --version
Python 3.9.2
$ python2 --version
Python 2.7.18

2. Setup and run multisig-tool.

Code:
$ git clone --depth 1 https://github.com/dlajarretie/multisig-tool
Cloning into 'multisig-tool'...
remote: Enumerating objects: 29, done.
remote: Counting objects: 100% (29/29), done.
remote: Compressing objects: 100% (28/28), done.
remote: Total 29 (delta 0), reused 12 (delta 0), pack-reused 0
Receiving objects: 100% (29/29), 109.27 KiB | 34.00 KiB/s, done.
$ cd multisig-tool/
$ npm install

added 149 packages, and audited 150 packages in 1m

9 vulnerabilities (1 moderate, 4 high, 4 critical)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.
$ npm install bip38 crypto-browserify --save

added 3 packages, and audited 153 packages in 19s

9 vulnerabilities (1 moderate, 4 high, 4 critical)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.
$ ./node_modules/.bin/browserify -r bip38 -s Bip38 > lib/multisig/bip38.js
$ make compile
cd lib/multisig && \
../../node_modules/.bin/browserify -r ./vault -r ./views/addresses_view > ../../multisig.js
$ make run
cd lib/multisig && \
../../node_modules/.bin/browserify -r ./vault -r ./views/addresses_view > ../../multisig.js
python -m SimpleHTTPServer
Serving HTTP on 0.0.0.0 port 8000 ...
...

3. Open on Firefox by typing localhost:8000, enter 3 xpub and click continue. Here's the screenshot some time after i click continue.



Take note i assume it works since,
1. Firefox only show error message about favicon on it's console (F12).
2. I do not see "Failed!" message or each address turning red.
newbie
Activity: 14
Merit: 5
Being unable to find a favicon file is irrelevant. This is simply the little logo icon that different websites use.

In the absence of any other errors, something is stopping your browser from correctly fetching the balances. Your browser can visit other websites normally? You don't have any firewall or similar running?

The first thing I would try would be to open a terminal in the usual multisig tool directory, and then run the following two commands:
Code:
make clean
make compile

The first will delete the multisig.js file (which is responsible for this look up); the second will recompile it from scratch. This is to rule out any error in the file.

If that doesn't work then I'm afraid I'm running out of ideas... Huh

-Firewall is inactive.
-I am connected to a VPN however.
-Tried both Firefox and Chrome.

After the make clean & make compile command, I did the "python3 -m http.server" again but this time got this error: BrokenPipeError: [Errno 32] Broken pipe

Also Chrome's F12 now shows 165 issues:
-
Quote
Access to XMLHttpRequest at 'https://insight.bitpay.com/api/addr/3CSa...zYGno8MTeLYGM/utxo' from origin 'http://0.0.0.0:8000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
-
Quote
Failed to load resource: net::ERR_FAILED insight.bitpay.com/a…YGno8MTeLYGM/utxo:1

(Changed the address in the error code just in case it's not safe to share publicly).

The other issues are basically a repeat of the above but with all the other addresses in the list.

Btw, user "HCP" also mentioned something about the "Insight API" missing in this thread: https://bitcointalksearch.org/topic/--5316286

Quote from: WillyAP
If that doesn work post your permission sets of the folders/files which cause issues.
Not sure if ChatGPT explained correctly on how to do this but I typed "ls -l" in the multisig-tool directory and got the following:
Quote
total 572
-rw-rw-r--   1 revived revived   2265 mrt 12 18:12 CONTRIBUTING.md
drwxrwxr-x   2 revived revived   4096 mrt 12 18:12 css
drwxrwxr-x   4 revived revived   4096 mrt 12 19:01 env
-rw-rw-r--   1 revived revived   4610 mrt 12 18:12 index.html
drwxrwxr-x   3 revived revived   4096 mrt 12 18:12 lib
-rw-rw-r--   1 revived revived  11344 mrt 12 18:12 LICENSE
-rw-rw-r--   1 revived revived    428 mrt 12 18:12 Makefile
-rw-rw-r--   1 revived revived 421914 mrt 17 23:00 multisig.js
-rw-rw-r--   1 revived revived    181 mrt 12 18:12 multisig-tool.sublime-project
drwxrwxr-x 142 revived revived   4096 mrt 13 21:17 node_modules
-rw-rw-r--   1 revived revived    704 mrt 12 18:52 package.json
-rw-rw-r--   1 revived revived 100713 mrt 13 21:20 package-lock.json
-rw-rw-r--   1 revived revived   3734 mrt 12 18:12 README.md
member
Activity: 910
Merit: 31
Looking for guilt best look first into a mirror
If that doesn't work then I'm afraid I'm running out of ideas... Huh

If that doesn work post your permission sets of the folders/files which cause issues.
legendary
Activity: 2268
Merit: 18771
Being unable to find a favicon file is irrelevant. This is simply the little logo icon that different websites use.

In the absence of any other errors, something is stopping your browser from correctly fetching the balances. Your browser can visit other websites normally? You don't have any firewall or similar running?

The first thing I would try would be to open a terminal in the usual multisig tool directory, and then run the following two commands:
Code:
make clean
make compile

The first will delete the multisig.js file (which is responsible for this look up); the second will recompile it from scratch. This is to rule out any error in the file.

If that doesn't work then I'm afraid I'm running out of ideas... Huh
newbie
Activity: 14
Merit: 5
What error do you see in the console (F12) now?

:8000/favicon.ico:1          Failed to load resource: the server responded with a status of 404 (File not found)


Also as soon as I go on "http://0.0.0.0:8000/", then the terminal shows these 2 messages:
-code 404, message File not found
-"GET /favicon.ico HTTP/1.1" 404 -
legendary
Activity: 2268
Merit: 18771
What error do you see in the console (F12) now?
newbie
Activity: 14
Merit: 5
Is the alternative "HTTP Server method" the "Running Locally" / make run method?
The make run command simply compiles the multisig.js file (which seems to be working fine for you - you can tell for sure by the presence of a file called multisig.js in your multisig-tool folder), and then attempts to launch an HTTP server. Running an HTTP server is the alternative to trying to launch chrome with --allow-file-access-from-files.

Since the make run command is trying to launch an HTTP server using a Python 2 command, and you have Python 3 installed, then instead of using make run you can just launch the HTTP server directly using the command I gave above:
Code:
python3 -m http.server

You should run it from your multisig-tool folder, the one with "index.html" in it. Open a terminal here and enter the command. If it has worked, it should say something like:
Code:
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/)

Then you just open any web browser, and navigate to that address - http://0.0.0.0:8000. The tool will load and hopefully(!) be fully functional.

Indeed, the multisig.js file is in the multisig-tool folder. However if I'm not mistaken it was already there (the icon however is changed from a notepad thingy to "JS" in big yellow letters).

Also entering "python3 -m http.server" in the same repository terminal did indeed show "Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/)".

And typing "http://0.0.0.0:8000" in the browser did automatically show the Coinbase Multisig Vault recovery tool similar to the web version. However, after entering the 3 xpub keys, I still got the exact same list of addresses, followed by a "Failed!" message and each address turning red, as I did before (using the web version)

legendary
Activity: 2268
Merit: 18771
Is the alternative "HTTP Server method" the "Running Locally" / make run method?
The make run command simply compiles the multisig.js file (which seems to be working fine for you - you can tell for sure by the presence of a file called multisig.js in your multisig-tool folder), and then attempts to launch an HTTP server. Running an HTTP server is the alternative to trying to launch chrome with --allow-file-access-from-files.

Since the make run command is trying to launch an HTTP server using a Python 2 command, and you have Python 3 installed, then instead of using make run you can just launch the HTTP server directly using the command I gave above:
Code:
python3 -m http.server

You should run it from your multisig-tool folder, the one with "index.html" in it. Open a terminal here and enter the command. If it has worked, it should say something like:
Code:
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/)

Then you just open any web browser, and navigate to that address - http://0.0.0.0:8000. The tool will load and hopefully(!) be fully functional.
legendary
Activity: 3472
Merit: 3217
Playbet.io - Crypto Casino and Sportsbook
I think you did it wrong that is why you get this error.
Would you mind to try to put the flag on the launcher properties dialog? Look for the chrome launcher open the properties dialog and you should see something like this below

Code:
/usr/bin/google-chrome %U

And replace it with this

Code:
/usr/bin/google-chrome --allow-access-from-files

This will make  --allow-access-from-files permanent but you can change it later if you didn't need it anymore. And don't forget to re-pin the launcher after modifying it.
member
Activity: 910
Merit: 31
Looking for guilt best look first into a mirror

I also can't make out what you mean by the "python3 -m http.server" command, I have Python 3.10.6 but what do I have to do after I enter that command (and should it be in the multisig-tool respository? I'm sorry, I'm a complete beginner and don't know what I'm doing so I need to know every step no matter how basic it is.

Could well be a permission issue, Linux requieres several permission levels. Have you tried running it as sudo (root)Huh
newbie
Activity: 14
Merit: 5
index.html:1 Access to fetch at 'file:///home/revived/multisig-tool/lib/multisig/bip38.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes
This means your --allow-file-access-from-files isn't working as intended. I've never used Chrome so can't advise otherwise here. I use the alternative HTTP Server method instead, which works just fine. Did you make any headway on that?

The command given above is for Python 2:
Code:
python -m SimpleHTTPServer

If you are using Python 3, try the following command:
Code:
python3 -m http.server

Is the alternative "HTTP Server method" the "Running Locally" / make run method?

I installed the BitcoinJS library. And if I'm not mistaken, I performed BIP38's step 1 & 2 correctly:
Quote
We use the BIP38 library to decrypt the encrypted shared key seeds.

To build the multisig/bip38.js we used:

    1. Install packages with npm: "npm install bip38 crypto-browserify --save"

    2. Use browserify to resolve dependencies: "browserify -r bip38 -s Bip38 > lib/multisig/bip38.js"

However, I haven't been able to figure out what I've to do in this following step:
Quote
Then we amend the "lib/multisig/bip38.js" to support progress callbacks and Web Worker messages handling.

We need this as a separate file, because we're using it with web workers.

I also can't make out what you mean by the "python3 -m http.server" command, I have Python 3.10.6 but what do I have to do after I enter that command (and should it be in the multisig-tool respository? I'm sorry, I'm a complete beginner and don't know what I'm doing so I need to know every step no matter how basic it is.
legendary
Activity: 2268
Merit: 18771
index.html:1 Access to fetch at 'file:///home/revived/multisig-tool/lib/multisig/bip38.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes
This means your --allow-file-access-from-files isn't working as intended. I've never used Chrome so can't advise otherwise here. I use the alternative HTTP Server method instead, which works just fine. Did you make any headway on that?

The command given above is for Python 2:
Code:
python -m SimpleHTTPServer

If you are using Python 3, try the following command:
Code:
python3 -m http.server
newbie
Activity: 14
Merit: 5
What is the next step? Am I supposed to open the index.html file? Because using Chrome to simply use the web version is not an option as the API is broken (I tried it again, which resulted into "Failed!" addresses.)
Yes, open your local copy of index.html.

Once you open it, hit F12 on your keyboard and click on the Console tab. Does it show you any errors?

Ah good to see your reply Leo!

It only says the following:
Quote
index.html:1 Access to fetch at 'file:///home/revived/multisig-tool/lib/multisig/bip38.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome, https, chrome-untrusted.
lib/multisig/bip38.js:1          Failed to load resource: net::ERR_FAILED
multisig.js:136                  Uncaught (in promise) TypeError: Failed to fetch
    at require.2 (multisig.js:136:1)
    at o (multisig.js:1:273)
    at multisig.js:1:324
    at require./vault../address (multisig.js:15193:19)
    at o (multisig.js:1:273)
    at HTMLDocument. (tool.js:14:15)
    at j (jquery-2.1.3.min.js:2:26911)
    at Object.fireWith [as resolveWith] (jquery-2.1.3.min.js:2:27724)
    at Function.ready (jquery-2.1.3.min.js:2:29518)
    at HTMLDocument.I (jquery-2.1.3.min.js:2:29709)
legendary
Activity: 2268
Merit: 18771
What is the next step? Am I supposed to open the index.html file? Because using Chrome to simply use the web version is not an option as the API is broken (I tried it again, which resulted into "Failed!" addresses.)
Yes, open your local copy of index.html.

Once you open it, hit F12 on your keyboard and click on the Console tab. Does it show you any errors?
newbie
Activity: 14
Merit: 5
Quote from: BitMaxz
That is I think it suggests running Chrome with this parameter "--allow-access-from-files"

Could you please tell me how I can set this up in Linux? Would I still need to perform the other steps?

For now, adding parameter --allow-access-from-files when you launch Chrome or chromium-based browser is needed since the current problem is when you execute make run, not silent error when you use the tool on the browser.

I launched Chrome with the "-allow-file-access-from-files"  parameter by typing the following command: "./chrome --allow-file-access-from-files"

What is the next step? Am I supposed to open the index.html file? Because using Chrome to simply use the web version is not an option as the API is broken (I tried it again, which resulted into "Failed!" addresses.)
newbie
Activity: 14
Merit: 5
All your replies are much appreciated.

I will try to install either Debian 11 or one of the older Ubuntu versions.

Quote from: BitMaxz
Why don't you just use the hosted one since it's ready to use?

The hosted version is not working correctly anymore (since years). According to other threads it's due to an SSL handshake error with an api at bipay.com. After inserting the 3 xpub keys in step 1, it generates a list of empty addresses followed by the "failure" message next to each address.

Quote from: BitMaxz
That is I think it suggests running Chrome with this parameter "--allow-access-from-files"

Could you please tell me how I can set this up in Linux? Would I still need to perform the other steps?
legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
And Ubuntu makes it particularly hard to install Python 2 in recent versions of the distro, so you should start with an older Ubuntu version such as Trusty (14.04) or Precise (12.04) that have Python 2.7 bundled.

Not only Ubuntu, but most newer version of linux distro. And i'd recommend to use Debian 11 since it's newest version of Debian and still ship Python 2.7[1] rather than using EOL version of Ubuntu.

[1] https://packages.debian.org/bullseye/python2.7
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
The error is trying to tell you that you need to install Python (2, not 3). SimpleHTTPServer is a Python 2 class and it has been deleted in Python 3.

And Ubuntu makes it particularly hard to install Python 2 in recent versions of the distro, so you should start with an older Ubuntu version such as Trusty (14.04) or Precise (12.04) that have Python 2.7 bundled.
legendary
Activity: 3472
Merit: 3217
Playbet.io - Crypto Casino and Sportsbook
Never use this Coinbase vault recovery before but based on what I understand from the guide on Github under the "make run" it looks like a permission issue.

Code:
Running locally
If you wish to run the tool locally, you need to do it through a local web server. The easiest way to do that is by running:

make run
This is because we use Web Workers for decrypting your BIP38 encrypted shared key seed, and Web Workers are not permitted to run through the file:/// protocol.

Another alternative is to run Chrome with the --allow-access-from-files parameter.

That is I think it suggests running Chrome with this parameter "--allow-access-from-files"

Why don't you just use the hosted one since it's ready to use?
They do only need the online on the first step when pasting public keys after they found balances you can now turn internet off and start the recovery process.
Pages:
Jump to: