Advanced Bitcoin Scripting - Discussion

Hi! I’m getting an error when trying to run bitcoin-cli: 32601
It looks like my bitcoind has trouble with DNS…
Help :pleading_face:

Hello sir, could you please send an screenshot or post the log of the console? so i can have even more detailed info about the issue you are facing. :slightly_smiling_face:

Remember you can use the “Preformatted Text” Button to encapsulate any kind of code you want to show.


I am a happy Preformatted Text box, please use me wisely!

If you have any doubt, please let us know so we can help you! :slight_smile:

Carlos Z.

PS C:\Program Files\Bitcoin\daemon> ./bitcoind -regtest
2020-05-18T16:01:39Z Bitcoin Core version v0.19.1 (release build)
2020-05-18T16:01:39Z Validating signatures for all blocks.
2020-05-18T16:01:39Z Setting nMinimumChainWork=0000000000000000000000000000000000000000000000000000000000000000
2020-05-18T16:01:39Z Using the 'sse4(1way),sse41(4way)' SHA256 implementation
2020-05-18T16:01:39Z Default data directory C:\Users\Arthimis\AppData\Roaming\Bitcoin
2020-05-18T16:01:39Z Using data directory C:\Users\Arthimis\AppData\Roaming\Bitcoin\regtest
2020-05-18T16:01:39Z Config file: C:\Users\Arthimis\AppData\Roaming\Bitcoin\bitcoin.conf (not found, skipping)
2020-05-18T16:01:39Z Using at most 125 automatic connections (2048 file descriptors available)
2020-05-18T16:01:39Z Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
2020-05-18T16:01:39Z Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
2020-05-18T16:01:39Z Using 2 threads for script verification
2020-05-18T16:01:39Z scheduler thread start
2020-05-18T16:01:39Z libevent: getaddrinfo: nodename nor servname provided, or not known
2020-05-18T16:01:39Z Binding RPC on address ::1 port 18443 failed.
2020-05-18T16:01:39Z HTTP: creating work queue of depth 16
2020-05-18T16:01:39Z No rpcpassword set - using random cookie authentication.
2020-05-18T16:01:39Z Generated RPC authentication cookie C:\Users\Arthimis\AppData\Roaming\Bitcoin\regtest\.cookie
2020-05-18T16:01:39Z HTTP: starting 4 worker threads
2020-05-18T16:01:39Z Using wallet directory C:\Users\Arthimis\AppData\Roaming\Bitcoin\regtest\wallets
2020-05-18T16:01:39Z init message: Verifying wallet(s)...
2020-05-18T16:01:39Z Using BerkeleyDB version Berkeley DB 4.8.30: (April  9, 2010)
2020-05-18T16:01:39Z Using wallet C:\Users\Arthimis\AppData\Roaming\Bitcoin\regtest\wallets
2020-05-18T16:01:40Z BerkeleyEnvironment::Open: LogDir=C:\Users\Arthimis\AppData\Roaming\Bitcoin\regtest\wallets\database ErrorFile=C:\Users\Arthimis\AppData\Roaming\Bitcoin\regtest\wallets\db.log
2020-05-18T16:01:40Z init message: Loading banlist...
2020-05-18T16:01:40Z Cache configuration:
2020-05-18T16:01:40Z * Using 2.0 MiB for block index database
2020-05-18T16:01:40Z * Using 8.0 MiB for chain state database
2020-05-18T16:01:40Z * Using 440.0 MiB for in-memory UTXO set (plus up to 286.1 MiB of unused mempool space)
2020-05-18T16:01:40Z init message: Loading block index...
2020-05-18T16:01:40Z Opening LevelDB in C:\Users\Arthimis\AppData\Roaming\Bitcoin\regtest\blocks\index
2020-05-18T16:01:40Z Opened LevelDB successfully
2020-05-18T16:01:40Z Using obfuscation key for C:\Users\Arthimis\AppData\Roaming\Bitcoin\regtest\blocks\index: 0000000000000000
2020-05-18T16:01:40Z LoadBlockIndexDB: last block file = 0
2020-05-18T16:01:40Z LoadBlockIndexDB: last block file info: CBlockFileInfo(blocks=1, size=293, heights=0...0, time=2011-02-02...2011-02-02)
2020-05-18T16:01:40Z Checking all blk files are present...
2020-05-18T16:01:40Z Opening LevelDB in C:\Users\Arthimis\AppData\Roaming\Bitcoin\regtest\chainstate
2020-05-18T16:01:41Z Opened LevelDB successfully
2020-05-18T16:01:41Z Using obfuscation key for C:\Users\Arthimis\AppData\Roaming\Bitcoin\regtest\chainstate: c863b95a4a985dfc
2020-05-18T16:01:41Z Loaded best chain: hashBestChain=0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206 height=0 date=2011-02-02T23:16:42Z progress=1.000000
2020-05-18T16:01:41Z init message: Rewinding blocks...
2020-05-18T16:01:41Z init message: Verifying blocks...
2020-05-18T16:01:41Z  block index             880ms
2020-05-18T16:01:41Z init message: Loading wallet...
2020-05-18T16:01:41Z BerkeleyEnvironment::Open: LogDir=C:\Users\Arthimis\AppData\Roaming\Bitcoin\regtest\wallets\database ErrorFile=C:\Users\Arthimis\AppData\Roaming\Bitcoin\regtest\wallets\db.log
2020-05-18T16:01:41Z [default wallet] Wallet File Version = 169900
2020-05-18T16:01:41Z [default wallet] Keys: 2003 plaintext, 0 encrypted, 2003 w/ metadata, 2003 total. Unknown wallet records: 0
2020-05-18T16:01:41Z [default wallet] Wallet completed loading in             305ms
2020-05-18T16:01:41Z [default wallet] setKeyPool.size() = 2000
2020-05-18T16:01:41Z [default wallet] mapWallet.size() = 0
2020-05-18T16:01:41Z [default wallet] mapAddressBook.size() = 2
2020-05-18T16:01:41Z block tree size = 1
2020-05-18T16:01:41Z nBestHeight = 0
2020-05-18T16:01:41Z torcontrol thread start
2020-05-18T16:01:41Z Bound to [::]:18444
2020-05-18T16:01:41Z Bound to 0.0.0.0:18444
2020-05-18T16:01:41Z init message: Loading P2P addresses...
2020-05-18T16:01:41Z Imported mempool transactions from disk: 0 succeeded, 0 failed, 0 expired, 0 already there
2020-05-18T16:01:41Z Loaded 0 addresses from peers.dat  30ms
2020-05-18T16:01:41Z init message: Starting network threads...
2020-05-18T16:01:41Z net thread start
2020-05-18T16:01:41Z dnsseed thread start
2020-05-18T16:01:41Z init message: Done loading
2020-05-18T16:01:41Z opencon thread start
2020-05-18T16:01:41Z addcon thread start
2020-05-18T16:01:41Z msghand thread start
2020-05-18T16:01:41Z 0 addresses found from DNS seeds
2020-05-18T16:01:41Z dnsseed thread exit

