Coder Social home page Coder Social logo

samourai-wallet / samourai-dojo Goto Github PK

View Code? Open in Web Editor NEW
167.0 18.0 80.0 1.63 MB

End-to-end bitcoin wallet backing server for powering Samourai Wallet and other light wallets

Home Page: https://samouraiwallet.com/dojo

License: Other

JavaScript 80.17% Dockerfile 2.63% Shell 11.14% CSS 1.73% HTML 1.20% Smarty 3.14%

samourai-dojo's Issues

Fresh install of v1.1 fails when bitcoind is deactivated

Tested with v1.1 currently in 'develop' branch.

Steps

  • Download archive for branch 'develop' and uncompress on disk,
  • Deactivate the installation of bitcoind in /docker/my-dojo/conf/docker-bitcoind.conf.tpl
  • Launch the installation with "dojo.sh install"

Results

Pulling bitcoind (samouraiwallet/dojo-bitcoind:1.1.0)...
ERROR: The image for the service you're trying to recreate has been removed. If you continue, volume data could be lost. Consider backing up
 your data before continuing.

Continue with the new image? [yN]y
Pulling bitcoind (samouraiwallet/dojo-bitcoind:1.1.0)...
ERROR: pull access denied for samouraiwallet/dojo-bitcoind, repository does not exist or may require 'docker login'

Dojo stops communicating with bitcoind after some time

Sometimes after a day, sometimes after a week of usage, Samourai Wallet can't fetch UTXOs. I check on Dojo and the tracker logs say "Bitcoind rpc unreachable. Retrying in 20 seconds." In fact Bitcoind is running and the rpc is working because other apps (LND, cgminer) are using it no problem. Restarting BItcoind solves the issue. Dojo thinks bitcoind is not ready to use when in fact it is. Side note: There should be a clear indication inside SW which shows if there is connection to Dojo or not. edit: I use Dojo with external bitcoind, running on windows 10.

Suggestion: Use latest bitcoinjs-lib

Hello, I am the current maintainer of BitcoinJS.

Looking through your source, a quick find and replace of bitcoin.HDNode with bitcoin.bip32 should work with the latest version of BitcoinJS Lib.

Also, address generation is much easier with our payments API.

v6 might remove the old address methods since they are redundant at this point.

We also have Psbt support now, so you might be able to encorporate it into some sort of offline signing feature etc. (Though that would probably be client-side and not dojo)

Please let me know if your devs have any questions, you can find me on keybase in the public team bitcoinjslib

Errors in logfile

nginx       | Operation timed out
nginx exited with code 1

and it's not possible to get a connection from the onion browser...

tor         | Aug 21 13:55:20.000 [warn] Onion service connection to [scrubbed] failed (connection refused) 

System is: RPi4
All cointainers are up and running.

Blockchains is synced, locally.

Error: Content Security Policy: The page’s settings blocked the loading of a resource

I'm getting the following error message while trying to login.

Please note that this happens only in one of the 3 different TOR browsers I've used.

But on this specific machine, I cannot login to the onion address and admin page. I've tried reinstalling the browser but the error persists.

When checking the browser console there are several error messages like the below:

Content Security Policy: The page’s settings blocked the loading of a resource at http://[address].onion/admin/index.js (“script-src”).

Make upgrade process more resilient to extra characters

If extra characters (like space or tab) are mistakenly added before the name of a property in a docker-.conf file, the upgrade process overwrites the value of the property with the default value set in the docker-.conf.tpl file.

We should make the upgrade process more tolerant to this kind of error.

Docker compose script fails to setup database tables/schemas

After a lot of failures (:cry:) I've concluded that the docker-compose script does not actually setup a operational Dojo stack.

1_db.sql.tpl gets copied to 1_db.sql here and then is never used again. This means that the database is at no point initialized and thus the entity of Dojo doesn't work (Oops, guess I'm the first non-dev user! 👀).

I assume this code should also contain another block above that is roughly:

if [ -f /docker-entrypoint-initdb.d/1_db.sql ]; then
  mysql -h"db" -u"root" -p"$MYSQL_ROOT_PASSWORD" "$MYSQL_DATABASE" < /docker-entrypoint-initdb.d/1_db.sql
  echo "Updated database with 1_db.sql"
