(Tutorial) Configuring Peercoin Proof-of-Stake Minting on OS X

#21

[quote=“jawnzer, post:15, topic:939”]Awesome, really appreciate it Ben. I got stuck up on the same thing. Here’s what I get

total 474904
drwxr-xr-x 20 bradporter staff 680 27 Nov 20:57 .
drwx------+ 41 bradporter staff 1394 19 Nov 19:04 …
-rw-r–r--@ 1 bradporter staff 12292 27 Nov 20:55 .DS_Store
-rw------- 1 bradporter staff 0 10 Nov 10:06 .lock
-rw------- 1 bradporter staff 24576 27 Nov 20:57 __db.001
-rw------- 1 bradporter staff 999424 27 Nov 20:57 __db.002
-rw------- 1 bradporter staff 32776192 27 Nov 20:57 __db.003
-rw------- 1 bradporter staff 1179648 27 Nov 20:57 __db.004
-rw------- 1 bradporter staff 4653056 27 Nov 20:57 __db.005
-rw------- 1 bradporter staff 40960 27 Nov 20:57 __db.006
-rw------- 1 bradporter staff 708608 27 Nov 21:02 addr.dat
-rw------- 1 bradporter staff 116942404 27 Nov 21:03 blk0001.dat
-rw------- 1 bradporter staff 78143488 27 Nov 21:03 blkindex.dat
drwx------ 5 bradporter staff 170 27 Nov 20:59 database
-rw------- 1 bradporter staff 0 10 Nov 10:06 db.log
-rw------- 1 bradporter staff 1929525 27 Nov 21:03 debug.log
-rw-r–r-- 1 bradporter staff 2350 27 Nov 20:54 ppcoin.conf
-rwxr-xr-x@ 1 bradporter staff 5668888 29 Apr 2013 ppcoind
-rw-r–r-- 1 bradporter staff 228 27 Nov 20:57 start.sh
-rw------- 1 bradporter staff 49152 27 Nov 21:03 wallet.dat[/quote]

#22

@jawnzer:

For my start.sh file, locally, I see this:

-rwxrwxr-x 1 benrossi staff 222 Nov 12 13:52 start.sh

Let’s see if updating yours doesn’t get us past this problem. From Terminal, use this command:

$ sudo chmod 775 start.sh

You’ll be prompted for your OS X SYSTEM password (not your wallet passphase) because you used sudo. After that, check the directory’s content permissions to make sure it updated.

$ ls -la

Assuming all went as planned, it should now read:

-rwxrwxr-x 1 bradporter staff 228 27 Nov 20:57 start.sh

Try to re-run ./start.sh to see if you can get past the permissions issue. Let me know if that works.

#23

When I type in chmod, I get no such file or directory

#24

Make sure that you are trying to run that from the PPCoin directory, or, alternatively, from anywhere with:

$ sudo chmod 775 ~/Library/Application\ Support/PPCoin/start.sh
#25

Hi, thank you for all your help. I’m getting this error when running start.sh

I fixed the Permission denied error.