Ok, lets try the following, close those windows, restart the process again following these steps:

Step 1: Start bitcoind

./bitcoind -printtoconsole -regtest

Step 2: Open a new powershell for bitcoin-cli
Generate a new address with bitcoin-cli (skip if you have one)

./bitcoin-cli -regtest getnewaddress

Step 3: Generate 101 blocks to the address

./bitcoin-cli -regtest generatetoaddress 101 [pasteAddress]

Important: the address should be pasted without the brakets
Step 4: Check Balance

./bitcoin-cli -regtest getbalance

Step 5: Check UTXO

./bitcoin-cli -regtest listunspent

The message means that no DNS seeds were found (which is normal, as regtest has no DNS seeds), and thus that it will fall back to its builtin list of fixed seed nodes (which regtest has 0 of).

In other words, the message is harmless and the artifact of DNS/seed logic that doesn’t really apply to regtest.

Hope you find this useful! :slight_smile:

If you have any doubt, please let us know so we can help you!

Carlos Z.

Thank you for your help!

1 Like

I have the same error and looking to the missing part video but can find it. Do you have en URL to the missing video or do I overlook something, watched all the clips but come not through the error: Assertion Failed. Thanks!

Thanks Carlos that was very useful.

Please could you give me some pointers as to how to install the bitcoin core client under Linux (i.e bitcoind, bitcoin-qt and bitcoin-cli)?

I’ve installed VirtualBox and Ubuntu (in the end on an old Mac that I was able to upgrade to MacOS 10.13.6, since I hit issues on my Windows-10 laptop). I’ve learnt some Linux basics and have installed curl and then NodeJS (following your guidance). From the terminal I ran a small NodeJs test program to print ‘hello’ to the terminal, so all looks good.

