create account

Running a steem witness node on MacOS Mojave - Part 1, The Build. by markangeltrueman

View this thread on: hive.blogpeakd.comecency.com
· @markangeltrueman · (edited)
$6.19
Running a steem witness node on MacOS Mojave - Part 1, The Build.
I've been wanted to get a Steem witness node running on my home iMac for a while for testing purposes and to provide me with the option of using it as a temporary backup for the @c-squared witness that I run if required. 

With the option of [MIRA](https://steemit.com/mira/@steemitblog/mira-soft-roll-out-begins) I believed it was possible without having to upgrade to 64GB of memory but I have always had a problem building the code. Even though Mac OS is effectively a flavour of Unix, the instructions for building on Linux do not work. There are some old instructions for building on Mac OS but these don't work either, especially with RocksDB running MIRA. I'm not sure anyone has gotten this working, I've certainly not been able to find any published instructions. I have finally managed to get the code built with the following instructions.

# Instructions

Let's start with the standard stuff to get things installed and compiled on Mac OS.

- Install Xcode using the [Apple App Store](https://apps.apple.com/gb/app/xcode/id497799835?mt=12)
- Install [Homebrew](https://brew.sh/) 

``` 
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
```
- Initialise Homebrew
```
brew doctor
brew update
```

Now onto some steem specifics.....
- Install steem dependencies
```
brew install \
    autoconf \
    automake \
    cmake \
    git \
    boost160 \
    libtool \
    openssl \
    snappy \
    zlib \
    bzip2 \
    python3 \
    doxygen
    
pip install --user jinja2
```
Now you will want to set up some environment variables before doing the build. Below are the versions that I know work. You may find that the default versions installed by brew are not the correct ones. It is worth finding the location of your Brew Cellar before you do this just so you can check what versions are installed. Mine is installed in /usr/local/Cellar

```
Marks-iMac:bin mark$ brew --prefix
/usr/local
```
Do the exports
```
export BOOST_ROOT=$(brew --prefix)/Cellar/boost@1.60/1.60.0/
# doesnt work - export OPENSSL_ROOT_DIR=$(brew --prefix)/Cellar/openssl@1.1/1.1.1c/
export OPENSSL_ROOT_DIR=$(brew --prefix)/Cellar/openssl/1.0.2s
export SNAPPY_ROOT_DIR=$(brew --prefix)/Cellar/snappy/1.1.7_1
export ZLIB_ROOT_DIR=$(brew --prefix)/Cellar/zlib/1.2.11
export BZIP2_ROOT_DIR=$(brew --prefix)/Cellar/bzip2/1.0.6_1	
```
Note that the latest version of openssl did not work with steemd so i had to run

```
brew install openssl@1.0.2s
```
To get a version that worked.

It's definitely worth going through the versions here and checking that the versions on the environment variable above match what you have downloaded with Homebrew, and if they aren't get the proper version.

The above builds fine, but when you get to the final stage in the process, the final linking operation throws a wobbly thanks to some restrictions on Mac OS with linking the OpenSSL libraries from the above. For that reason, you need to add the following export to the list (assuming this is the location of your Mac OS openssl library)

```
export LDFLAGS="-L/usr/local/opt/openssl/lib/"
```

Now for some standard steem manual build stuff to get the code from the repo, check out the right version and create the build folder.
```
git clone https://github.com/steemit/steem
git checkout v0.22.1
git submodule update --init --recursive
mkdir build && cd build
```
The next command is slightly different from standard as you need to specify the BOOST_ROOT parameter 
```
cmake -DBOOST_ROOT="$BOOST_ROOT" -DENABLE_MIRA=ON -DLOW_MEMORY_NODE=ON -DCMAKE_BUILD_TYPE=Release ..
```
This next bit took me a while to work out. When i was building the MIRA version, i was getting a load of errors like this.

```Undefined symbols for architecture x86_64:```

This appears to be caused by some kind of missing symbols tables in RocksDB that steem is looking for. 

So I found this in the RocksDB documentation and thought i'd give it a go

```
# * DEBUG_LEVEL=0; this is the debug level we use for release. If you're
# running rocksdb in production you most definitely want to compile RocksDB
# with debug level 0. 
```
So running ```make``` with the following command builds steemd.
```
DEBUG_LEVEL=0 make -j$(sysctl -n hw.logicalcpu) steemd
```
and of course, cli_wallet
```
DEBUG_LEVEL=0 make -j$(sysctl -n hw.logicalcpu) cli_wallet
```
Then copy the executables to a local folder of your choice
```
mkdir ~/bin
cp programs/steemd/steemd ~/bin
cp programs/cli_wallet/cli_wallet ~/bin
```
Then run steemd to check the version

```
~/bin/steemd --version
```

![Screenshot 20190909 at 18.51.26.png](https://files.steempeak.com/file/steempeak/markangeltrueman/BoD6nVuE-Screenshot202019-09-0920at2018.51.26.png)


### TA-DAAAA,  steemd built and running on Mojave.
---

I'm currently downloading a recent block_log which takes a while on a home internet connection. Once this is done, im going to be trying to get this running. I suspect that the replay may take a few days and I am going to have to have a play with Mac OS ```ulimits``` as apparently they can be pretty hard to change properly and are probably worth a post on their own.

Hope this helps people with Mac OS to get a witness built and up and running. Of course, i wouldn't suggest that you run a witness 24/7 on a personal Mac, but its definitely good for experimentation and development at home and possibly a temporary backup.

If you have any problems when you try this, be sure to drop me a message on discord or in the comments below.

Mark

---
<div class="pull-left">

![image.png](https://files.steempeak.com/file/steempeak/markangeltrueman/iMSFW51J-image.png)
</div>

@c-squared runs a community focused witness node.
Please consider voting for us here if you would like to support our witness operations.
πŸ‘  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 28 others
properties (23)
authormarkangeltrueman
permlinkrunning-a-steem-witness-node-on-macos-mojave-part-1-the-build
categorystemgeeks
json_metadata{"app":"steempeak/1.15.5","format":"markdown","tags":["stemgeeks","steem","witness","macos","palnet","witness-category","dev","steemstem"],"users":["c-squared","steemitblog","1.60","1.1","1.0.2s"],"links":["/@c-squared","/mira/@steemitblog/mira-soft-roll-out-begins","https://apps.apple.com/gb/app/xcode/id497799835?mt=12","https://brew.sh/","/@c-squared"],"image":["https://files.steempeak.com/file/steempeak/markangeltrueman/BoD6nVuE-Screenshot202019-09-0920at2018.51.26.png","https://files.steempeak.com/file/steempeak/markangeltrueman/iMSFW51J-image.png"]}
created2019-09-09 19:31:27
last_update2019-09-09 19:55:03
depth0
children10
last_payout2019-09-16 19:31:27
cashout_time1969-12-31 23:59:59
total_payout_value3.190 HBD
curator_payout_value3.004 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length5,790
author_reputation75,759,505,276,179
root_title"Running a steem witness node on MacOS Mojave - Part 1, The Build."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id90,418,106
net_rshares17,394,443,312,134
author_curate_reward""
vote details (92)
@bluefinstudios ·
Curious, what machine.
Which device?
πŸ‘  
properties (23)
authorbluefinstudios
permlinkpxlk09
categorystemgeeks
json_metadata{"tags":["stemgeeks"],"app":"steemit/0.1"}
created2019-09-10 03:50:33
last_update2019-09-10 03:50:33
depth1
children2
last_payout2019-09-17 03:50:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length36
author_reputation199,156,275,708,072
root_title"Running a steem witness node on MacOS Mojave - Part 1, The Build."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id90,428,540
net_rshares33,524,267,627
author_curate_reward""
vote details (1)
@markangeltrueman ·
![Screenshot 20190910 at 07.19.08.png](https://files.steempeak.com/file/steempeak/markangeltrueman/A9nXvjqI-Screenshot202019-09-1020at2007.19.08.png)
properties (22)
authormarkangeltrueman
permlinkre-bluefinstudios-pxlxjp
categorystemgeeks
json_metadata{"tags":["stemgeeks"],"app":"steempeak/1.15.5"}
created2019-09-10 08:43:12
last_update2019-09-10 08:43:12
depth2
children1
last_payout2019-09-17 08:43:12
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length149
author_reputation75,759,505,276,179
root_title"Running a steem witness node on MacOS Mojave - Part 1, The Build."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id90,434,556
net_rshares0
@bluefinstudios ·
Interesting... cuz, it's not a packed, fully loaded one.
Imagine if it was a MacPro
πŸ‘  
properties (23)
authorbluefinstudios
permlinkpxm8q4
categorystemgeeks
json_metadata{"tags":["stemgeeks"],"app":"steemit/0.1"}
created2019-09-10 12:44:27
last_update2019-09-10 12:44:27
depth3
children0
last_payout2019-09-17 12:44:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length83
author_reputation199,156,275,708,072
root_title"Running a steem witness node on MacOS Mojave - Part 1, The Build."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id90,440,157
net_rshares35,369,260,452
author_curate_reward""
vote details (1)
@c-squared ·
c-squared-comment
<div class="pull-left">https://cdn.steemitimages.com/DQmaSUWYsJ3AMUEMRqCSaoKJVNvtsbKm4fNAtmTidr8Uggc/C%20Squared%20Logo%20Transparency%20200px.png</div><br>This post was shared in the <a href="https://discord.gg/B8JFmJ4">Curation Collective Discord community</a> for curators, and upvoted and resteemed by the @c-squared community account after manual review.<br/>@c-squared runs a <a href="https://steemit.com/witness/@c-cubed/announcing-the-launch-of-the-new-c-squared-witness">community witness</a>. Please consider using one of your witness votes on us <a href ="https://steemconnect.com/sign/account-witness-vote?witness=c-squared&approve=true">here</a>
properties (22)
authorc-squared
permlink20190909t194201470z
categorystemgeeks
json_metadata{"tags":["c-squared"]}
created2019-09-09 19:42:30
last_update2019-09-09 19:42:30
depth1
children0
last_payout2019-09-16 19:42:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length658
author_reputation8,872,520,093,091
root_title"Running a steem witness node on MacOS Mojave - Part 1, The Build."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id90,418,482
net_rshares0
@carlgnash ·
cool hopefully the replay goes ok.  Nice work
properties (22)
authorcarlgnash
permlinkre-markangeltrueman-pxl3ey
categorystemgeeks
json_metadata{"tags":["stemgeeks"],"app":"steempeak/1.15.5"}
created2019-09-09 21:52:12
last_update2019-09-09 21:52:12
depth1
children0
last_payout2019-09-16 21:52:12
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length45
author_reputation114,786,060,260,950
root_title"Running a steem witness node on MacOS Mojave - Part 1, The Build."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id90,421,689
net_rshares0
@justineh ·
I don’t know what half of this means, but I’m still impressed. *tips hat*
properties (22)
authorjustineh
permlinkpxkxd9
categorystemgeeks
json_metadata{"tags":["stemgeeks"],"app":"steemit/0.1"}
created2019-09-09 19:41:36
last_update2019-09-09 19:41:36
depth1
children1
last_payout2019-09-16 19:41:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length73
author_reputation171,050,398,797,557
root_title"Running a steem witness node on MacOS Mojave - Part 1, The Build."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id90,418,451
net_rshares0
@markangeltrueman ·
It's the matrix and stuff.
properties (22)
authormarkangeltrueman
permlinkre-justineh-pxkxtg
categorystemgeeks
json_metadata{"tags":["stemgeeks"],"app":"steempeak/1.15.5"}
created2019-09-09 19:51:18
last_update2019-09-09 19:51:18
depth2
children0
last_payout2019-09-16 19:51:18
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length26
author_reputation75,759,505,276,179
root_title"Running a steem witness node on MacOS Mojave - Part 1, The Build."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id90,418,705
net_rshares0
@teamhumble ·
interesting, well researched. i'd be worried about that vulnerable openssl thou no?
πŸ‘  
properties (23)
authorteamhumble
permlinkpxky8y
categorystemgeeks
json_metadata{"tags":["stemgeeks"],"app":"steemit/0.1"}
created2019-09-09 20:00:36
last_update2019-09-09 20:00:36
depth1
children1
last_payout2019-09-16 20:00:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length83
author_reputation315,232,864,758,316
root_title"Running a steem witness node on MacOS Mojave - Part 1, The Build."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id90,418,924
net_rshares3,770,944,395
author_curate_reward""
vote details (1)
@markangeltrueman · (edited)
Quite possibly yeah. Tried a load of recent versions and none of them would work though :(.

The linked SSL libraries are the MacOS ones however, so.....
properties (22)
authormarkangeltrueman
permlinkre-teamhumble-pxkyhq
categorystemgeeks
json_metadata{"tags":["stemgeeks"],"app":"steempeak/1.15.5"}
created2019-09-09 20:05:54
last_update2019-09-09 20:07:06
depth2
children0
last_payout2019-09-16 20:05:54
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length153
author_reputation75,759,505,276,179
root_title"Running a steem witness node on MacOS Mojave - Part 1, The Build."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id90,419,069
net_rshares0
@tts ·
To listen to the audio version of this article click on the play image.
[![](https://s18.postimg.org/51o0kpijd/play200x46.png)](http://ec2-52-72-169-104.compute-1.amazonaws.com/markangeltrueman__running-a-steem-witness-node-on-macos-mojave-part-1-the-build.mp3)
Brought to you by [@tts](https://steemit.com/tts/@tts/introduction). If you find it useful please consider upvoting this reply.
πŸ‘Ž  
properties (23)
authortts
permlinkre-running-a-steem-witness-node-on-macos-mojave-part-1-the-build-20190909t194153
categorystemgeeks
json_metadata""
created2019-09-09 19:41:54
last_update2019-09-09 19:41:54
depth1
children0
last_payout2019-09-16 19:41:54
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length389
author_reputation-4,535,154,553,995
root_title"Running a steem witness node on MacOS Mojave - Part 1, The Build."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id90,418,463
net_rshares-4,429,027,224
author_curate_reward""
vote details (1)