fi

Dojo with exposed bitcoind ports doesn't start (linux)

Reproduced on OS: Linux & Windows
Reproduced on Dojo:: v1.1 & develop

Steps to reproduce the issue

- stop dojo

- edit docker-bitcoind.conf and set
BITCOIND_RPC_EXTERNAL=on
BITCOIND_RPC_EXTERNAL_IP=127.0.0.1

- start dojo

Error

WARNING: The BITCOIND_RPC_EXTERNAL_IP variable is not set. Defaulting to a blank string.
ERROR: The Compose file '/home/ubuntu/API-Server-refactoring-node8/docker/my-dojo/overrides/bitcoind.rpc.expose.yaml' is invalid because:
services.bitcoind.ports contains an invalid type, it should be a number, or an object
services.bitcoind.ports contains an invalid type, it should be a number, or an object
services.bitcoind.ports contains an invalid type, it should be a number, or an object
services.bitcoind.ports contains an invalid type, it should be a number, or an object
services.bitcoind.ports contains an invalid type, it should be a number, or an object

Improve documentation of the API

Documentation of the API should make clear that some endpoints (endpoints using HTTP POST requests) are expecting parameters passed in the body of the request and in URL encoded format.

Bootstapping to Tor

Tor unable to get past 5% Bootstrapping

When running dojo setup, I'm unable to connect to Tor, SSL state failed. however, I'm able to install and run Tor service outside the docker.

I'm not sure what the issue is, as I'm clearly not being blocked by ISP and have multiple Tor services running currently. For some reason this will not allow me to connect.

I've also ensured timezone is accurate. Tried a restarting dojo, and restarting the Tor docker alone. Still unresolved.

Is it possible to add Bridges, as that seems to be the fix on every forum I've read. Issue being, I'm unable to install obfs4 inside the docker in order to add the bridges arg in the torrc.

I saw the previous enhancement and hack, is this a plausible solution for this case?

Change condition determining the Tracker mode?

On startup, the tracker determines its catchup mode by checking the height of the tip on the full node.

This condition doesn't seem adequate for the users who run Dojo on top of an external bitcoind which is already synchronized (=> the tracker switches in "normal" mode and download all the blocks since block 1).

Now that Dojo allows the use of an external bitcoind, it might be better to check the height of the tip in the database in order to determine the catchup mode.

External bticoind not tracking new blocks

Describe the issue
Using an external bitcoind I am getting the following output almost all the time, after the dojo catches up to the head block.

$ ./dojo.sh logs tracker
[20191215 16:09:15.977 071 MiB] Processing inactive Mempool (0 transactions)
[20191215 16:09:25.981 071 MiB] Processing inactive Mempool (0 transactions)
[20191215 16:09:34.448 072 MiB] Processing unconfirmed transactions
[20191215 16:09:34.451 072 MiB]  Finished processing unconfirmed transactions 0.0s, 0 tx, 0ms/tx
[20191215 16:09:35.979 072 MiB] Processing inactive Mempool (0 transactions)
[20191215 16:09:45.982 072 MiB] Processing inactive Mempool (0 transactions)
[20191215 16:09:55.979 072 MiB] Processing inactive Mempool (0 transactions)
[20191215 16:10:05.983 072 MiB] Processing inactive Mempool (0 transactions)
[20191215 16:10:15.984 072 MiB] Processing inactive Mempool (0 transactions)
[20191215 16:10:25.980 072 MiB] Processing inactive Mempool (0 transactions)

My Whirlpool is up-to-date initially but then gets further and further out of date because the dojo doesn't find any new blocks! I would expect that the dojo would track the new blocks coming in, even if using and external bitcoind.

Screenshots
My settings in the .conf file are:

#
# INSTALL AND RUN BITCOIND INSIDE DOCKER
#

# Install and run bitcoind inside Docker
# Set this option to 'off' for using a bitcoind hosted outside of Docker (not recommended)
# Value: on | off
BITCOIND_INSTALL=off

# IP address of bitcoind used by Dojo
# Set value to 172.28.1.5 if BITCOIND_INSTALL is set to 'on'
# Type: string
BITCOIND_IP=172.17.0.1

# Port of the RPC API
# Set value to 28256 if BITCOIND_INSTALL is set to 'on'
# Type: integer
BITCOIND_RPC_PORT=8332