localhost:~ iMac$ cd ~/Library/Application\ Support/PPCoin/
localhost:PPCoin iMac$ ./start.sh
-bash: ./start.sh: Permission denied
localhost:PPCoin iMac$ ./start.sh
-bash: ./start.sh: Permission denied
localhost:PPCoin iMac$ ./start.sh
-bash: ./start.sh: Permission denied
localhost:PPCoin iMac$ ls -la
total 396744
drwxr-xr-x 14 iMac staff 476 Nov 29 00:19 .
drwx------+ 81 iMac staff 2754 Nov 28 23:52 …
-rw-r–r--@ 1 iMac staff 6148 Nov 29 00:19 .DS_Store
-rw------- 1 iMac staff 0 Nov 27 22:54 .lock
-rw------- 1 iMac staff 749568 Nov 29 00:19 addr.dat
-rw------- 1 iMac staff 117832818 Nov 29 00:15 blk0001.dat
-rw------- 1 iMac staff 78594048 Nov 29 00:15 blkindex.dat
drwx------ 3 iMac staff 102 Nov 29 00:19 database
-rw------- 1 iMac staff 0 Nov 27 22:54 db.log
-rw------- 1 iMac staff 214076 Nov 29 00:19 debug.log
-rw-r–r--@ 1 iMac admin 2356 Nov 27 23:22 ppcoin.conf
-rwxr-xr-x@ 1 iMac staff 5668888 Apr 29 2013 ppcoind
-rw-r–r--@ 1 iMac staff 223 Nov 29 00:20 start.sh
-rw------- 1 iMac staff 49152 Nov 29 00:15 wallet.dat
localhost:PPCoin iMac$ sudo chmod 775 start.sh
Password:
localhost:PPCoin iMac$ ls -la
total 396744
drwxr-xr-x 14 iMac staff 476 Nov 29 00:19 .
drwx------+ 81 iMac staff 2754 Nov 28 23:52 …
-rw-r–r--@ 1 iMac staff 6148 Nov 29 00:19 .DS_Store
-rw------- 1 iMac staff 0 Nov 27 22:54 .lock
-rw------- 1 iMac staff 749568 Nov 29 00:19 addr.dat
-rw------- 1 iMac staff 117832818 Nov 29 00:15 blk0001.dat
-rw------- 1 iMac staff 78594048 Nov 29 00:15 blkindex.dat
drwx------ 3 iMac staff 102 Nov 29 00:19 database
-rw------- 1 iMac staff 0 Nov 27 22:54 db.log
-rw------- 1 iMac staff 214076 Nov 29 00:19 debug.log
-rw-r–r--@ 1 iMac admin 2356 Nov 27 23:22 ppcoin.conf
-rwxr-xr-x@ 1 iMac staff 5668888 Apr 29 2013 ppcoind
-rwxrwxr-x@ 1 iMac staff 223 Nov 29 00:20 start.sh
-rw------- 1 iMac staff 49152 Nov 29 00:15 wallet.dat
localhost:PPCoin iMac$ ./start.sh
./start.sh: line 2: unexpected EOF while looking for matching `’’
./start.sh: line 6: syntax error: unexpected end of file
localhost:PPCoin iMac$

Am I supposed to actually enter my wallet passphrase inside the start.sh file?

#!/bin/bash
#echo “Make sure you’ve started PPCoin-qt first."
read -s -p “Enter PPCoin wallet passphrase : " passphrase
echo “Starting PPCoind with stake minting enabled”
./ppcoind walletpassphrase $passphrase 9999999 true

Thanks a lot,
Alejandro

#26

Hi, Alejandro.

No, you don’t need to enter your passphrase in the [font=courier]start.sh[/font] script. That error looks like one that shows up if you have special characters or spaces in your passphrase. I ran into the same one when I originally wrote the bash script, but after I got rid of the spaces in my passphrase, it worked fine.

I don’t believe it’s a problem with the script, but rather, how the passphrase is passed into ppcoind.

Does that sound like it could be the problem you’re having?

#27

Hello I got past the denied permissions but now am having trouble with this too:

Ezekiels-MacBook-Pro:PPCoin kazem666$ ./start.sh
./start.sh: line 2: unexpected EOF while looking for matching `’’
./start.sh: line 6: syntax error: unexpected end of file

#28

kazem666, please read the post above yours and see if the scenario applies to you. At this time, you cannot have spaces or special characters in your passphrase.

I’m looking into whether or not this is something that we can get changed (or if it’s a problem with the script and not the Peercoin daemon), but in the meanwhile that’s my recommendation.

#29

Ben, I changed my passphrase to something very simple, “testing” and still I get the same error. I downloaded the ppcoind file again and also looked for another source for the ppcoind file just in case the ppcoind file itself is damaged but I only find the Mega.co.nz url.

Is it okey that the ppcoind file in OSX shows as a Unix Executable File? This is what some corrupted files in OSX sometimes turn into.

Best,
Alejandro

#30

Hey Ben, I didn’t have any special characters or spaces in my passphrase. Like Alejandro did I changed my passphrase to “testing” in both nano ppcoin.conf and nano start.sh to see if that would fix but still got the same error.

My ppcoind file in OSX is also a Unix Executable File.

Ezekiel

#31

You can test it directly from the command line with this:

