# Build Examples

### Test example

The test example implements file uploading, listing files that have been uploaded, fetching file, fetching file sharing links, deleting file

#### 1 Register from [https://storage.titannet.io](https://storage.titannet.io/), and create API Key

[![Alt text](https://github.com/Titannet-dao/titan-storage-sdk/raw/main/doc/20231113173719.png)](https://github.com/Titannet-dao/titan-storage-sdk/blob/main/doc/20231113173719.png)

#### 2 Build example

```
git clone github.com/Filecoin-Titan/titan-storage-sdk.git
cd /titan-storage-sdk/example
go build
```

#### 3 Setting environment variable

```
export API_KEY=YOUR-API-KEY
export TITAN_URL=https://api-test1.container1.titannet.io
```

#### 4 run test

**4.1 Upload file**

```
./example upload /path/to/file
```

**4.2 List file**

```
./example list
```

**4.3 Get file**

```
./example get --cid=your-file-cid --out=/path/to/save/file
```

**4.4 Get file url (in order to share file)**

```
./example url your-file-cid
```

**4.5 Delete file**

```
./example delete your-file-cid
```

\ <br>
