Using a Sia node as a Portal
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
siacor using its API. This page will get you started using
siacbut Sia also provides API documentation.
siac skynet --help
To upload a file or directory to Skynet, use this command, where
sourceis the location on your local filesystem and
destinationis the siapath to use for saving renter data locally.
siac skynet upload [source] [destination]
For any of the commands, use
--helpfor a thorough explanation of how it works. For example, for s
siac skynet upload --helpwe 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]