# Port exposing ZMQ notifications for raw transactions
# Set value to 9501 if BITCOIND_INSTALL is set to 'on'
# Type: integer
BITCOIND_ZMQ_RAWTXS=18502

# Port exposing ZMQ notifications for block hashes
# Set value to 9502 if BITCOIND_INSTALL is set to 'on'
# Type: integer
BITCOIND_ZMQ_BLK_HASH=18501

These are the logs I get when restarting the dojo.

$ ./dojo.sh restart                                                                                                                                                              
Stopping nginx  ... done                                                                                                                                                                                                                      
Stopping nodejs ... done                                                                                                                                                                                                                      
Stopping tor    ... done                                                                                                                                                                                                                      
Stopping db     ... done                                                                                                                                                                                                                      
Removing nginx  ... done                                                                                                                                                                                                                      
Removing nodejs ... done                                                                                                                                                                                                                      
Removing tor    ... done                                                                                                                                                                                                                      
Removing db     ... done                                                                                                                                                                                                                      
Removing network my-dojo_dojonet                                                                                                                                                                                                              
Removing network my-dojo_dmznet                                                                                                                                                                                                               
Creating network "my-dojo_dojonet" with driver "bridge"                                                                                                                                                                                       
Creating network "my-dojo_dmznet" with driver "bridge"                                                                                                                                                                                        
Creating tor    ... done                                                                                                                                                                                                                      
Creating db  ... done                                                                                                                                                                                                                         
Creating nodejs ... done                                                                                                                                                                                                                      
Creating nginx  ... done                                                                                                                                                                                                                      
$ ./dojo.sh logs tracker                                                                                                                                                         
[20191215 16:22:06.041 072 MiB] Processing inactive Mempool (0 transactions)                                                                                                                                                                  
[20191215 16:22:16.041 072 MiB] Processing inactive Mempool (0 transactions)                                                                                                                                                                  
[20191215 16:22:26.044 072 MiB] Processing inactive Mempool (0 transactions)                                                                                                                                                                  
[20191215 16:22:36.042 072 MiB] Processing inactive Mempool (0 transactions)                                                                                                                                                                  
[20191215 16:22:46.045 072 MiB] Processing inactive Mempool (0 transactions)                                                                                                                                                                  
[20191215 16:22:56.045 072 MiB] Processing inactive Mempool (0 transactions)                                                                                                                                                                  
[20191215 16:23:06.046 072 MiB] Processing inactive Mempool (0 transactions)                                                                                                                                                                  
[20191215 16:23:16.046 072 MiB] Processing inactive Mempool (0 transactions)                                                                                                                                                                  
[20191215 16:23:26.047 072 MiB] Processing inactive Mempool (0 transactions)                                                                                                                                                                  
[20191215 16:23:36.047 072 MiB] Processing inactive Mempool (0 transactions)                                                                                                                                                                  
[20191215 16:24:05.719 045 MiB] Process ID: 140                                                                                                                                                                                               
[20191215 16:24:05.723 045 MiB] Preparing the tracker                                                                                                                                                                                         
[20191215 16:24:05.826 044 MiB] Created a database pool of 10 connections                                                                                                                                                                     
[20191215 16:24:05.856 044 MiB] HTTP server listening on port 8082                                                                                                                                                                            
[20191215 16:24:07.388 044 MiB] Tracker Startup (normal mode)                                                                                                                                                                                 
[20191215 16:24:07.397 044 MiB] Sync 24 blocks                                                                                                                                                                                                
[20191215 16:24:07.459 047 MiB] Beginning to process new block.                                                                                                                                                                               
[20191215 16:24:08.664 086 MiB]  Added block 608214 (id=608232)                                                                                                                                                                               
[20191215 16:24:08.740 088 MiB]  Finished block 608214, 1.2s, 1028 tx, 1ms/tx                                                                                                                                                                 
[20191215 16:24:08.855 090 MiB] Beginning to process new block.                                                                                                                                                                               
[20191215 16:24:10.017 101 MiB]  Added block 608215 (id=608234)                                                                                                                                                                               
[20191215 16:24:10.091 101 MiB]  Finished block 608215, 1.2s, 1214 tx, 1ms/tx                                                                                                                                                                 
[20191215 16:24:10.228 105 MiB] Beginning to process new block.                                                                                                                                                                               
[20191215 16:24:12.821 121 MiB]  Added block 608216 (id=608235)                                                                                                                                                                               
[20191215 16:24:12.944 122 MiB]  Finished block 608216, 2.6s, 2704 tx, 1ms/tx                                                                                                                                                                 
[20191215 16:24:13.056 125 MiB] Beginning to process new block.                                                                                                                                                                               
[20191215 16:24:14.966 133 MiB]  Added block 608217 (id=608236)                                                                                                                                                                               
[20191215 16:24:15.061 134 MiB]  Finished block 608217, 2.0s, 1845 tx, 1ms/tx                                                                                                                                                                 
[20191215 16:24:15.195 138 MiB] Beginning to process new block.                                                                                                                                                                               
[20191215 16:24:17.303 128 MiB]  Added block 608218 (id=608237)                                                                                                                                                                               
[20191215 16:24:17.410 128 MiB]  Finished block 608218, 2.2s, 2175 tx, 1ms/tx                                                                                                                                                                 
[20191215 16:24:17.595 132 MiB] Beginning to process new block.                                                                                                                                                                               
[20191215 16:24:19.298 130 MiB]  Added block 608219 (id=608238)                                                                                                                                                                               
[20191215 16:24:19.403 130 MiB]  Finished block 608219, 1.7s, 1721 tx, 1ms/tx                                                                                                                                                                 
[20191215 16:24:19.554 135 MiB] Beginning to process new block.                               
.
.
.
[20191215 16:24:47.325 151 MiB]  Finished block 608230, 2.6s, 2805 tx, 1ms/tx
[20191215 16:24:47.405 153 MiB] Beginning to process new block.
[20191215 16:24:48.138 131 MiB]  Added block 608231 (id=608250)
[20191215 16:24:48.222 131 MiB]  Finished block 608231, 0.8s, 651 tx, 1ms/tx
[20191215 16:24:48.478 140 MiB] Beginning to process new block.
[20191215 16:24:49.705 126 MiB]  Added block 608232 (id=608251)
[20191215 16:24:49.741 126 MiB]  Finished block 608232, 1.2s, 111 tx, 11ms/tx
[20191215 16:24:49.952 133 MiB] Beginning to process new block.
[20191215 16:24:51.480 140 MiB]  Added block 608233 (id=608252)
[20191215 16:24:51.531 140 MiB]  Finished block 608233, 1.5s, 1115 tx, 1ms/tx
[20191215 16:24:51.723 147 MiB] Beginning to process new block.
[20191215 16:24:53.843 150 MiB]  Added block 608234 (id=608253)
[20191215 16:24:53.907 150 MiB]  Finished block 608234, 2.1s, 1821 tx, 1ms/tx
[20191215 16:24:54.093 157 MiB] Beginning to process new block.
[20191215 16:24:56.173 152 MiB]  Added block 608235 (id=608254)
[20191215 16:24:56.319 140 MiB]  Finished block 608235, 2.2s, 1667 tx, 1ms/tx
[20191215 16:24:56.493 146 MiB] Beginning to process new block.
[20191215 16:24:58.670 154 MiB]  Added block 608236 (id=608255)
[20191215 16:24:58.743 154 MiB]  Finished block 608236, 2.2s, 2115 tx, 1ms/tx
[20191215 16:24:58.908 160 MiB] Beginning to process new block.
[20191215 16:25:01.869 156 MiB]  Added block 608237 (id=608256)
[20191215 16:25:02.047 136 MiB]  Finished block 608237, 3.1s, 3226 tx, 1ms/tx
[20191215 16:25:02.050 136 MiB] Listening for blocks
[20191215 16:25:02.053 136 MiB] Processing unconfirmed transactions
[20191215 16:25:02.055 136 MiB]  Finished processing unconfirmed transactions 0.0s, 0 tx, 0ms/tx
[20191215 16:25:02.058 136 MiB] Listening for pushTx
[20191215 16:25:02.060 136 MiB] Listening for pushTx orchestrator
[20191215 16:25:02.061 136 MiB] Listening for mempool transactions
[20191215 16:25:02.068 136 MiB] Processing active Mempool (0 transactions)
[20191215 16:25:12.070 136 MiB] Processing active Mempool (0 transactions)
[20191215 16:25:22.078 136 MiB] Processing active Mempool (0 transactions)
[20191215 16:25:32.081 136 MiB] Processing active Mempool (0 transactions)
[20191215 16:25:42.083 136 MiB] Processing active Mempool (0 transactions)
[20191215 16:25:52.084 136 MiB] Processing active Mempool (0 transactions)
[20191215 16:26:02.085 070 MiB] Processing active Mempool (0 transactions)
[20191215 16:26:12.086 070 MiB] Processing active Mempool (0 transactions)
[20191215 16:26:22.086 070 MiB] Processing active Mempool (0 transactions)
[20191215 16:26:32.088 070 MiB] Processing active Mempool (0 transactions)