Before I restart the ‘Advanced Bitcoin Scripting’ section of the course (under Linux) with setup to install bcoin. I assume that I’ll first need to install the Bitcoin Core client (ie. bitcoind, bitcoin-qt and bitcoin-cli).
I therefore did some googling about how to install this under Linux (Ubuntu) and found this article ( https://www.linuxbabee.com/ubuntu/install-bitcoin-core-wallet-ubuntu ). But when executing the first command in my Linux terminal, I get the following:

mark@MUBU-vm:~$ sudo add-apt-repository ppa:bitcoin/bitcoin
[sudo] password for mark:
NOT MAINTAINED. The OS-library linking packages here had a series of issues.

PLEASE DOWNLOAD DIRECTLY FROM bitcoincore.org (and verify the signatures of said files).

IF YOU WANT AUTO-UPDATES, please see the officially-maintained snap package -


More info: https://launchpad.net/~bitcoin/+archive/ubuntu/bitcoin
Press [ENTER] to continue or Ctrl-c to cancel adding it.
^C

Please can you give me any pointers as to how to install Bitcoin Core client under Linux?

1 Like

Ok, its really easy if you download the Linux (tgz) (compressed file), after that you only need to decompress it on a folder of your choice.

Here is a guide so you can understand how to use unpack a tgz file: HowTo: Unpack .tgz File On a Linux.
If you still need some guidance, just let me know.

Hope you find this useful. :slight_smile:

If you have any doubt, please let us know so we can help you!

Carlos Z.

Thanks. I’ve downloaded Bitcoin Core 0.22.0, and uncompressed it (in a folder directly beneath my home directory). And to test I’ve used bitcoind/bitcoin-cli in regtest mode to generate 103 blocks (with listunspent showing 150 bitcoin as expected). However, I when I try to send some of this bitcoin to another address I get a “Fee Estimation Error” - see below:

mark@MUBU-vm:~/bitcoin-0.20.0/bin$ ./bitcoin-cli -regtest getnewaddress
bcrt1ql6cfhnnu9jdamw3e8j34h20hqg55tunm4fjz8y
mark@MUBU-vm:~/bitcoin-0.20.0/bin$ ./bitcoin-cli -regtest sendtoaddress bcrt1ql6cfhnnu9jdamw3e8j34h20hqg55tunm4fjz8y 10
error code: -4
error message:
Fee estimation failed. Fallbackfee is disabled. Wait a few blocks or enable -fallbackfee.

I think this may be related to the configure file/script being missing. i.e when I start bitcoind I get the following:

mark@MUBU-vm:~/bitcoin-0.20.0/bin$ ./bitcoind -regtest
2020-06-08T10:14:25Z Bitcoin Core version v0.20.0 (release build)
2020-06-08T10:14:25Z Validating signatures for all blocks.
2020-06-08T10:14:25Z Setting nMinimumChainWork=0000000000000000000000000000000000000000000000000000000000000000
2020-06-08T10:14:25Z Using the ‘sse4(1way),sse41(4way)’ SHA256 implementation
2020-06-08T10:14:25Z Default data directory /home/mark/.bitcoin
2020-06-08T10:14:25Z Using data directory /home/mark/.bitcoin/regtest
2020-06-08T10:14:25Z Config file: /home/mark/.bitcoin/bitcoin.conf (not found, skipping)

etc, etc …

Looking at the release notes for Bitcoin Core 0.20.0 (bicoincore.org/en/releases/0.20.0) under ‘Known Bugs’ it says:

Known Bugs

The process for generating the source code release (“tarball”) has changed in an effort to make it more complete, however, there are a few regressions in this release:

  • The generated configure script is currently missing, and you will need to install autotools and run ./autogen.sh before you can run ./configure . This is the same as when checking out from git.
  • Instead of running make simply, you should instead run BITCOIN_GENBUILD_NO_GIT=1 make .

I therefore installed autotools (or think I have) by issuing the following command:
mark@MUBU-vm:~$ sudo apt-get install autotools-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following NEW packages will be installed
autotools-dev
0 to upgrade, 1 to newly install, 0 to remove and 101 not to upgrade.
Need to get 39.6 kB of archives.
After this operation, 161 kB of additional disk space will be used.
Get:1 http://gb.archive.ubuntu.com/ubuntu focal/main amd64 autotools-dev all 20180224.1 [39.6 kB]
Fetched 39.6 kB in 0s (397 kB/s)
Selecting previously unselected package autotools-dev.
(Reading database … 229097 files and directories currently installed.)
Preparing to unpack …/autotools-dev_20180224.1_all.deb …
Unpacking autotools-dev (20180224.1) …
Setting up autotools-dev (20180224.1) …
Processing triggers for man-db (2.9.1-1) …
mark@MUBU-vm:~$

However, I’m not sure what I do next (in terms of … "run ./autogen.sh before you can run ./configure" ).
I assume once I have a configure file, there will be a setting for the fallbackfee in that file which will resolve the ‘fee estimation error’ that I’m receiving).

Am I on the right track to resolving this “Fee estimation failed” ie. by trying to get a configure file in place? And are you able to help with what commands I need to run next to restore the configuration file? Or offer any other guidance as to how I can resolve this issue?

1 Like

Hi Carlos,

Aside from the Bitcoin Core 0.22.0 “Fee estimation Error” I describe in my previous post today. I’ve pressed ahead and tried to install bcoin tool (under Ubuntu 20.04) using the terminal.

However, after ‘npm init’, the ‘npm install coin’ gives me errors starting with “npm ERR! code ENOENT” (see below) - any suggestion as to what I should try next to get bcoin successfully installed?

mark@MUBU-vm:/media/sf_IvanOnTechAcademy/BiticoinProgram101/multisigproject$ npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.

See npm help init for definitive documentation on these fields
and exactly what they do.

Use npm install <pkg> afterwards to install a package and
save it as a dependency in the package.json file.

Press ^C at any time to quit.
package name: (multisigproject)
version: (1.0.0)
description:
entry point: (address.js)
test command:
git repository:
keywords:
author:
license: (ISC)
About to write to /media/sf_IvanOnTechAcademy/BiticoinProgram101/multisigproject/package.json:

{
“name”: “multisigproject”,
“version”: “1.0.0”,
“description”: “”,
“main”: “address.js”,
“scripts”: {
“test”: “echo “Error: no test specified” && exit 1”
},
“author”: “”,
“license”: “ISC”
}

Is this OK? (yes)
mark@MUBU-vm:/media/sf_IvanOnTechAcademy/BiticoinProgram101/multisigproject$
mark@MUBU-vm:/media/sf_IvanOnTechAcademy/BiticoinProgram101/multisigproject$
mark@MUBU-vm:/media/sf_IvanOnTechAcademy/BiticoinProgram101/multisigproject$ npm install bcoin
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /media/sf_IvanOnTechAcademy/BiticoinProgram101/multisigproject/node_modules/bl/node_modules/readable-stream/node_modules/safe-buffer/package.json.587731211
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open ‘/media/sf_IvanOnTechAcademy/BiticoinProgram101/multisigproject/node_modules/bl/node_modules/readable-stream/node_modules/safe-buffer/package.json.587731211’
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR! /home/mark/.npm/_logs/2020-06-08T16_15_47_500Z-debug.log
mark@MUBU-vm:/media/sf_IvanOnTechAcademy/BiticoinProgram101/multisigproject$

Hello sir, i think you should follow the steps after you install autotools.

Yes, the issue could be easy to solve, it’s probably a configuration file that you need to change the value of some few parameters.

Just curious, I suppose you are using root permissions when you run bitcoind & -cli right?

If you have any doubt, please let us know so we can help you! :slight_smile:

Carlos Z.

It’s said, no such file or directory, or it’s a permission adjustment issue or the file really does not exist.

Have you tried to run the same command with root permissions?:

sudo npm install bcoin

