Questions tagged [bash]

13 questions
3
votes
1 answer

How to get the balance of a wallet using only bash interface?

I need to get the balance of specifics wallets only by using bash terminal tools without installing anything new to the OS (An old customized Ubuntu Server) Any idea how to do it? Thanks in advance.
3
votes
1 answer

Bitcoin: error parsing json in bashscript to send BTC using sendmany command

I am simulating a bitcoin network on my machine for which I have written a bash script to simulate the transactions between the nodes. When I use the sendmany option of bitcoin-cli to send transactions I am getting an json parsing error reported by…
bawejakunal
  • 507
  • 2
  • 10
3
votes
2 answers

How to Compress Public Key with OpenSSL / Bash

I generate the private and the public keys in Shell like that: openssl ecparam -name secp256k1 -rand /dev/random -genkey -noout -out private-key.pem openssl ec -in private-key.pem -outform DER | tail -c +8 | head -c 32 | xxd -p -c 32 >…
2
votes
0 answers

How to convert a bitcoin address to the respective hash160 using bash?

I want to convert a list of bitcoin addresses to their respective hash160 values as illustrated using bash :
Aurigae
  • 664
  • 1
  • 4
  • 14
1
vote
1 answer

Exit bitcoind gracefully in a bash script

I'm writing a bash script for some Bitcoin / Lightning experiments. I want to start bitcoind in the background (and also LN instances, but they are not the focus of this question). I want the script to shutdown bitcoind gracefully and exit on…
Sergei Tikhomirov
  • 1,430
  • 7
  • 17
1
vote
2 answers

Converting WIF as Base58 string to byte array in bash

I want to convert wif as Base58 string to byte array. Private key to WIF printf 800C28FCA386C7A227600B2FE50B7CAE11EC86D3BF1FBE471BE89827E19D72AA1D507A5B8D | xxd -r -p | base58 5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTJ Now I want…
monkeyUser
  • 960
  • 1
  • 7
  • 18
1
vote
1 answer

Failed to start lnd.service: Unit bitcoind.service not found. (lnd installation)

I installed my bitcoind and lnd correctly. I put my datadir=/mnt/vdb to bitcoind.conf file and it allows me to start bitcoind with this command: bitcoind -daemon. As a final step, I want to learn lnd sudo service lnd start Failed to start…
1
vote
1 answer

Here is bash script that auto transfers from hot to cold wallet upon threshhold met. Do you see issues?

The idea is to run this via cron job at some interval and have the excess of funds transfered to cold wallet address. So, I thought it will be easier to open source it so I can give it to the community and have it reviewed at the same time by more…
1
vote
0 answers

How can I hash a block header using bitcoin-cli and terminal commands?

I would like to hash a block header using terminal commands and look at all the pretty leading 0s, but I can't figure out how to do this correctly using block header data from bitcoin-cli. Here is what I tried: # get the block header of a recent…
vnprc
  • 365
  • 1
  • 10
1
vote
1 answer

How to regularly restart bitcoind after some period of time on Linux

If, like me you wish to automatically restart bitcoind after some period of time, or if it crashes at least it will restart sometime on it's own you know that it can take a long time on Linux before process cache finishes writing to disk and then…
Willtech
  • 3,186
  • 2
  • 13
  • 42
0
votes
1 answer

electrum wallet listaddress without change addresses

i use the command electrum listaddresses -w .electrum/testnet/wallets.... On a bash console to get all addresses of the wallet. This however also return the "change" addresses which i cannot actually use on my project. Is there anyway to filter…
0
votes
1 answer

Command lnd not found even after installing lnd

I tried installing lnd using the commands shown in the installation guide. I used these commands: git clone https://github.com/lightningnetwork/lnd cd lnd make install but when I try running the lnd command, I get this: Command 'lnd' not found I…
AidenFive
  • 25
  • 4
0
votes
0 answers

Shell Script - Block Sequence check and add missing block

I am trying to scan blocks lets say from 1 to 10. lets say (3,1,4,8,2,7,9,10) min block = 1 , max block = 10 expected sequence = 1 to 10 missing blocks= 5,6 I need a shell script that is going to pick up the missing block in the range and add them…