Getting Started
Integrating Tachyon is simple. In this guide we’ll run you through the basics. Before we begin you need to know a core concept behind Tachyon:

The Tachyon platform organizes data into named Filesystem s. A Filesystem  is the medium that stores and distributes data pushed into the Tachyon platform. A Filesystem  functions very much like a traditional Unix-based filesystem, with the same file and folder semantics, paths delineated using forward slashes, and functionality like making, copying, moving, and removing files and folders. In order to manipulate a Filesystem , a host has to connect to the Filesystem  using a Filesystem ID (FID) and a Filesystem-specific API key. Currently, we only support creating Filesystems and seeing FIDs/API Keys using the Web Administration Dashboard.
Step 1: Adding the Tachyon Library
The first step to using Tachyon is to add our library and authenticate:. To create a filesystem id and get an api token sign up on app.trytachyon.com
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
    upload.cpp
    $ g++ -o upload upload.cpp -llibtachyon-dev  
*/
#include <iostream>
#include <cstdlib>

// Download the C++ static library and header files from
// https://trytachyon.com/download
#include "tachyon.hpp"

int
main() {
// Find your Filesystem ID and API Token at         // https://app.trytachyon.com/
// and set the environment variables.
const char * fid = getenv("FILESYSTEM_ID");
const char * key = getenv("API_KEY");

Tachyon
client(fid, key);
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
COMING SOON
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Install the Tachyon CLI tool using homebrew:
# $ brew install tachyon
# Find your Filesystem ID and API Token at https://app.trytachyon.com/
# and set the environment variables.
tachyon authenticate $FILESYSTEM_ID $API_TOKEN
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Install the Node.js library from https://www.npmjs.com/package/tachyon
// using npm: $ npm i
tachyon
import { Client } from 'tachyon-transfer';

// Find your Filesystem ID and API Token at https://app.trytachyon.com/
// and set the environment variables.
const FILESYSTEM_ID = process.env.FILESYSTEM_ID;
const API_TOKEN = process.env.API_TOKEN;

const client = new Client(FILESYSTEM_ID, API_TOKEN);
Step 2: Uploading a file
To upload a file simply, drop in the local path, and where you want to upload to in the Tachyon filesystem:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
   upload.cpp
   $ g++ -o upload upload.cpp -llibtachyon-dev  
*/

#include <iostream>
#include <cstdlib>

// Download the C++ static library and header files from
// https://trytachyon.com/download
#include "tachyon.hpp"

int
main() {
  // Find your Filesystem ID and API Token at https://app.trytachyon.com/   // and set the environment variables.
  
const char * fid = getenv("FILESYSTEM_ID");
  
const char * key = getenv("API_KEY");

  Tachyon
client(fid, key);
  
client.upload("/tmp/example.txt", "/remoteFolder/", true)
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
COMING SOON
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Install the Tachyon CLI tool using homebrew:
# $ brew install tachyon


# Find your Filesystem ID and API Token at https://app.trytachyon.com/
# and set the environment variables.

tachyon authenticate $FILESYSTEM_ID $API_TOKEN

tachyon upload --replace /tmp/example.txt /remoteFolder/
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Install the Node.js library from https://www.npmjs.com/package/tachyon
// using npm: $ npm i tachyon
import { Client } from 'tachyon-transfer';

// Find your Filesystem ID and API Token at https://app.trytachyon.com/
// and set the environment variables.

const FILESYSTEM_ID = process.env.FILESYSTEM_ID;
const API_TOKEN = process.env.API_TOKEN;

const client = new Client(FILESYSTEM_ID, API_TOKEN);
client.upload("mylocalpath/mylocalfile" , "filesystem/filesystemfolder");

Step 3: Downloading a file
Downloads are done as follows:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
  download.cpp
  $ g++ -o download download.cpp -llibtachyon-dev
*/

#include <iostream>
#include <cstdlib>

// Download the C++ static library and header files from
// https://trytachyon.com/download
#include "tachyon.hpp"

int
main() {
  // Find your Filesystem ID and API Token at https://app.trytachyon.com/
  // and set the environment variables.
  
const char * fid = getenv("FILESYSTEM_ID");
  
const char * key = getenv("API_KEY");

  Tachyon
client(fid, key);
  client.
download("/tmp/", "/remoteFolder/", true)
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
COMING SOON
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Install the Tachyon CLI tool using homebrew:
# $ brew install tachyon


# Find your Filesystem ID and API Token at https://app.trytachyon.com/
# and set the environment variables.

tachyon authenticate $FILESYSTEM_ID $API_TOKEN

tachyon download --replace /tmp/example.txt /remoteFolder/



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Install the Node.js library from https://www.npmjs.com/package/tachyon
// using npm: $ npm i tachyon
import { Client } from 'tachyon-transfer';

// Find your Filesystem ID and API Token at https://app.trytachyon.com/
// and set the environment variables.

const FILESYSTEM_ID = process.env.FILESYSTEM_ID;
const API_TOKEN = process.env.API_TOKEN;

const client = new Client(FILESYSTEM_ID, API_TOKEN);
client.download("mylocalpath/mylocalfile" , "filesystem/filesystemfolder");

Step 4: Monitoring File Transfers
Follow the instructions on the web app. Once you have an upload or download in progress, sign in to app.trytachyon.com and go to the transfers tab.

Documentation

Read additional information about how Tachyon works

Read docs >

Reach out

Can’t find your answer? Get directly in touch with our team.

Contact us >