Also, I really have not try ubuntu 20 yet, but just to discard some issues, it is possible you install ubuntu 18.04 instead, probably some tools are not yet upgraded to ubuntu 20, but this probably would not work, still just another issue to discard maybe.

does the file exist? or the installation fail? the only 2 possible problems that i see is, permissions to manipulate the folder or file, OR something related to ubuntu 20 (incompatibility) but its probable.

You did not mention if you try all the commands with root, thats because i still wondering, maybe that does the trick.

If you have any doubt, please let us know so we can help you! :slight_smile:

Carlos Z.

Hi Carlos,

I re-ran all the bitcoind & bitcoin-cli commands prefixed with sudo, and get the same “Fee estimation Error”.

After I have installed autotools (using the command: sudo apt-get install autotools-dev ) then from what directory do I run ./autogen.sh (and subsequently ./configure)?

As when I issue the command: sudo ./autogen.sh (from my home directory or root directory I get the response 'sudo: ./autogen.sh file not found)

Hi Carlos,

I tried ago using “sudo npm install bcoin” as you suggested but got the same error. However, I was using a shared directory for my multisigproject directory and so thought this might be the issue (i.e. lack of permissions on the install, even though i could personally access this shared directory).

Anyway it seems to have got past the error but now throws other warnings and errors. It seems to me to be a permission error again but as I’m executing with sudo, I don’t know why. Any ideas? (please see below)

Mark@MUBUvm:~/Documents/IvanOnTech/BitcoinProg101/multisigproject$ sudo npm install bcoin

[email protected] install /home/mark/Documents/IvanOnTech/BitcoinProg101/multisigproject/node_modules/mrmr
node-gyp rebuild

gyp WARN EACCES current user (“mark”) does not have permission to access the dev dir “/root/.cache/node-gyp/14.4.0”
gyp WARN EACCES attempting to reinstall using temporary dev dir “/home/mark/Documents/IvanOnTech/BitcoinProg101/multisigproject/node_modules/mrmr/.node-gyp”
make: Entering directory ‘/home/mark/Documents/IvanOnTech/BitcoinProg101/multisigproject/node_modules/mrmr/build’
CC(target) Release/obj.target/mrmr/src/murmur3.o
CC(target) Release/obj.target/mrmr/src/mrmr.o
SOLINK_MODULE(target) Release/obj.target/mrmr.node
COPY Release/mrmr.node
make: Leaving directory ‘/home/mark/Documents/IvanOnTech/BitcoinProg101/multisigproject/node_modules/mrmr/build’

[email protected] install /home/mark/Documents/IvanOnTech/BitcoinProg101/multisigproject/node_modules/secp256k1
npm run rebuild || echo “Secp256k1 bindings compilation fail. Pure JS implementation will be used.”

npm ERR! code EACCES
npm ERR! syscall scandir
npm ERR! path /root/.npm/_logs
npm ERR! errno -13
npm ERR!
npm ERR! Your cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed.
npm ERR!
npm ERR! To permanently fix this problem, please run:
npm ERR! sudo chown -R 1000:1000 “/root/.npm”
glob error [Error: EACCES: permission denied, scandir ‘/root/.npm/_logs’] {
errno: -13,
code: ‘EACCES’,
syscall: ‘scandir’,
path: ‘/root/.npm/_logs’
}

etc etc …

That means you are logged with the wrong user, but I think that is not the issue, you have installed ubuntu 20 right? because today i install npm and bitcoin core wallet on a new ubuntu VM 18.04 and everything works great…

What I try:

Download the bitcoin core wallet TAR File, uncompressed it.

wget https://bitcoincore.org/bin/bitcoin-core-0.20.0/bitcoin-0.20.0-x86_64-linux-gnu.tar.gz

tar zxvf bitcoin-0.20.0-x86_64-linux-gnu.tar.gz

Run bitcoind with:

./bitcoind -printtoconsole -regtest

It start great.

Install NPM with:

sudo apt-get update
sudo apt install npm

then initialize npm

npm init

Install bcoin

npm install bcoin

everything works great at the end.

Hi Carlos,

Many Thanks - I’m getting there now, that that was the breakthrough I needed! I installed Ubuntu 18.04 as a new VM (within VirtualBox, running on my MacBook Pro). BitcoinCore, npm, and bcoin all install without errors! I also installed nodeJS successfully! (So it looks like Ubantu 20.04 was the issue in getting this npm installed successfully )

However in testing BitcoinCore (bitcoind & bitcoin-cli) all looked good until I got to use sendtoaddress when I get the ‘Fee estimation failed.’ (please see below), do you also get the same error on you’re cleanly installed version?

And if so (and assuming you fixed it) what exactly were the commands you issued?

mark@ububtu-VirtualBox:~/bitcoin-0.20.0/bin$ ./bitcoin-cli -regtest getnewaddress
bcrt1qly7rnpypammh2sf59uuakms4n9d59d2v7uvzu0
mark@ububtu-VirtualBox:~/bitcoin-0.20.0/bin$ ./bitcoin-cli -regtest getbalance
0.00000000
mark@ububtu-VirtualBox:~/bitcoin-0.20.0/bin$ ./bitcoin-cli -regtest generatetoaddress 101 bcrt1qly7rnpypammh2sf59uuakms4n9d59d2v7uvzu0
[
“4884212e467ad5028c5c3f911b978a7dbe5318359fccff6f6fc3713b65c06c38”,
“0906b9e59580747bb7627665b391bb72c4a030b3c8b809bce3098dce06e6e785”,
“44e8f4ba7fcdfe26f98974c518be31e1497ad34209a3cc3b2534b6893013855f”,
etc etc …
]
mark@ububtu-VirtualBox:~/bitcoin-0.20.0/bin$ ./bitcoin-cli -regtest getbalance
50.00000000
mark@ububtu-VirtualBox:~/bitcoin-0.20.0/bin$ ./bitcoin-cli -regtest generatetoaddress 2 bcrt1qly7rnpypammh2sf59uuakms4n9d59d2v7uvzu0
[
“765937f194c8f517262149bba7238ddd2653650bdb9f93cb6306f0ecd4f294e0”,
“5bb183712b54ebdff0ecba9875f29d6e2e839c45f52f1401bdfad562444259aa”
]
mark@ububtu-VirtualBox:~/bitcoin-0.20.0/bin$ ./bitcoin-cli -regtest getbalance
150.00000000
mark@ububtu-VirtualBox:~/bitcoin-0.20.0/bin$ ./bitcoin-cli -regtest getnewaddress
bcrt1qdmg6anz4qes8dmdt3spd80z2rmncjktu3ljrgs
mark@ububtu-VirtualBox:~/bitcoin-0.20.0/bin$ ./bitcoin-cli -regtest sendtoaddress bcrt1qdmg6anz4qes8dmdt3spd80z2rmncjktu3ljrgs 10
error code: -4
error message:
Fee estimation failed. Fallbackfee is disabled. Wait a few blocks or enable -fallbackfee.
mark@ububtu-VirtualBox:~/bitcoin-0.20.0/bin$

1 Like

Ok this error is weird, sometimes it happens but its not normal, i run my own transaction, everything looks ok.

Now digging a little bit for a solution of that issue, i found this:

It depends on the operating system. Shut down your node. If you are running any Linux distribution then add “-fallbackfee=0.00001” to the launch command e.g. “bitcoind -fallbackfee=0.00001”. If you are running Windows then right-click on the Bitcoin Core executable file, select Properties and add “-fallbackfee=0.00001” after the file extension. The fallback fee will be set to 1 sat/byte which should be enough for now. By default, it’s 20 sat/byte if you don’t specify the value.

Practically you have to run:
./bitcoind -printtoconsole -regtest -fallbackfee=0.00001

I dont know if it will solve the problem, but at least you can try it.

Hope you find this useful. :slight_smile:

If you have any doubt, please let us know so we can help you!

Carlos Z.

Thanks again Carlos, that worked!!
(Therefore adding the -fallbackfee parameter when starting bitcoind, means that the bitcoin-cli sendtoaddress command now executes successfully - i.e. without the ‘fee estimation failed error’ that I was getting previously.)

That’s everything now installed and apparently working (on my MacBook Pro, with a VirtualBox running Ubuntu 18:04) so that I went to see if I could now resume the ‘Advanced Bitcoin Scripting’ multisig project part of the course, but unfortunately get errors when executing ‘node address.js’ - see below:

This is the contents of the directory from where I run from the following directory:

mark@ub18-04vm:~/Documents/IvanOnTech/BitcoinProg101/multisigproj$ ls -la
total 60
drwxr-xr-x 3 mark mark 4096 Jun 15 12:30 .
drwxr-xr-x 3 mark mark 4096 Jun 11 14:16 …
-rwxrwx— 1 mark mark 442 May 11 21:49 address.js
drwxr-xr-x 118 mark mark 4096 Jun 15 12:27 node_modules
-rw-r–r-- 1 mark mark 280 Jun 15 12:26 package.json

When when I execute: node address.js I get the following errors:

mark@ub18-04vm:~/Documents/IvanOnTech/BitcoinProg101/multisigproj$ node address.js
/home/mark/Documents/IvanOnTech/BitcoinProg101/multisigproj/node_modules/bindings/bindings.js:91
throw e
^

Error: The module ‘/home/mark/Documents/IvanOnTech/BitcoinProg101/multisigproj/node_modules/leveldown/build/Release/leveldown.node’
was compiled against a different Node.js version using
NODE_MODULE_VERSION 57. This version of Node.js requires
NODE_MODULE_VERSION 83. Please try re-compiling or re-installing
the module (for instance, using npm rebuild or npm install).
at Object.Module._extensions…node (internal/modules/cjs/loader.js:1250:18)
at Module.load (internal/modules/cjs/loader.js:1049:32)
at Function.Module._load (internal/modules/cjs/loader.js:937:14)
at Module.require (internal/modules/cjs/loader.js:1089:19)
at require (internal/modules/cjs/helpers.js:73:18)
at bindings (/home/mark/Documents/IvanOnTech/BitcoinProg101/multisigproj/node_modules/bindings/bindings.js:84:48)
at Object. (/home/mark/Documents/IvanOnTech/BitcoinProg101/multisigproj/node_modules/leveldown/leveldown.js:3:36)
at Module._compile (internal/modules/cjs/loader.js:1200:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:1220:10)
at Module.load (internal/modules/cjs/loader.js:1049:32)

I first tried to rebuild (but forgot to use the sudo command) - see below:

mark@ub18-04vm:~/Documents/IvanOnTech/BitcoinProg101/multisigproj$ npm rebuild

[email protected] install /home/mark/Documents/IvanOnTech/BitcoinProg101/multisigproj/node_modules/bcrypto
node-gyp rebuild || echo ‘Build failed.’

make: Entering directory ‘/home/mark/Documents/IvanOnTech/BitcoinProg101/multisigproj/node_modules/bcrypto/build’
CC(target) Release/obj.target/bcrypto/src/aead/aead.o
CC(target) Release/obj.target/bcrypto/src/blake2b/blake2b.o
CC(target) Release/obj.target/bcrypto/src/chacha20/chacha20.o
CC(target) Release/obj.target/bcrypto/src/cipher/cipher.o
CC(target) Release/obj.target/bcrypto/src/ecdsa/ecdsa.o
CC(target) Release/obj.target/bcrypto/src/pbkdf2/pbkdf2.o
CC(target) Release/obj.target/bcrypto/src/poly1305/poly1305.o
CC(target) Release/obj.target/bcrypto/src/random/random.o
CC(target) Release/obj.target/bcrypto/src/rsa/rsa.o
CC(target) Release/obj.target/bcrypto/src/scrypt/insecure_memzero.o
CC(target) Release/obj.target/bcrypto/src/scrypt/sha256.o
CC(target) Release/obj.target/bcrypto/src/scrypt/scrypt.o
CC(target) Release/obj.target/bcrypto/src/sha3/sha3.o
CXX(target) Release/obj.target/bcrypto/src/aead.o
In file included from …/…/nan/nan_converters.h:67:0,
from …/…/nan/nan.h:202,
from …/src/aead.h:5,
from …/src/aead.cc:2:
…/…/nan/nan_converters_43_inl.h: In static member function ‘static Nan::imp::ToFactoryBasev8::Boolean::return_t Nan::imp::ToFactoryv8::Boolean::convert(v8::Localv8::Value)’:
…/…/nan/nan_converters_43_inl.h:18:51: error: no matching function for call to ‘v8::Value::ToBoolean(v8::Localv8::Context)’
val->To ## TYPE(isolate->GetCurrentContext())
^
…/…/nan/nan_converters_43_inl.h:22:1: note: in expansion of macro ‘X’
X(Boolean)
^
In file included from /home/mark/.cache/node-gyp/14.4.0/include/node/node.h:67:0,
from …/src/aead.h:4,
from …/src/aead.cc:2:
/home/mark/.cache/node-gyp/14.4.0/include/node/v8.h:2845:18: note: candidate: v8::Localv8::Boolean v8::Value::ToBoolean(v8::Isolate*) const
Local ToBoolean(Isolate* isolate) const;
^~~~~~~~~

Etc, etc … output messages continue until output ends following:

In file included from /home/mark/.cache/node-gyp/14.4.0/include/node/node.h:67:0,
from …/src/batch.cc:1:
/home/mark/.cache/node-gyp/14.4.0/include/node/v8.h:3034:7: note: candidate: int v8::String::WriteUtf8(v8::Isolate*, char*, int, int*, int) const
int WriteUtf8(Isolate* isolate, char* buffer, int length = -1,
^~~~~~~~~
/home/mark/.cache/node-gyp/14.4.0/include/node/v8.h:3034:7: note: no known conversion for argument 1 from ‘char*’ to ‘v8::Isolate*’
leveldown.target.mk:129: recipe for target ‘Release/obj.target/leveldown/src/batch.o’ failed
make: *** [Release/obj.target/leveldown/src/batch.o] Error 1
make: Leaving directory ‘/home/mark/Documents/IvanOnTech/BitcoinProg101/multisigproj/node_modules/leveldown/build’
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Linux 5.3.0-59-generic
gyp ERR! command “/usr/bin/node” “/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” “rebuild”
gyp ERR! cwd /home/mark/Documents/IvanOnTech/BitcoinProg101/multisigproj/node_modules/leveldown
gyp ERR! node -v v14.4.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: prebuild-install || node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/mark/.npm/_logs/2020-06-15T11_42_54_130Z-debug.log
mark@ub18-04vm:~/Documents/IvanOnTech/BitcoinProg101/multisigproj$

I then tried to install again (this time using sudo) as follows:

mark@ub18-04vm:~/Documents/IvanOnTech/BitcoinProg101/multisigproj$ sudo apt-get update
[sudo] password for mark:
Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Hit:2 http://gb.archive.ubuntu.com/ubuntu bionic InRelease
Get:3 http://gb.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:4 http://gb.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Hit:5 https://deb.nodesource.com/node_14.x bionic InRelease
Fetched 252 kB in 1s (193 kB/s)
Reading package lists… Done
mark@ub18-04vm:~/Documents/IvanOnTech/BitcoinProg101/multisigproj$ sudo apt install npmReading package lists… Done
Building dependency tree
Reading state information… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies.
npm : Depends: nodejs but it is not going to be installed
Depends: node-abbrev (>= 1.0.4) but it is not going to be installed
Depends: node-ansi (>= 0.3.0-2) but it is not going to be installed
Depends: node-ansi-color-table but it is not going to be installed
Depends: node-archy but it is not going to be installed
Depends: node-block-stream but it is not going to be installed
Depends: node-fstream (>= 0.1.22) but it is not going to be installed
Depends: node-fstream-ignore but it is not going to be installed
Depends: node-github-url-from-git but it is not going to be installed
Depends: node-glob (>= 3.1.21) but it is not going to be installed
Depends: node-graceful-fs (>= 2.0.0) but it is not going to be installed
Depends: node-inherits but it is not going to be installed
Depends: node-ini (>= 1.1.0) but it is not going to be installed
Depends: node-lockfile but it is not going to be installed
Depends: node-lru-cache (>= 2.3.0) but it is not going to be installed
Depends: node-minimatch (>= 0.2.11) but it is not going to be installed
Depends: node-mkdirp (>= 0.3.3) but it is not going to be installed
Depends: node-gyp (>= 0.10.9) but it is not going to be installed
Depends: node-nopt (>= 3.0.1) but it is not going to be installed
Depends: node-npmlog but it is not going to be installed
Depends: node-once but it is not going to be installed
Depends: node-osenv but it is not going to be installed
Depends: node-read but it is not going to be installed
Depends: node-read-package-json (>= 1.1.0) but it is not going to be installed
Depends: node-request (>= 2.25.0) but it is not going to be installed
Depends: node-retry but it is not going to be installed
Depends: node-rimraf (>= 2.2.2) but it is not going to be installed
Depends: node-semver (>= 2.1.0) but it is not going to be installed
Depends: node-sha but it is not going to be installed
Depends: node-slide but it is not going to be installed
Depends: node-tar (>= 0.1.18) but it is not going to be installed
Depends: node-underscore but it is not going to be installed
Depends: node-which but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
mark@ub18-04vm:~/Documents/IvanOnTech/BitcoinProg101/multisigproj$

I’m not sure what to try next, any suggestions?

I’m wondering if I have incompatibilities between npm, nodeJS versions (and perhaps bcoin library)?

I therefore tried to set up directly on a late 2011 MacBook Pro running MacOS 10.13.6 : See the following steps & results:

  1. I installed BitcoinCore0.2 (with bitcoind and bitcoin-cli) which installs and runs fine (I had to use the -fallbackfee=0.00002 config parameter again when staring bitcoind to once again avoid the ‘fee estimation failed’ error).
  2. I installed NodeJS (from nodes.org/en/dowload) getting the following successful installation dialog message upon completion of install:
    This package has installed:
    • Node.js v12.18.0 to /usr/local/bin/node
    • npm v6.14.4 to /usr/local/bin/npm
      Make sure that /usr/local/bin is in your $PATH.
  3. From bash terminal, I created a new ‘MultiSigProject’ directory (since under my original ‘multisigproject’ directory there are old files from past install attempts when I was using Ubuntu VM and a shared directory on the Mac - hence I thought best to create a new clean directory)
  4. From within bash terminal, (within ‘MultiSigProject’ directory) I ran npm init but got the following message (after pressing return to accept all defaults):
    " New patch version of npm available! 6.14.4 → 6.14.5 │
    │ Changelog: https://github.com/npm/cli/releases/tag/v6.14.5
    │ Run npm install -g npm to update!
  5. From bash terminal, I therefore did this but got permissions errors and therefore used sudo, ie.
    MMB:MultiSigProj Mark$ sudo npm install -g npm
    Password:
    /usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
    /usr/local/bin/npx -> /usr/local/lib/node_modules/npm/bin/npx-cli.js
  6. From bash terminal: ‘npm init’ (accepting all defaults) which worked fine.
  7. But finally ‘npm install bcoin’ failed with errors, as did running it again with sudo, ie.
MMB:MultiSigProj Mark$ sudo npm install bcoin

> [email protected] install /Users/Mark/Documents/BlockChain/IvanOnTechAcademy/BiticoinProgram101/MultiSigProj/node_modules/leveldown
> prebuild-install || node-gyp rebuild

prebuild-install WARN install No prebuilt binaries found (target=12.18.0 runtime=node arch=x64 platform=darwin)
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/builder.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/db_impl.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/db_iter.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/filename.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/dbformat.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/log_reader.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/log_writer.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/memtable.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/repair.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/table_cache.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/version_edit.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/version_set.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/write_batch.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/helpers/memenv/memenv.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/port/port_posix_sse.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/table/block.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/table/block_builder.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/table/filter_block.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/table/format.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/table/iterator.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/table/merger.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/table/table.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/table/table_builder.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/table/two_level_iterator.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/util/arena.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/util/bloom.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/util/cache.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/util/coding.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/util/comparator.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/util/crc32c.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/util/env.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/util/filter_policy.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/util/hash.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/util/logging.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/util/options.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/util/status.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/port/port_posix.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/util/env_posix.o
  LIBTOOL-STATIC Release/leveldb.a
  CXX(target) Release/obj.target/snappy/deps/snappy/snappy-1.1.4/snappy-sinksource.o
  CXX(target) Release/obj.target/snappy/deps/snappy/snappy-1.1.4/snappy-stubs-internal.o
  CXX(target) Release/obj.target/snappy/deps/snappy/snappy-1.1.4/snappy.o
  LIBTOOL-STATIC Release/snappy.a
  CXX(target) Release/obj.target/leveldown/src/batch.o
In file included from ../src/batch.cc:3:
In file included from ../../nan/nan.h:202:
In file included from ../../nan/nan_converters.h:67:
../../nan/nan_converters_43_inl.h:22:1: warning: 'ToBoolean' is deprecated:
      ToBoolean can never throw. Use Local version. [-Wdeprecated-declarations]
X(Boolean)
^
../../nan/nan_converters_43_inl.h:18:12: note: expanded from macro 'X'
      val->To ## TYPE(isolate->GetCurrentContext())                            \
           ^
<scratch space>:136:1: note: expanded from here
ToBoolean
^
/Users/Mark/Library/Caches/node-gyp/12.18.0/include/node/v8.h:2663:3: note: 
      'ToBoolean' has been explicitly marked deprecated here
  V8_DEPRECATED("ToBoolean can never throw. Use Local version.",
  ^
/Users/Mark/Library/Caches/node-gyp/12.18.0/include/node/v8config.h:328:29: note: 
      expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../src/batch.cc:3:
In file included from ../../nan/nan.h:202:
In file included from ../../nan/nan_converters.h:67:
../../nan/nan_converters_43_inl.h:40:1: warning: 'BooleanValue' is deprecated:
      BooleanValue can never throw. Use Isolate version.
      [-Wdeprecated-declarations]
X(bool, Boolean)
^
../../nan/nan_converters_43_inl.h:37:15: note: expanded from macro 'X'
  return val->NAME ## Value(isolate->GetCurrentContext());                     \
              ^
<scratch space>:143:1: note: expanded from here
BooleanValue
^
/Users/Mark/Library/Caches/node-gyp/12.18.0/include/node/v8.h:2701:3: note: 
      'BooleanValue' has been explicitly marked deprecated here
  V8_DEPRECATED("BooleanValue can never throw. Use Isolate version.",
  ^
/Users/Mark/Library/Caches/node-gyp/12.18.0/include/node/v8config.h:328:29: note: 
      expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../src/batch.cc:3:
In file included from ../../nan/nan.h:203:
In file included from ../../nan/nan_new.h:189:
../../nan/nan_implementation_12_inl.h:103:42: error: no viable conversion from
      'v8::Isolate *' to 'Local<v8::Context>'
  return scope.Escape(v8::Function::New( isolate
                                         ^~~~~~~
/Users/Mark/Library/Caches/node-gyp/12.18.0/include/node/v8.h:186:7: note: 
      candidate constructor (the implicit copy constructor) not viable: no known
      conversion from 'v8::Isolate *' to 'const v8::Local<v8::Context> &' for
      1st argument
class Local {
      ^
/Users/Mark/Library/Caches/node-gyp/12.18.0/include/node/v8.h:186:7: note: 
      candidate constructor (the implicit move constructor) not viable: no known
      conversion from 'v8::Isolate *' to 'v8::Local<v8::Context> &&' for 1st
      argument
/Users/Mark/Library/Caches/node-gyp/12.18.0/include/node/v8.h:190:13: note: 
      candidate template ignored: could not match 'Local<type-parameter-0-0>'
      against 'v8::Isolate *'
  V8_INLINE Local(Local<S> that)
            ^
/Users/Mark/Library/Caches/node-gyp/12.18.0/include/node/v8.h:4276:22: note: 
      passing argument to parameter 'context' here
      Local<Context> context, FunctionCallback callback,
                     ^
In file included from ../src/batch.cc:3:
In file included from ../../nan/nan.h:203:
In file included from ../../nan/nan_new.h:189:
../../nan/nan_implementation_12_inl.h:337:37: error: too few arguments to
      function call, expected 2, have 1
  return v8::StringObject::New(value).As<v8::StringObject>();
         ~~~~~~~~~~~~~~~~~~~~~      ^
/Users/Mark/Library/Caches/node-gyp/12.18.0/include/node/v8.h:5531:3: note: 
      'New' declared here
  static Local<Value> New(Isolate* isolate, Local<String> value);
  ^
In file included from ../src/batch.cc:3:
In file included from ../../nan/nan.h:203:
In file included from ../../nan/nan_new.h:189:
../../nan/nan_implementation_12_inl.h:337:58: error: expected '(' for
      function-style cast or type construction
  return v8::StringObject::New(value).As<v8::StringObject>();
                                         ~~~~~~~~~~~~~~~~^
../../nan/nan_implementation_12_inl.h:337:60: error: expected expression
  return v8::StringObject::New(value).As<v8::StringObject>();

THAT CONTINUES WITH MUCH MORE DEPRECIATION WARNINGS AND VARIOUS ERROR OUTPUT UNTIL IT CONCLUDES WITH THE FOLLOWING:

../src/batch.cc:75:69: error: too few arguments to function call, single
      argument 'context' was not specified
    maybeInstance = Nan::NewInstance(constructorHandle->GetFunction(), 2, argv);
                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/Users/Mark/Library/Caches/node-gyp/12.18.0/include/node/v8.h:6126:3: note: 
      'GetFunction' declared here
  V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
  ^
/Users/Mark/Library/Caches/node-gyp/12.18.0/include/node/v8config.h:368:31: note: 
      expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
14 warnings and 20 errors generated.
make: *** [Release/obj.target/leveldown/src/batch.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 17.7.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/Mark/Documents/BlockChain/IvanOnTechAcademy/BiticoinProgram101/MultiSigProj/node_modules/leveldown
gyp ERR! node -v v12.18.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/Mark/.npm/_logs/2020-06-15T15_13_04_975Z-debug.log

MMB:MultiSigProj Mark$ 

Any ideas of where to go next? (Note: Perhaps it’s better focusing on getting this working directly on my MacBook Pro rather than on the Ubuntu VM. However getting either one working would be great, so that I can finish the Bitcoin programming course!

Hello sir, yeah it can be the version of your npm that you updated.

Now i could recommend to deploy a new linux VM and start at fresh, following this guideline:

Advanced Bitcoin Scripting - Multisig P2SH Transaction commands

Some stuffs to copy/paste in future for Multisig P2SH Transaction for Windows PowerShell

Install NodeJs

Create a folder for Multisig Files

Can be created in a folder of your choice, with the name of your choice

mkdir multisig_project

Initialize npm

inside the multisig_project folder

npm init

Press enter until your back to the folder

Install bcoin package

Tool to be able to create multisig outputs and transactions

npm install bcoin

Might be an error that python is not installed, install it with

npm install python

Create a redeem Script

Check the js file “multisig_address.js” on this repository

Thats the step by step guide to make it run, please do not update anything once you installed.
Still you can try make it work on your MacBook, if that works for you, it could be even better.

Hope you find this useful. :slight_smile:

If you have any doubt, please let us know so we can help you!

Carlos Z.

1 Like

https://www.youtube.com/watch?v=rnC9TEidSrs here is a good link which helped me solve the problem with python and npm install bcoin. I restarted PowerShell after it got installed.

1 Like