3

Eack time I use monero I need to start monerod with a flag (I use a different port) and it is a bit tedious sometimes.

Is it possible to set up a short cut to launch monerod with a flag and cli-wallet at all at once?

I use mac os and I am not very good with command line.

1 Answer 1

4

I'm on macOS and I do the following to accomplish what you are asking:

Create a file called run_monerod.sh that contains the following:

#!/bin/bash
/Full/path/to/monerod --rpc-bind-port 11111

I create this from the Terminal by typing nano run_monerod.sh and then typing the other bit, then saving with cntl+x, y, enter. Finally I make the shell script executable by typing

chmod +x run_monerod.sh

Now I can call it with

./run_monerod.sh

and it runs detached on a different port, instead of having to type all that in every time.


Okay, so what's going on here?

  • the #!/bin/bash is called the "shebang", and basically tells your Mac "hey, this is a bash script." It's not really that necessary, but useful nonetheless.
  • nano is just a really simple text editor that can be used from the terminal
  • chmod +x says "make this executable."

Now, to run your wallet, you could do something similar... Make a file called run_wallet_cli.sh with the same shebang but instead of including the stuff for monerod, include the stuff for monero-wallet-cli that you usually type in the terminal when you're opening the wallet. Lastly, make it executable. When you want to use your wallet, run the monerod script, then once it's open, run the wallet script.


Bonus since macOS:

If you want to be able to click-to-run your scripts instead of running them in the command line, save them as .command instead of .sh. then just click on them in the Finder and have at it!

2
  • Thanks for this. I tried setting it up the same thing for run_wallet_cli.sh, enter my wallet name and get back 'The wallet doesn't exist, generating new one'. Which is wrong. The wallet exists, but using a script to open it, makes /monero-wallet-cli think it doesn't. Any thoughts? Commented Oct 19, 2016 at 10:52
  • 1
    Add "--wallet-file /full/path/to/wallet/file.bin" to your command. On osx, the path probably starts with "/Users/<your username>/..." depending on where you saved your wallet Commented Oct 19, 2016 at 13:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.