MacOS build of awe web publisher/browser demo app

The following instructions should allow you to build and run awe on MacOS.

If you try them, please reply on the topic what version of awe and MacOS you used and whether you were successful or if not, what happened.

Also feel free to edit this post with any improvements.

  1. Install pre-requisites for MacOS
# install xcode:
xcode-select --install

# install Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# install git:
brew install git

# install Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# install Tauri CLI (beta):
cargo install tauri-cli --version "^2.0.0-rc"

# install nvm (node version manager):
brew install nvm
  1. Add the following to your ~/.zshrc:
export NVM_DIR=~/.nvm
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
  1. Open a new shell and then install node using nvm:
    nvm install --lts

  2. Setup awe:

# clone the awe repository:
git clone https://github.com/happybeing/awe

# install node dependencies
cd awe
npm install
  1. To be able to connect to the network add the following environment variables (these values will change after the beta network reset). Also, be aware that if you run awe with a local testnet you will need to unset them.
export FOUNDATION_PK=84418659a8581b510c40b12e57da239787fd0d3b323f102f09fae9daf2ac96907e0045b1653c301de45117d393d92678
export GENESIS_PK=8829ca178d6022de16fb8d3498411dd8a674a69c5f12e04d8b794a52ab056f1d419d12f690df1082dfa7efbbb10f62fa
export NETWORK_ROYALTIES_PK=8c027130571cea2387a0ceb37c14fec12849015be1573ea6d0a8e4d48da2c1fbe2907ae7503bb7c385b21e2d7ac9d6ff
export PAYMENT_FORWARD_PK=8c2f406a52d48d48505e1a3fdbb0c19ab42cc7c4807e9ea19c1fff3e5148f3bbe53431ec5a07544aaeef764e073e4b2f
  1. Test:
cargo tauri dev --target=aarch64-apple-darwin
  1. Do a build:
cargo tauri build --target=aarch64-apple-darwin

Using a Local Testnet

You can run awe with a local test network.

  • make sure the PK_ environment variables described above are NOT set.

  • start a testnet by following the instructions at GitHub - maidsafe/safe_network

  • in the awe project directory, run awe with the ‘local discovery’ feature:
    cargo tauri dev -- --features=local-discovery --

  • to upload a website to the testnet use:
    cargo tauri dev -- --features=local-discovery -- publish --website-root <WEBSITE-DIRECTORY>

I have a bunch of aliases and scripts for setting up initial websites and test pages on a local testnet or the public beta, so if you want to do a bit more than play, get in touch.

7 Likes

Hey, I got this building on a M1 Mac after having some issues with the default target setting. I changed the target setting in config.toml from x86_64-unknown-linux-gnu to aarch64-apple-darwin, and that was it.

All the install pre-requisites worked well, although I’d suggesting changing ~/.bashrc to ~/.zshrc in step 2 - zsh is the default these days.

11 Likes

This is brilliant, thank you.

One thing I forgot is that when building you need also to set some environment variables. Without that I think it won’t connect to the network. So you will need also to set the following values (which will change after a beta network reset):

export FOUNDATION_PK=84418659a8581b510c40b12e57da239787fd0d3b323f102f09fae9daf2ac96907e0045b1653c301de45117d393d92678
export GENESIS_PK=8829ca178d6022de16fb8d3498411dd8a674a69c5f12e04d8b794a52ab056f1d419d12f690df1082dfa7efbbb10f62fa
export NETWORK_ROYALTIES_PK=8c027130571cea2387a0ceb37c14fec12849015be1573ea6d0a8e4d48da2c1fbe2907ae7503bb7c385b21e2d7ac9d6ff
export PAYMENT_FORWARD_PK=8c2f406a52d48d48505e1a3fdbb0c19ab42cc7c4807e9ea19c1fff3e5148f3bbe53431ec5a07544aaeef764e073e4b2f

I don’t full understand what you have advised so I will make the OP into a Wiki which you will then be able to edit.

Please make the changes you found necessary to make this build, and include the above setting of the keys.

Also, I think if you add a --target=aarch64-apple-darwin parameter to the cargo build command you won’t need to edit Cargo.toml so please test this.

For example, I’m guessing:

cargo tauri dev -- --target=aarch64-apple-darwin

and