$ ./ppcoind walletpassphrase <passphrase> 9999999 true

Replace with your wallet passphrase. The only negative with this approach is that your wallet passphrase will be in your bash history, so once you’ve tested this out, you can clear your bash history with:

$ cat /dev/null > ~/.bash_history

If that works, it may be a problem with the [font=courier]start.sh[/font] script. Do you by chance have an extra couple of blank lines at the end? I’ve seem strange things with EOF errors when there’s more than one.

Re: Unix executable file – that’s what I see when I look at my PPCoin directory as well, so that’s most likely not the problem.

#32

I think I might have discovered something…

I was getting this error when using $ ./ppcoind walletpassphrase 9999999 true

localhost:PPCoin iMac$ ./ppcoind walletpassphrase testing 9999999 true
error: incorrect rpcuser or rpcpassword (authorization failed)

So it made me wonder why is it checking on the password in the ppcoin.conf file? So instead of using my wallet passphrase I decided to use the passphrase in my ppcoin.conf file and I got this error:

localhost:PPCoin iMac$ ./ppcoind walletpassphrase cryptocurrency 9999999 true
error: {“code”:-14,“message”:“Error: The wallet passphrase entered was incorrect.”}

So that made wonder if both wallet and ppcoin.conf must have identical passphrases.
So I changed both to “test” and I ran again $ ./ppcoind walletpassphrase test 9999999 true

And it appeared to work, because I ran it again and I got this:

localhost:PPCoin iMac$ ./ppcoind walletpassphrase test 9999999 true
error: {“code”:-17,“message”:“Error: Wallet is already unlocked, use walletlock first if need to change unlock settings.”}

So I went to check the PPcoin-Qt app and the “locked” message on the lower left corner is gone.

I think I’m happy. Should I be?

So I guess this raises a security question about the wallet passphrase…?

Best,
Alejandro

#33

When I run $ ./ppcoind walletpassphrase 9999999 true I get: -bash: passphrase: No such file or directory

Now I’m really confused.

#34

That happened to me too, that’s because you copy and pasted the line in, including the $ symbol which isn’t needed…

#35

Happened again without the $

#36

Are you in the correct directory?

localhost:~ iMac$ cd ~/Library/Application\ Support/PPCoin/
localhost:PPCoin iMac$

#37

I sure hope so. This is where I’m at:

Ezekiels-MacBook-Pro:PPCoin kazem666$ cd ~/Library/Application\ Support/PPCoin/
Ezekiels-MacBook-Pro:PPCoin kazem666$

#38

No, they don’t need to be the same, because I’m running with different password (in ppcoin.conf) and passphrase (for my wallet).

@kazem666, are you pasting in the line directly from my comment [font=courier]./ppcoind walletpassphrase 9999999 true[/font] or are you pasting it in and then replacing [font=courier][/font] with the one that you use for your wallet?

For instance, if my wallet passphrase was ThisShouldNotBePubliclyKnown, the line that I’d enter into Terminal, from the [font=courier]~/Library/Application\ Support/PPCoin/[/font] directory would be:

./ppcoind walletpassphrase ThisShouldNotBePubliclyKnown 9999999 true

Please note, wallet passphrases are case-sensitive, so make sure that you are entering your passphrase exactly as you’ve set it up from inside of PPCoin-Qt.

#39

Also, I’m working on a new version of [font=courier]start.sh[/font] that provides a couple of options and runs validations against your current setup to see if there’s anything that is not configured correctly.

Once I’ve had a chance to put it through a couple of tests, I’ll make it available to the community for review.


Thanks for your patience, guys, and for sticking with it!

As strange as it sounds, I’m welcoming these issues (but definitely sorry they are happening to you), because it’s allowing me to make sure that the tutorial is as clear and complete as possible.

#40

Ben, thank YOU for your patience and dedication in helping the Mac community.

I noticed that I’m missing the daemon file.

localhost:PPCoin iMac$ ls
__db.001 __db.004 addr.dat database ppcoin.conf wallet.dat
__db.002 __db.005 blk0001.dat db.log ppcoind
__db.003 __db.006 blkindex.dat debug.log start.sh

Why is that? How does this affect my minting?

Thanks,
Alejandro