Desktop (please complete the following information):

  • OS: Ubuntu v18.04
  • Dojo Version 1.3.0
  • External bitcoind used in a docker-compose setup

Additional context
I'm using my docker-compose setup for the full node here: https://github.com/dmp1ce/lnd-tor-docker-compose

Appropriate steps for getting XPUB

I'm following the steps below but not being able to get XPUB information resulting in an error:
Cannot GET /xpub/xpub123456[...]

Steps taken:

  1. Get authentication token from a POST request to:
    url: http://[my_onion_address]/v2/auth/login
    post_fields: {"apikey": [my_API_key]}
    Result: Success with Json:
    {'authorizations': {'access_token': 'my_token', 'refresh_token': 'my_token'}}

  2. Use the access_token to send a POST request to add HD address:
    url: http://[my_onion_address]/v2/xpub
    post_fields: {"xpub": [my_xpub], "type": "new", "at": [my_at]}
    Result: Success with Json:
    {"status": "ok"}

  3. Send a GET request to receive details of HD address:
    url: http://[my_onion_address]/v2/xpub/[my_xpub]/info?at=[my_at]
    Result: Fails - receive message back:
    Cannot GET /xpub/xpub123456[...]/info

Note:
By changing the GET url to:
http://[my_onion_address]/v2/support/xpub/[my_xpub]/info?at=[my_at]

An error json is returned:

{
  "status": "error",
  "error": "Your current access rights do not allow this operation"
}

I would believe I'm probably using the wrong url path for the GET request.

Tor Logs

Wondering if these are problems by any chance...

./dojo.sh logs tor output:

tor | Jun 09 22:48:54.836 [warn] CookieAuthFileGroupReadable is set, but will have no effect: you must specify an explicit CookieAuthFile to have it group-readable.

Adding debug=tor to bitcoin.conf, so ./dojo.sh logs bitcoind output:

2019-06-09T23:21:58Z tor: Error connecting to Tor control socket
2019-06-09T23:21:58Z tor: Not connected to Tor control port 127.0.0.1:9051, trying to reconnect

Bitcoind docker image not supported on ARM devices

x86_64-linux build of Bitcoind is pulled here

Replacing it with https://bitcoincore.org/bin/bitcoin-core-0.18.0/bitcoin-0.18.0-arm-linux-gnueabihf.tar.gz (and commenting out the SHA256 check) works fine (though then that'd obviously break x86_64 support). This needs to be determined at build time.

Shutdown of Dojo and bitcoind

When Dojo is stopped with "dojo.sh stop", we have a delay of 15s between the shutdown of bitcoind and the shutdown of all docker containers.

The sweet spot for the duration of the delay seems to depend on multiple factors (hardware, operations processed by bitcoind before the shutdown, etc).

If the delay is too short, bitcoind will rewind the chain on next startup (takes a lot of time). On the other hand, a long static delay doesn't seem like a good tradeoff in term of UX.

It might be a good idea to replace the static delay by a loop testing if bitcoind is still up.

Bitcoind RPC API is still unreachable

I had successfully installed dojo on macOS Mojave using docker.
Blockchain also started downloading.. but somewhere in between , system restarted on its own.

Now I am getting this is tracker logs:
Bitcoind RPC API is still unreachable ... and it keeps waiting for the blocks.
Any issue with tor? I am not sure whats going on. Any help is appreceated

Redirect to Maintenance Tool url

