Skip to content

Instantly share code, notes, and snippets.

@mburns
Last active February 5, 2021 03:20
Show Gist options
  • Save mburns/181fb1372e316659d9a7a6e54e7f0416 to your computer and use it in GitHub Desktop.
Save mburns/181fb1372e316659d9a7a6e54e7f0416 to your computer and use it in GitHub Desktop.
# npm run bitcoin --scripts-prepend-node-path
> ion@1.0.1 bitcoin /usr/local/src/ion
> node dist/src/bitcoin.js
Environment variable ION_BITCOIN_CONFIG_FILE_PATH undefined, using default path ../json/testnet-bitcoin-config.json instead.
Environment variable ION_BITCOIN_VERSIONING_CONFIG_FILE_PATH undefined, using default ION bitcoin versioning config path ../json/testnet-bitcoin-versioning.json instead.
Creating bitcoin wallet using the import string passed in.
Sidetree bitcoin service configuration:
Collection 'service' found.
Collection 'blocks' found.
Transaction collection already exists.
Checking if bitcoin contains a wallet for 16tZEHugrK3AbNQEi94iQBbLFAEyzghDmc
Checking if bitcoin wallet for 16tZEHugrK3AbNQEi94iQBbLFAEyzghDmc exists
Sending jRPC request: id: miflfrciie, method: getaddressinfo
Error: Fetch failed [500]: {"result":null,"error":{"code":-5,"message":"Invalid address"},"id":"miflfrciie"}
at BitcoinClient.<anonymous> (/usr/local/src/ion/node_modules/@decentralized-identity/sidetree/dist/lib/bitcoin/BitcoinClient.js:670:31)
at Generator.next (<anonymous>)
at fulfilled (/usr/local/src/ion/node_modules/@decentralized-identity/sidetree/dist/lib/bitcoin/BitcoinClient.js:5:58)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
Sidetree-Bitcoin node initialization failed with error: {"stack":"Error: Fetch failed [500]: {\"result\":null,\"error\":{\"code\":-5,\"message\":\"Invalid address\"},\"id\":\"miflfrciie\"}\n\n at BitcoinClient.<anonymous> (/usr/local/src/ion/node_modules/@decentralized-identity/sidetree/dist/lib/bitcoin/BitcoinClient.js:670:31)\n at Generator.next (<anonymous>)\n at fulfilled (/usr/local/src/ion/node_modules/@decentralized-identity/sidetree/dist/lib/bitcoin/BitcoinClient.js:5:58)\n at processTicksAndRejections (internal/process/task_queues.js:97:5)","message":"Fetch failed [500]: {\"result\":null,\"error\":{\"code\":-5,\"message\":\"Invalid address\"},\"id\":\"miflfrciie\"}\n"}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ion@1.0.1 bitcoin: `node dist/src/bitcoin.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ion@1.0.1 bitcoin 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! /root/.npm/_logs/2021-02-04T18_10_24_994Z-debug.log
# cat /root/.npm/_logs/2021-02-04T18_10_24_994Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli '/snap/node/3292/bin/node',
1 verbose cli '/snap/node/3292/bin/npm',
1 verbose cli 'run',
1 verbose cli 'bitcoin',
1 verbose cli '--scripts-prepend-node-path'
1 verbose cli ]
2 info using npm@6.14.8
3 info using node@v12.19.0
4 verbose run-script [ 'prebitcoin', 'bitcoin', 'postbitcoin' ]
5 info lifecycle ion@1.0.1~prebitcoin: ion@1.0.1
6 info lifecycle ion@1.0.1~bitcoin: ion@1.0.1
7 verbose lifecycle ion@1.0.1~bitcoin: unsafe-perm in lifecycle true
8 verbose lifecycle ion@1.0.1~bitcoin: PATH: /snap/node/3292/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/usr/local/src/ion/node_modules/.bin:/snap/node/3292/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle ion@1.0.1~bitcoin: CWD: /usr/local/src/ion
10 silly lifecycle ion@1.0.1~bitcoin: Args: [ '-c', 'node dist/src/bitcoin.js' ]
11 silly lifecycle ion@1.0.1~bitcoin: Returned: code: 1 signal: null
12 info lifecycle ion@1.0.1~bitcoin: Failed to exec bitcoin script
13 verbose stack Error: ion@1.0.1 bitcoin: `node dist/src/bitcoin.js`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/snap/node/3292/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:314:20)
13 verbose stack at ChildProcess.<anonymous> (/snap/node/3292/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:314:20)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid ion@1.0.1
15 verbose cwd /usr/local/src/ion
16 verbose Linux 5.4.0-54-generic
17 verbose argv "/snap/node/3292/bin/node" "/snap/node/3292/bin/npm" "run" "bitcoin" "--scripts-prepend-node-path"
18 verbose node v12.19.0
19 verbose npm v6.14.8
20 error code ELIFECYCLE
21 error errno 1
22 error ion@1.0.1 bitcoin: `node dist/src/bitcoin.js`
22 error Exit status 1
23 error Failed at the ion@1.0.1 bitcoin script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
testnet=1
server=1
datadir=/data/bitcoin
rpcuser=admin
rpcpassword=SECRET
txindex=1
{
"bitcoinDataDirectory": "/data/bitcoin",
"bitcoinFeeSpendingCutoffPeriodInBlocks": 1,
"bitcoinFeeSpendingCutoff": 0.001,
"bitcoinPeerUri": "http://localhost:18332",
"bitcoinRpcUsername": "admin",
"bitcoinRpcPassword": SECRET,
"bitcoinWalletOrImportString": GENERATED,
"databaseName": "ion-testnet-bitcoin",
"genesisBlockNumber": 1900000,
"logRequestError": true,
"mongoDbConnectionString": "mongodb://localhost:27017/",
"port": 3002,
"sidetreeTransactionFeeMarkupPercentage": 1,
"sidetreeTransactionPrefix": "ion:",
"transactionPollPeriodInSeconds": 60,
"valueTimeLockUpdateEnabled": false,
"valueTimeLockAmountInBitcoins": 0,
"valueTimeLockPollPeriodInSeconds": 600,
"valueTimeLockTransactionFeesAmountInBitcoins": 0.0001
}
{
"batchingIntervalInSeconds": 600,
"blockchainServiceUri": "http://127.0.0.1:3002",
"databaseName": "ion-testnet-core",
"didMethodName": "ion:test",
"ipfsHttpApiEndpointUri": "http://127.0.0.1:5001",
"maxConcurrentDownloads": 20,
"mongoDbConnectionString": "mongodb://localhost:27017/",
"observingIntervalInSeconds": 60,
"port": 3000
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment