Last active
June 2, 2020 21:01
-
-
Save 05nelsonm/ba9e2722a1abc8f69e163aefe110b1e7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
All credit goes to Mark Engelberg (https://github.com/Engelberg) for figuring this out! | |
His original writeup can be found at: | |
https://gist.github.com/Engelberg/aac9da2f27b723683982d187bd4d5ea4 | |
Thought I'd just write more of a follow along tutorial for the less technical | |
## Written for use with Ubuntu Desktop 18.04 LTS & Dojo v1.0.0 ## | |
## Stop your Dojo | |
$ cd /path/to/docker/my-dojo/ && sudo ./dojo.sh stop | |
## Modify the docker-compose.yaml file | |
$ nano docker-compose.yaml | |
## Under the section for `bitcoind` add: | |
ports: | |
- "127.0.0.1:28256:28256" | |
## Save and exit | |
ctrl+x --> y --> return | |
#### Your bitcoind section should now look something like the following #### | |
bitcoind: | |
image: "samouraiwallet/dojo-bitcoind:1.0.0" | |
container_name: bitcoind | |
build: | |
context: ./bitcoin | |
env_file: | |
- ./.env | |
- ./conf/docker-bitcoind.conf | |
restart: on-failure | |
command: "/wait-for-it.sh tor:9050 --timeout=360 --strict -- /restart.sh" | |
expose: | |
- "28256" | |
- "9501" | |
- "9502" | |
ports: | |
- "127.0.0.1:28256:28256" | |
volumes: | |
- data-bitcoind:/home/bitcoin/.bitcoin | |
depends_on: | |
- db | |
- tor | |
networks: | |
dojonet: | |
ipv4_address: 172.28.1.5 | |
################# Installing Electrs (Electrum Personal Server made in the Rust programming language) ###################### | |
## Reference the install guide found at https://github.com/romanz/electrs/blob/master/doc/usage.md | |
## in case there are changes from the following directions. | |
## Install needed packages | |
$ sudo apt-get update && sudo apt-get install clang cmake cargo | |
## Building Electrs | |
$ cd ~ && git clone https://github.com/romanz/electrs | |
$ cd electrs | |
$ cargo build --release | |
## Takes about 10-20 minutes | |
## After the build is complete, start your Dojo | |
$ cd /path/to/docker/my-dojo/ && sudo ./dojo.sh start | |
## Start Electrs and let it build it's index (took my VM about 5 hours), | |
## and as of today (June 2019) the size of the index is ~ 49G | |
*** Be sure to update the following command to reflect your Dojo RPC Username and RPC Password under the `--cookies=` flag *** | |
$ cd ~/electrs && cargo run --release -- -vvv --timestamp --db-dir ./db --electrum-rpc-addr="127.0.0.1:50001" --cookie="dojorpcuser:dojorpcpassword" --daemon-rpc-addr="127.0.0.1:28256" --jsonrpc-import | |
################################# Make a .desktop file while it's indexing for quicker launching! ########################## | |
## Open a new terminal | |
$ cd ~/electrs | |
## Download the app icon for your new .desktop file | |
$ wget https://www.weusecoins.com/images/company/electrum.png | |
$ mv electrum.png electrum_personal_server_logo.png | |
## Create the .desktop file | |
$ sudo nano /usr/share/applications/electrs.desktop | |
## Copy and paste the code below (between the --------------'s ), and make changes that are ***starred***, as well as your Dojo RPC Username and RPC Password under the `--cookies=` flag | |
Begining of electrs.desktop file | |
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
[Desktop Entry] | |
Encoding=UTF-8 | |
Type=Application | |
Version=1.0 | |
Terminal=false | |
Exec=gnome-terminal --title="Electrum Personal Server" --geometry=120x25 --zoom=0.8 -- bash -c 'cd /home/***your user name***/electrs/; cargo run --release -- -vvv --timestamp --db-dir ./db --electrum-rpc-addr="127.0.0.1:50001" --cookie="dojorpcuser:dojorpcpassword" --daemon-rpc-addr="127.0.0.1:28256" --jsonrpc-import | |
Name=Electrum Personal Server | |
Icon=/home/***your user name***/electrs/electrum_personal_server_logo.png | |
Name[en_US]=Electrum Personal Server | |
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
End of electrs.desktop file | |
## Save and exit | |
ctrl+x --> y --> return | |
## Now it should be in your Show Applications tray | |
################################### If you haven't installed Electrum Wallet yet ########################################### | |
## Import ThomasV's (Dev & signer of the Electrum Wallet) PGP key to your keyring | |
$ cd ~/Downloads && wget https://raw.githubusercontent.com/spesmilo/electrum/master/pubkeys/ThomasV.asc | |
$ sudo gpg --import ThomasV.asc | |
$ rm -rf ThomasV.asc | |
## In your browser, head over to https://electrum.org/#download | |
## Follow along the section `Installation from Python sources` | |
## I chose to `Install with PIP` over `Run without installing`, but it's your choice | |
## You'll have to reboot your machine after the install, but if Electrs is still building its index just leave | |
## it be until after it finishes as to not interrupt it | |
## After you reboot your machine, start electrum wallet from a teminal to generate ~/.electrum/ directory | |
$ electrum --oneserver --server localhost:50001:t | |
## Close it | |
## Change Electrum Wallet config to always run with those flags | |
$ electrum setconfig oneserver true | |
$ electrum setconfig server 127.0.0.1:50001:t | |
################################## Make a .desktop file for quicker Electrum Wallet launching! ############################# | |
$ cd ~/.electrum | |
## Download the app icon for your new .desktop file | |
$ wget https://bitcoin.org/img/wallet/electrum.png | |
$ mv electrum.png electrum_logo.png | |
## Create the .desktop file | |
$ sudo nano /usr/share/applications/electrum-wallet.desktop | |
## Copy and paste the code below (between the --------------'s ), and make changes that are ***starred*** | |
## If you chose to not `Install with PIP` and instead are running Electrum Wallet without insalling, modify | |
## the electrum-wallet.desktop `Exec=` portion to reflect that path to run the wallet. Be sure to keep the flags. | |
Begining of electrum-wallet.desktop file | |
---------------------------------------------------------------------------------------------------------------------------- | |
[Desktop Entry] | |
Encoding=UTF-8 | |
Version=1.0 | |
Type=Application | |
Terminal=false | |
Exec=electrum --oneserver --server localhost:50001:t | |
Name=Electrum Wallet | |
Icon=/home/***your user name***/.electrum/electrum_logo.png | |
Name[en_US]=Electrum Wallet | |
---------------------------------------------------------------------------------------------------------------------------- | |
End of electrum-wallet.desktop file | |
## Save and exit | |
ctrl+x --> y --> return | |
## Now it should be in your Show Applications tray | |
## Done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment