Skip to content

Commit

Permalink
Parmanode 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ArmanTheParman committed Apr 8, 2023
0 parents commit 18a0bbe
Show file tree
Hide file tree
Showing 46 changed files with 3,433 additions and 0 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Arman The Parman

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
70 changes: 70 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
Parmanode Plebian Edition: README
08/April/2023


ABOUT

Parmanode is a software package for home computers (Linux, Mac, or Windows)
that comes with an installation wizard so that non-technical users have
the ability to download and verify Bitcoin Core and sync using an external
or internal dirve, and also have configuration options presented to them
with automation. No manual bitcoin.conf file editing will be required.

This edition is for Linux Only.

The aim is that all people need to do is read the menu options carefully -
no command line interaction is required. For example, bitcoin-cli commands
are available in a menu, and pruning can be activated from menu options.

The software also comes with helpful information, including links to various
articles on my website, armantheparmn.com, so that Bitcoiners keep learning
more about Bitcoin and how to be safely self-sovereign. Information on how
to connect various wallets to the node is provided in the menus. Much effort
has not been made for this aspect of the software in the first version; more
will be done later.

The most basic usage would be an internal drive to sync, running the latest
version of Bitcoin Core, and connecting Sparrow Bitcoin Wallet or Specter
Desktop Wallet directly to the node on the same computer.

The initial release is for the Linux user only, and although they are the
ones least likely to need an easy node installation package, this was chosen
so that the code can be more easily written and easier to follow. Later version
will be modified for Mac users. The hardest will be reprogramming for
Windows PowerShell, if ever. The Mac version will require a Docker container
running Linux (installed automatically by the software). Some of the code
for that is done, but I decided halfway through coding that to switch over
to Linux. This avoids the complication of trying to do too many things at
once. Once the Linux version is running smoothly, the Mac version will be
finished.

BITCOIN CORE VERSION included...

Bitcoin 24.01

verification public key: E777299FC265DD04793070EB944D35F9AC3DB76A
User created: bitcoin
Group created: bitcoin


DRIVE STRUCTURE (for when Parmanode software is installed with Bitcoin Core):

Internal drive:

/|--- $HOME ---|
| |--- .bitcoin (may or may not be a symlink)
| |--- .parmanode (config files)
| |--- parmanode ---|
| |--- bitcoin ---| (keeps B core download and pgp stuff)
|--- media ---|
| |--- parmanode ---| (ext drive mountpoint)
| |--- .bitcoin ---| (symlink target)
|
|--- usr --- |--- local ------|--- bin ---| (keeps bitcoin binary files)


If an external drive is used, a symlink on the internal drive will poing to the .bitcoin directory.

/|--- .bitcoin ---|


58 changes: 58 additions & 0 deletions bitcoin/change_drive_selection.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# CHECK CONFIG FOR DRIVE CHOICE, AND OFFER USER TO SWAP CHOICE.

function change_drive_selection {
source $HOME/.parmanode/parmanode.conf

while true
do
set_terminal
if [[ -z "$drive" ]] ; then echo "No drive choice. Something went wrong. Please re-install Parmanande." ; fi
echo "
########################################################################################
You have chosen an $drive drive to run the Bitcoin blockchain data.
(a) to accept and continue
(c) to change
########################################################################################
"
choose "xpq"
read choice

case $choice in

a|A) #user accepts previous drive choice
delete_line "$HOME/.parmanode/parmanode.conf" "drive=" >/dev/null #clean up potential multiple entries before writing.
echo "drive=$drive" >> "$HOME/.parmanode/parmanode.conf" 2>/dev/null
break ;;
c|C) #user wishes to change previous drive choice
set_terminal
echo "Please choose internal (i) or external (e), then <enter>.
"
read drive_swap_choice
#check for valid choice and rename value.
if [[ $drive_swap_choice != "i" && $drive_swap_choice != "e" ]] ; then invalid ; continue ; fi
if [[ $drive_swap_choice == "i" ]] ; then drive_swap_choice="internal" ; fi # saves user from typing "internal" and reduce risk of typo in value.
if [[ $drive_swap_choice == "e" ]] ; then drive_swap_choice="external" ; fi
if [[ $drive_swap_choice == "$drive" ]] # if user ended up choosing what they had already chose before.
then
echo "No change made, continuing. Hit <enter>." ; read ; break
else
delete_line "$HOME/.parmanode/parmanode.conf" "drive=" >/dev/null #clean up potential multiple entries before writing.
echo "drive=$drive_swap_choice" >> "$HOME/.parmanode/parmanode.conf" 2>/dev/null
source $HOME/.parmanode/parmanode.conf #updates drive variable for this shell session.
fi
;;
p|P)
return 1 ;;
q|Q|quit|QUIT)
exit 0 ;;
*)
invalid
;;
esac
done
return 0
}
181 changes: 181 additions & 0 deletions bitcoin/connect_wallet_info.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
function connect_wallet_info {
while true
do
set_terminal_wide
echo "
##############################################################################################################
Bitcoin Wallet Connection Info
To connect your wallet, you need to first wait for the Bitcoin blockchain to finish syncing. You can
inspect the debug.log file (access from Parmanode Bitcoin Core menu) to check its progress in real
time. Any errors with Bitcoin Core will show up here as well.
s) Sparrow Bitcoin Wallet
e) Electrum Desktop Wallet
sd) Specter Desktop Wallet
##############################################################################################################
"
choose "xpq"
read choice
set_terminal_wide
case $choice in
s|S)
sparrow_wallet_info
;;

e|E)
electrum_wallet_info
;;

sd|SD|sD|Sd)
specter_wallet_info
;;

p)
return 0 ;;

q|Q|quit|QUIT)
exit 0
;;

*)
invalid
break
;;

esac
done
return 0
}



function sparrow_wallet_info {
echo "
##############################################################################################################
SPARROW BITCOIN WALLET
Unfortunately, for now, this wallet needs to be on the same computer as the Parmanode software.
In the Sparrow Server settings, use 127.0.0.1 as the IP address and 8332 as the port.
The default connection method in Sparrow uses a cookie. This should work. If it doesn't, you can
change to the \"User/Pass\" method, but you do need to enter a rpcuser and rpcpassword in the
bitcoin.conf file (accessible through Parmanode menu). You then have to restart bitcoind.
If you ever decided to install Fulcrum (an Electrum server) on your Parmanode, then Sparrow will
be able to connect to that instead of directly to Bitcoin Core. If this is enabled, you are not
as limited, and can connect from another computer. Fulcrum will be available for Parmanode in
later versions. Tor will also be available later, allowing you to connect to your Fulcrum
Parmanode server from outsite your home network.
##############################################################################################################
"
enter_continue
return 0
}

function electrum_wallet_info {
echo "
##############################################################################################################
ELECTRUM DESKTOP WALLET
Note that a connection with Electrum Wallet is not possible until Fulcrum Server is installed.
Once Fulcrum is installed, you can connect to it from your Electrum Wallet with the following steps:
1) Go to Electrum Network settings (from menu or the circle on the bottom right)
2) Uncheck \"Select server automatically\"
3) Type the IP address of the computer that runs Parmanode.
You can find this by typing \"ifconfig | grep broadcast\" in your terminal window.
You'll see it as one of the outputs. Typically something like 192.168.0.150
4) If the wallet and Parmanode are on the same computer, you can type either
\"localhost\" or \"127.0.0.1\"
5) If your wallet is not on the same computer as Parmanode, you need to type the IP address
of the Parmanode computer in your wallet.
6) You also MUST type in the port. The default value is 50002. An example would look like:
127.0.0.1:50002
At the top of the network settings window, you will see \"connected to x nodes\". If x is not equal
to 1, you should try to fix that (f).
Instructions to connect to Tor soon.
##############################################################################################################
Type (f) for instructions to connect to only one server, or hit <enter> alone to return.
"
read choice
if [[ $choice == "f" ]] ; then electrum_one_server ; fi
return 0

}

function electrum_one_server {
echo "
##############################################################################################################
Connect Electrum to One Server Only
Unfortunately, this is harder than it needs to be.
You MUST open a Wallet in Electrum at least once. Even a dummy/discardable wallet will do. This will
populate a default config file. Then exit Electrum all together. Shut it down.
Then navigate to $HOME/.electrum
Open the file \"config\". You could open via terminal with \"nano config\"
Modify the line that has \"oneserver\" in it, from \"false\" to \"true\", and do not change the syntax.
Save and exit. You can then open Electrum Wallet, check the network settings and see that you are only
connected to one node.
##############################################################################################################
"
enter_continue
return 0
}

function specter_wallet_info {
echo "
##############################################################################################################
Specter Desktop Wallet:
Newer versions of Specter now allow you to connect not only to Bitcoin Core directly, but to an
Electrum (Fulcrum) server as well.
You need to name the connection to proceed. It's not yet tested, but if it insists on a username and
password, you need to modify the bitcoin.conf file (see the Parmanode Bitcoin menu to access) and
add it in like this:
rpcuser=my_user_name
rpcpassword=my_password
If you make changes to the config file, you need to restart Bitcoin for the changes to take effect.
In Specter Wallet, you'll see http://localhost - leave as is, but if that doesn't work, try
http://127.0.0.1, then finally, click \"Connect\"
##############################################################################################################
"
enter_continue
return 0

}
Loading

0 comments on commit 18a0bbe

Please sign in to comment.