It seems that many users forget to append "/admin" after the onion address when trying to access the Maintenance Tool.

As a small UX improvement, it might be a good idea to redirect "/" to "/admin".

Wallet connected to Dojo takes a minute to sync

Describe the issue
Dojo takes a lot of time to sync. It started happening only recently. The biggest bottleneck seems to be the import request/command. It takes more than 40 seconds. Why does it import the same addresses again and again though? Shouldn't this be a one time process? When I send a transaction it also takes 40+ secs to show up in the wallet.

Screenshots
dojo

Desktop (please complete the following information):

  • OS: Ubuntu v18.04.2
  • Dojo Version v1.0.0
  • Dojo Advanced Setups used: external bitcoind

Additional context
The VM runs on 4 cores and has 2.5 GiB RAM. It uses ~1.8GiB

Expose bitcoind RPC API to the host machine

It seems that some users are willing to use the bitcoind packaged in docker as a source for external apps running on the docker host (e.g;: LN node, etc).

May be we could expose the port of the RPC API to the localhost, with something like

bitcoind:
  ports:
    - "127.0.0.1:28256:28256"

Support for regtest

It seems dojo does not support regtest network right now. It would be great if dojo can support regtest for better development.

Suggestion: alternatives for initial block download

Initial block download is still a bottleneck for any Bitcoin project requiring a full synch.

Although this is a somewhat controversial topic (particularly a torrent for a recent synched blockchain), there is a tradeoff. Users could be up and running faster if the process is optimized.

A suggestion is to include on the Dojo script something similar to what the RaspiBlitz project has done, giving users other alternatives:
ssh5-blockchain2

The script to perform this action is available here

Can't pair testnet wallet with testnet dojo

Describe the issue
I'm not able to pair my testnet wallet (version 0.99.87, commit 16926a8) with my testnet dojo (v1.2.0 for testnet), any suggestions on how to troubleshoot? after creating a new wallet and pairing via QR code I check if the xpub or upub in the dojo admin xpub info tab and it says it's not tracked.. I confirmed by sending testnet coin and it's not received in the wallet

Is there something I need to do with my NODE_API_KEY when I build my wallet? or is it loaded in the QR code pairing process?

Desktop (please complete the following information):

  • OS: Ubuntu 18.04.3 LTS
  • Dojo Version 1.2.0 for testnet
  • Dojo Advanced Setups: no changes to config except to change from mainnet to testnet

Additional context
I side-loaded a fresh wallet build from latest develop branch, selected testnet when starting. I then paired to dojo admin pairing QR code.

On Pruned bitcoind support

I had my dojo connected to a pruned bitcoind on a raspberry pi the other day and it seems to be working just fine. The node container successfully imported all the blocks' headers into mysql db container and I could pair my mobile Samourai-Wallet and Whirlpool-gui with it. Everything works as if my bitcoind was an archiving node.

My question is: If users don't want to import their existing seeds/keys; is it correct to say Dojo supports pruned bitcoind out of the box?

I believe supporting pruned bitcoind will bring more users to the Samourai ecosystem.

API always responds {"status":"ok"}

Hello,

my Bitcoind is still syncing. Still, I'm trying to hit the API (exposed by Nginx on port 80 right) but it always responds {"status":"ok"}, and whatever is the URL I curl.

ex: curl -X GET https://myserver/autezdzd ---> {"status":"ok"}

Also, Nginx and Nodejs docker images doesn't log anything.

Any idea?

Thanks a lot :)

Please add documentation about how to use a pre-existing bitcoind installation

I very much appreciate the beginner friendly setup method.
I suspect there are quite a number of intermediate users who already run a full node and would like to add dojo on top of it without fouling up their current bitcoin demon.

The install script may be able to handle this already (I am wary to test it on my lightning node server without knowing what will happen).
If that is the case then please just update the documentation to explain what will happen if you run the setup script on a Linux machine already running bitcoind.

Great Work!

Improve the transaction cache

Describe the bug
The transaction cache managed by lib.bitcoind-rpc.Transaction ignores the "fees" parameter.
As a result, if the endpoint GET /tx is first called without the fees parameter, next calls to the endpoint will return the cached version even if the "fees" parameter is set

Expected behavior
The fees paraemter should be part of the key used to identify the entries of the transactions cache.