cargo tauri build -- --target=aarch64-apple-darwin

The above may not be quite right but let us know what is correct.

5 Likes

Thanks for that! I tried those updates and I was able to get it building, and I’ve updated the wiki.

I tried loading one of the sites you mentioned. I have no idea if this is expected to work…

but I was getting a crash. Here are the logs:

TTTTTTTT tauri::cmd on_is_local_network() returning: false
get_version_requested() returning 0
TTTTTTTT tauri::cmd on_get_version_requested() returning 0
TTTTTTTT tauri::cmd on_start_get_cli_url() returning: 
get_version_max() returning 0
set_next_load_is_address_bar() set to true
TTTTTTTT on_prep_to_load_from_address_bar(0) returning version: 0
set_version_requested() set to 0
get_version_requested() returning 0
DEBUG Hello from handle_protocol_awv() version_requested Some(0)
DEBUG url 'awv://dd4314910384cc18b2da8242a7f3fab9ccb857e24507357d9a3b1499e86b147684d20a661a1637bd0c52b34ef451da05d1c58ec74db9bd6a6823fea5390cf2ca2b76ba0fea7d5547d517c833757da2b1/?v=0'
DEBUG parse_url_string(awv://dd4314910384cc18b2da8242a7f3fab9ccb857e24507357d9a3b1499e86b147684d20a661a1637bd0c52b34ef451da05d1c58ec74db9bd6a6823fea5390cf2ca2b76ba0fea7d5547d517c833757da2b1/?v=0
DEBUG   protocol: awv://
DEBUG   host: dd4314910384cc18b2da8242a7f3fab9ccb857e24507357d9a3b1499e86b147684d20a661a1637bd0c52b34ef451da05d1c58ec74db9bd6a6823fea5390cf2ca2b76ba0fea7d5547d517c833757da2b1
DEBUG   path: /
DEBUG   params: {"v": "0"}
get_next_load_is_address_bar() returning true
set_next_load_is_address_bar() set to false
get_save_next_site_address() returning true
get_last_site_address() returning 
DEBUG loading_new_page_via_address_bar: true
DEBUG loading_new_page_via_page       : false
DEBUG loading_resource                : false
DEBUG xor_host_differs_from_page      : true
DEBUG version_requested               : Some(0)
DEBUG (host_xor_string, resource_path): (dd4314910384cc18b2da8242a7f3fab9ccb857e24507357d9a3b1499e86b147684d20a661a1637bd0c52b34ef451da05d1c58ec74db9bd6a6823fea5390cf2ca2b76ba0fea7d5547d517c833757da2b1, /)'
Autonomi client initialising...
Connecting to the network using 50 peers
thread 'main' panicked at src/awe_client.rs:70:53:
Failed to instantiate FilesApi: AmountIsZero
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5

There’s every chance I’m missing something obvious :sweat_smile:

3 Likes

That’s a bug in the Autonomi APIs - if you send me your wallet address I will send you some nanos and you will be able to view things - which at the moment you can’t do with an empty wallet!

If you want to upload a web page or website let me know and I can send you some nanos for that too. You can use the awe ‘estimate’ command to work out how much you need.

Thanks for your help with this. :pray:

6 Likes

ah ok, no need to send nanos, I was just curious to know if I was able to view a site. btw, if you need any mac os (or unbuntu) testing in future then feel free to give me a shout!

5 Likes

I’m working on it! I encountered a couple of issues during the brew install, but I’m pushing through to finish the initial setup. Here’s a bit about my journey:

When I ran xcode-select --install, I received a message saying that the package was already installed and that to update it, I would need to do so through my main Mac settings, likely referring to macOS updates. After that, everything went pretty smoothly. I followed brew’s recommendations to link the environment path file to run commands from the CLI. The brew installation itself went smoothly, and at the end, it also provided some instructions to replicate what brew recommends during the rust installation to enable command execution from my current terminal. I restarted my terminal window as suggested.

Running cargo install tauri-cli --version "^2.0.0-rc" went without issues. I installed the nvm package, but initially faced an issue running brew. I opened another terminal, added the path to my env profile, and then successfully installed nvm. The awe installation went smoothly—no issues with either the git awe or the npm install. I copied all the environment variables into a single code block and pasted them into my terminal—no issues so far. For reference, I’m using a MacBook Pro M1, and unlike my friend Graham, my profile is located at ~/.zshenv.

I ran a test, and the awe browser launched. I opened another terminal to run the build. Always remember to switch to a new terminal after any new installation; otherwise, you might encounter errors. I ran the build, and my Mac prompted a warning. I allowed it, and an awe image appeared, which I dragged into my applications—so exciting!

I’ll pause here because I think I need to contact you to proceed to the next stage. I hope this journey helps anyone else running a Mac. I’ll be around if anyone needs anything. Graham did an amazing job debugging the initial errors—without that, I’d probably be banging my head against the door, lol. I’m really excited to be part of this project, so I’m here to help and play around!

6 Likes


Amazing, the test is working!! Timbob walking next to me on this amazing journey!! Ty bro.

7 Likes

Before heading to bed, I wanted to share something important about MacOS shells that I’ve been struggling with. The issue lies in the terminal you’re using. I noticed a difference between Graham’s configuration ~/.zshrc and mine ~/.zshenv. The key difference is that every time I close my terminal, the paths from ~/.zshenv get overwritten by the system, while ~/.zshrc is only loaded for interactive shell sessions. The recommended approach is to use ~/.zprofile instead of both. This is actually where brew suggests placing environment variables.

Once I figured this out, I was able to open and close my terminal sessions and test a couple of AWE websites without any issues. Time to go to bed… Have fun! I sure did! Oh, and I also manually changed my terminal settings. Under General, I switched from the default login shell to command complete for path and chose /bin/zsh. Hopefully, this helps anyone facing similar issues.

4 Likes

This is great to see @makkomaster. You and @graham are helping make history :partying_face:

Thanks to both of you for trying this out and sharing what you are learning.

@makkomaster if you have time, any changes to the OP you can make would be good to help others coming after you, such as where to put environment variables and so on. You can edit it yourself because I made it a Wiki.

Would either of you be willing to create a build and host it somewhere so others don’t have to build? I can do this myself for Linux and Windows (although awe doesn’t work on Windows yet), but I don’t have access to a Mac.

6 Likes

I think (!) you should be able to create and release binaries for all OSes by using a build in a github action without building/hosting yourself and having a single place where all the builds then are being released

Last time I checked it was free for a python release chain

I’m sure that possible and have done something like that before, though I don’t recall what?!

But it was a pain so I’m not spending time on that even if it’s free. I also want to remain as independent as I can from those services rather than get more dependent on them.

One day I hope my repo will be on Autonomi.

In the short term I’d be fine if somebody else wants to set that up and manage it though.

3 Likes

I didn’t get round to having a look at compiling on a Mac and it’s just as well others beat me to it as I’d have been floundering. But just remembered something: AWS has Mac Instances now! https://aws.amazon.com/ec2/instance-types/mac/

So that might have been an option for this or something later.

2 Likes

Yeah - all good - if it’s a hassle then it’s not worth the time - just thought I’d mention - we can do releases on autonomi later on =)

