If you are running a fully-synced Sia node on your machine, you can download, upload and pin files to Skynet by using the command-line tool
siac or using its API. This page will get you started using
siac but Sia also provides API documentation.
If you need help getting Sia up and running, see the Sia Support page.
To see all the commands available, see the Sia Repository on Gitlab or run:
siac skynet --help
To upload a file or directory to Skynet, use this command, where
source is the location on your local filesystem and
destination is the siapath to use for saving renter data locally.
siac skynet upload [source] [destination]
For any of the commands, use
--help for a thorough explanation of how it works. For example, for s
siac skynet upload --help we see:
After it runs, a skylink will be produced which can be shared and used to retrieve the file. If the given path is a directory it will be uploaded as a single skylink unless the
--separatelyflag is passed, in which case all files under that directory will be uploaded individually and an individual skylink will be produced for each. All files that get uploaded will be pinned to this Sia node, meaning that this node will pay for storage and repairs until the files are manually deleted. Use the
--dry-runflag to fetch the skylink without actually uploading the file.
Here are some other important commands along with their help instructions to get you started.
Download a file from skynet using a skylink. The download may fail unless this node is configured as a skynet portal. Use the --portal flag to fetch a skylink file from a chosen skynet portal.
siac skynet download [skylink] [destination]
Pin the file associated with this skylink by re-uploading an exact copy. This ensures that the file will still be available on skynet as long as you continue maintaining the file in your renter.
siac skynet pin [skylink] [destination]
Unpin one or more pinned skyfiles or directories at the given siapaths. The files and directories will continue to be available on Skynet if other nodes have pinned them.
siac skynet unpin [siapath]
Add space separated skylinks to the blocklist.
siac skynet blocklist add [skylink]