Running out of memory because of bitcoind

Hello,

here is my bitcoind config file ~/services/samourai-dojo/docker/my-dojo/conf/docker-bitcoind.conf:

# Max number of connections to network peers
# Type: integer
BITCOIND_MAX_CONNECTIONS=16

# Mempool maximum size in MB
# Type: integer
BITCOIND_MAX_MEMPOOL=1024

# Db cache size in MB
# Type: integer
BITCOIND_DB_CACHE=2024

# Number of threads to service RPC calls
# Type: integer
BITCOIND_RPC_THREADS=6

But still, bitcoind is eating up machine's memory as you can see here:
docker-stats

and here:
Screenshot from 2019-08-28 17-31-52

Eachtime, it won't sync further than 2016/10 (crash before, and then kind of start over). It's been running for two weeks...

My machine has 4Gb of ram.

Thanks for your inputs!

Testnet config

Hello,

is it possible to have two samourai-dojo running on the same machine, but different bitcoin chain?

  • one for Bitcoin mainnet
  • another one for Bitcoin testnet

Thank you!

Using Dojo with Electrum Personal Server

Describe the issue

This is regarding Electrum Personal Server using Dojo as its bitcoin node:
chris-belcher/electrum-personal-server#148

In dojo bitcoind configuration, seems that RPC can be configured not to go through tor.

So, dojo and eps are actually incompatible at this point, only because of walletdisabled setting.
Is that right?

Desktop (please complete the following information):

  • OS: Debian 9
  • Dojo Version 1.2.0
  • Dojo Advanced Setups used none

BTCPayServer-Docker integration

Is your feature request related to a problem? Please describe.
We have a similar docker-compose builder system for btpayserver at https://github.com/btcpayserver/btcpayserver-docker, which also deploys a full bitcoin node(and optionally with txindex and unpruned) along with a tor node.

