# 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>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://titannet.gitbook.io/titan-network-en/tws/titan-storage/how-to-guides/build-examples.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