2 Likes

Releases yes, builds no. I don’t see the latter being a feature of Autonomi except a long way in the future.

1 Like

But a market place for runners on a git in autonomi would very well be possible :wink:

Would just be nice if one could create a subscription to some data structure on autonomi to not having to poll continuously…

2 Likes

We’re going off topic but all I see with that are problems, and again, not going to happen for years

2 Likes

Hi @happybeing ,

I’m working on creating a detailed step-by-step tutorial that’s designed to be as straightforward as possible, complete with screenshots for each step and the corresponding output. My goal is to make the process clear and easy to follow, even for those who might not have much experience.

I’ve been running multiple tests to ensure that every step in the guide works perfectly, and so far, everything is functioning smoothly. I’m now in the process of building out the final version, confident that this guide will be a reliable resource for anyone who follows it.

Thank you for your patience, and I’m excited to share this with you soon!

7 Likes

if you need any nano to help with your work let me know iv got plenty available :slight_smile:

4 Likes

Hi Graham,
I’m encountering an issue every time I run awe commands.

Error running awe command:

zsh: command not found: awe

I suspect it might be an issue with the profile paths, but I’m stuck in a loop trying to figure it out. Could you please share how your ~/.zshrc profile looks? Any help would be greatly appreciated.

Thanks!

1 Like