Describe the solution you'd like
It would be nice to either or else find a simplified wayc to deploy dojo through the plugin system inbtcpayserver-docker(some info here: https://github.com/btcpayserver/btcpayserver-docker#how-can-i-customize-the-generated-docker-compose-file). I think it should be fairly easy:

  • build and publish docker images for dojo( no need for bitcoind, tor and mysql from what I can tell)
  • allow specifying all needed options to connect dojo to custom mysql, bitcoind and tor
  • allow auto generation of the auth token stuff
  • create docker fragment in BTCPay( started messing about with this at Kukks/btcpayserver-docker@031e647)

Describe alternatives you've considered
Have an option here to interoperate with that setup but I think it would just be overhead here

Bug - Impossible to restore addresses

@pxsocs is having issues on Telegram with importing new addresses and getting their balance, and I think(?) I might know why:

  1. In getWalletInfo() we add all new pubkeys to the DB
  2. On the next line, we call walletInfo.ensureAddresses()
  3. ensureAddresses() checks every address we're attempting to import against those in the database, it then calls addrService.restoreAddresses() on all the addresses that are NOT in the database

Only issue is, all the addresses ARE in the database because we just imported them in step 1.

Commenting out the line referenced in step 1 resolves this issue. Now multiaddr takes awhile to import new addresses:

image

And returns their balances:

image

install tor from archive of source files

A most welcome addition, however, there's one problem. Tor is still being built by cloing the git repo at torproject.com. If access to torproject.com is blocked, this doesn't work. Alternative would be to download the source from a website clone. For example: https://www.theonionrouter.com/tor-0.3.5.8.tar.gz

If the script were changed to pull the source tar instead of cloning from git a potential blocked user could edit the dockerfile and enter a clone he has access to.

Originally posted by @burcakbaskan in #74 (comment)

Add a random delay to broadcast scheduled transactions

Assuming I'm reading the code correctly, scheduled transactions are broadcast immediately after a new block is mined.

For example, imagine we had a transaction scheduled for block 3:

Block height Time Transaction broadcast/time
1 +0 minutes False
2 +10 minutes False
3 +20 minutes True, at +20 minutes
4 +30 minutes False

An attacker could assume that this transaction might have been scheduled. Compare this to:

Block height Time Transaction broadcast/time
1 +0 minutes False
2 +10 minutes False
3 +20 minutes True, at +25 minutes
4 +30 minutes False

Where an attacker could be sure the transaction was not scheduled as it came between two different blocks (and thus was not triggered by a block being mined).

Adding a random time after the target block (say, 0 seconds to 20 minutes) would prevent an attacker from determining that any transactions broadcast between two blocks were not broadcasted by Dojo's implementation of scheduled transactions.

2nd option (Full install using Docker for MacOS) - Is not working on Mac

I followed all steps in option 2 - (Full install using Docker for MacOS).

  1. Docer installed
  2. tor is installed
  3. Dojo copied on the relevant path.

Stuck at step ./dojo.sh install
It is giving me error "Line 7, too many arguments". It seems this .sh script is not supported.
Any idea whats going on. Did sombebody test it yet?

Installation stuck at mysqld installation

During the first installation, the computer crashed and had to be reboot (this happened when bitcoin-d was already verifying blocks).
Then had to restart the installation but now seems to be stuck on the line below.
Screen Shot 2019-06-14 at 9 58 43 AM

Dojo with existing full node

Describe the issue
A clear and concise description of what the issue is.

Maybe there's already Docs on this and I'm blind, but... I already have a full node on my laptop. How can I install of Dojo and use my existing full node/blockchain rather than a new Bitcoin install and IBD inside docker?? I'm not too familiar with Docker, except that I used it to set up BTCPayServer.

Screenshots
If applicable, add screenshots to help explain your problem.
Do not submit screenshots containing PII (logins, passwords, keys, IP addresses, etc)

Desktop (please complete the following information):

  • OS: [e.g. Ubuntu vX.X] -- currently on Windows 10 with Ubuntu subsytem available, and hoping to use this laptop. Alternatively I have another Ubuntu laptop, but, again, that laptop already has a full node on it that I'd prefer to use instead of resync'ing again
  • Dojo Version [e.g. 22]
  • Dojo Advanced Setups used (external bitcoind, bitcoind exposed to external apps, etc) -- this is what I'm looking for--Dojo with external bitcoind

Additional context
Add any other context about the problem here.
I'm on Windows 10 (with Docker), but have the Ubuntu subsystem available. Not sure how much that will complicate things.

Restrict access to the Maintenance Tool

It"s currently possible to sign in with the AdminKey or the ApiKey.

Access rights to the different features are properly enforced but allowing the authentication with the ApiKey may mislead users who mistakenly used the ApiKey instead of the AdminKey.

Proposed solution: reject authentication to the maintenance tool with the ApiKey

Websocket API

Hi,

is there a websocket API to notify the client that a wallet balance changed?

Thanks!

Tor service is unable to connect to directory server.

When I run the installation (with my own Bitcoin full node) I see the tor service hung up at 5% with the following error messages:

tor | Jul 13 01:24:21.000 [warn] Problem bootstrapping. Stuck at 5%: Connecting to directory server. (No route to host; NOROUTE; count 8; recommendation warn; host FE296180018833AF03A8EACD5894A614623D3F76 at 149.56.45.200:9001)
tor | Jul 13 01:24:21.000 [warn] 7 connections have failed:
tor | Jul 13 01:24:21.000 [warn] 7 connections died in state connect()ing with SSL state (No SSL object)
tor | Jul 13 01:24:21.000 [warn] Problem bootstrapping. Stuck at 5%: Connecting to directory server. (No route to host; NOROUTE; count 9; recommendation warn; host 7EA6EAD6FD83083C538F44038BBFA077587DD755 at 194.109.206.212:443)

It retries every minute or so but never succeeds to connect. Someone has any idea what that could be?
Regards
Tobi

Maintenance Tool - Display error messages

Suggestion from a user: display error messages related to the rescan of an address/xpub in the UI of the Maintenance Tool (instead of the generic "Rescan complete").

bitcoind exited with code 126

after upgrading to version 1.2.0

nginx is up-to-date
Attaching to bitcoind, nginx, nodejs, db, tor
bitcoind exited with code 126
nginx       | Operation timed out
bitcoind    | wait-for-it.sh: tor:9050 is available after 0 seconds
bitcoind    | ## Start bitcoind #############################
bitcoind    | /restart.sh: line 42: /usr/local/bin/bitcoind: cannot execute binary file: Exec format error
bitcoind exited with code 126

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.