# Operation on MacOS (CLI)

{% hint style="danger" %}
**🚨Important Note🚨**

If you have participated in Herschel testnet earlier, you need to mannually clear previous node data. Otherwise the node will not be able to start. 🚨

**🔘** [Data Cleaning Guide](https://titannet.gitbook.io/titan-network-en/resource-network-test/operate-nodes/l2-edge-node/installation-and-earnings/clear-up-old-node-data/data-cleaning-on-macos-cli)

*If you have never operated Titan node before, just follow the steps below.*
{% endhint %}

{% hint style="info" %}
The [Releases](https://github.com/Titannet-dao/titan-node/releases) section on our GitHub is the best place to get the latest binary releases and view the source code.
{% endhint %}

## Step 1: Download the CLI

{% embed url="<https://github.com/Titannet-dao/titan-node/releases/download/v0.1.20/titan-edge_v0.1.20_246b9dd_mac_amd64.tar.gz>" %}

## Step 2: Extract the downloaded package

Open Terminal, change the directory to the download folder, and execute the following command to extract:

```
tar -zxvf titan-edge_v0.1.20_246b9dd_mac_amd64.tar.gz
```

## Step 3: Enter the extracted folder

* Use the following command to enter the extracted folder

```
cd titan-edge_v0.1.20_246b9dd_mac_amd64
```

## Step 4: Install Titan Edge

* Copy `titan-edge` executable to the system directory `/usr/local/bin` , so that it can be executed at any location

```
sudo cp titan-edge /usr/local/bin
```

## Step 5: Obtain the current working directory

* Execute the following command to obtain the current directory and keep this path

```
pwd
```

* Assume the path is `x` henthforth

## Step 6: Update the dynamic library&#x20;

**(permanent solution)**

1. Add `libgoworkerd.dylib` after the path

* If the path obtained from the last step is `x`, the complete path would be `x/libgoworkerd.dylib`.

2. Update the dynamic library path in the `titan-edge` executable

* Use the following command to replace the path with the actual path

```
install_name_tool -change "@rpath/libgoworkerd.dylib" x/libgoworkerd.dylib /usr/local/bin/titan-edge
```

**(ad hoc solution)**

If you just want to run an ad hoc test, you can follow the step below

**Set the dynamic library path environment variable**

* Set the environment variable `DYLD_LIBRARY_PATH` as the current path:

```
export DYLD_LIBRARY_PATH=.
```

> Notes
>
> * **Permission**: when executing `sudo` command, you need the administrator password
> * **Path correctness**: ensure the path you entered is correct to avoid the problem of file not found
> * **Environment variable**: the environment variable set using the ad hoc solution will be effective in the current session, so you need to repeat this step after restarting the terminal.

## Step 7: Launch the CLI

```
titan-edge daemon start --init --url https://cassini-locator.titannet.io:5000/rpc/v0
```

## Step 8: 👉 [Apply for an identification code](https://app.gitbook.com/o/asXLGZ9srI9ohwLLgXoB/s/6MWUoQBijnrc0tNWtAzG/~/changes/47/cassini-testnet/frequently-asked-questions/bind-the-identity-code) 👈

## Step 9: Bind the identification code

Replace <mark style="color:red;">your-hash-here</mark> with the obtained <mark style="color:red;">identification code</mark>

```
titan-edge bind --hash=your-hash-here https://api-test1.container1.titannet.io/api/v2/device/binding
```

## Step 10: Stop the node

```
titan-edge daemon stop
```
