### Start hostd configuration wizard Source: https://docs.sia.tech/provide-storage/setting-up-hostd/macos Execute this command to launch the interactive wizard for configuring your hostd instance, including wallet setup and password creation. ```console hostd config ``` -------------------------------- ### Enable and Start hostd Service Source: https://docs.sia.tech/provide-storage/setting-up-hostd/linux/debian Enable the hostd service to start automatically on boot and start it immediately. ```bash sudo systemctl enable --now hostd ``` -------------------------------- ### Configure hostd Interactively Source: https://docs.sia.tech/provide-storage/setting-up-hostd/linux/debian Start the interactive configuration process for hostd. This will guide you through generating or recovering a wallet seed and setting a password for the web interface. ```bash sudo hostd config ``` -------------------------------- ### Start and enable renterd service Source: https://docs.sia.tech/store-your-data/setting-up-renterd/linux/ubuntu Enable renterd to start automatically on boot and start the service immediately. This command ensures renterd runs in the background. ```bash sudo systemctl enable --now renterd ``` -------------------------------- ### Start hostd node Source: https://docs.sia.tech/provide-storage/setting-up-hostd/linux/other Change to the hostd runtime directory and start the hostd node. Ensure the configuration wizard has been completed first. ```bash cd /path/to/hostd/folder hostd ``` -------------------------------- ### Set up Sia APT Repository Source: https://docs.sia.tech/provide-storage/setting-up-hostd/linux/ubuntu Configure the Sia APT repository to install and manage hostd. Ensure curl is installed beforehand. ```sh sudo curl -fsSL https://linux.sia.tech/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/siafoundation.gpg sudo chmod 644 /usr/share/keyrings/siafoundation.gpg echo "deb [signed-by=/usr/share/keyrings/siafoundation.gpg] https://linux.sia.tech/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") main" | sudo tee /etc/apt/sources.list.d/siafoundation.list sudo apt update ``` -------------------------------- ### Install hostd Package Source: https://docs.sia.tech/provide-storage/setting-up-hostd/linux/debian Install the hostd software using the apt package manager after setting up the Sia repository. ```bash sudo apt install hostd ``` -------------------------------- ### Install renterd Source: https://docs.sia.tech/store-your-data/setting-up-renterd/linux/ubuntu Install the renterd software package using the apt package manager after setting up the Sia repository. ```bash sudo apt install renterd ``` -------------------------------- ### Configure renterd Source: https://docs.sia.tech/store-your-data/setting-up-renterd/linux/ubuntu Start the interactive configuration process for renterd. This will guide you through setting up a wallet seed and a password for the web interface. ```bash sudo renterd config ``` -------------------------------- ### Install hostd using Homebrew Source: https://docs.sia.tech/provide-storage/setting-up-hostd/macos Use this command to install the Sia hostd software via the Homebrew package manager. ```console brew install siafoundation/sia/hostd ``` -------------------------------- ### Verify renterd installation Source: https://docs.sia.tech/store-your-data/setting-up-renterd/macos After installation, run this command to confirm that renterd has been successfully installed and to check its version. ```bash renterd version ``` -------------------------------- ### Start renterd daemon Source: https://docs.sia.tech/store-your-data/setting-up-renterd/macos Navigate to the renterd application support directory and run this command to start the renterd daemon. You can then access the web UI at http://localhost:9980. ```bash cd "$HOME/Library/Application Support/renterd" renterd ``` -------------------------------- ### Install Zen renterd for AMD64 on Linux Source: https://docs.sia.tech/store-your-data/setting-up-renterd/linux/other Download and install the latest Zen renterd version for AMD64 architecture. This command downloads the zip file, extracts the binary, moves it to the system's PATH, and cleans up the downloaded file. ```bash wget https://sia.tech/downloads/latest/renterd_zen_linux_amd64.zip &&\ unzip -j renterd_zen_linux_amd64.zip renterd &&\ sudo mv renterd /usr/local/bin/renterd_zen &&\ rm -fr renterd_zen_linux_amd64.zip ``` -------------------------------- ### Install Zen renterd for ARM64 on Linux Source: https://docs.sia.tech/store-your-data/setting-up-renterd/linux/other Download and install the latest Zen renterd version for ARM64 architecture. This command downloads the zip file, extracts the binary, moves it to the system's PATH, and cleans up the downloaded file. ```bash wget https://sia.tech/downloads/latest/renterd_zen_linux_arm64.zip &&\ unzip -j renterd_zen_linux_arm64.zip renterd &&\ sudo mv renterd /usr/local/bin/renterd_zen &&\ rm -fr renterd_zen_linux_arm64.zip ``` -------------------------------- ### Install renterd for AMD64 on Linux Source: https://docs.sia.tech/store-your-data/setting-up-renterd/linux/other Download and install the latest renterd version for AMD64 architecture. This command downloads the zip file, extracts the binary, moves it to the system's PATH, and cleans up the downloaded file. ```bash wget https://sia.tech/downloads/latest/renterd_linux_amd64.zip &&\ unzip -j renterd_linux_amd64.zip renterd &&\ sudo mv renterd /usr/local/bin/renterd &&\ rm -fr renterd_linux_amd64.zip ``` -------------------------------- ### Run hostd service Source: https://docs.sia.tech/provide-storage/setting-up-hostd/macos Start the hostd service using this command. The web UI should automatically open in your browser upon successful startup. ```console hostd ``` -------------------------------- ### Install renterd using Homebrew Source: https://docs.sia.tech/store-your-data/setting-up-renterd/macos Use this command to install the renterd software on your macOS system via the Homebrew package manager. ```bash brew install siafoundation/sia/renterd ``` -------------------------------- ### Install renterd for ARM64 on Linux Source: https://docs.sia.tech/store-your-data/setting-up-renterd/linux/other Download and install the latest renterd version for ARM64 architecture. This command downloads the zip file, extracts the binary, moves it to the system's PATH, and cleans up the downloaded file. ```bash wget https://sia.tech/downloads/latest/renterd_linux_arm64.zip &&\ unzip -j renterd_linux_arm64.zip renterd &&\ sudo mv renterd /usr/local/bin/renterd &&\ rm -fr renterd_linux_arm64.zip ``` -------------------------------- ### Download hostd for AMD64 Source: https://docs.sia.tech/provide-storage/setting-up-hostd/linux/other Download the latest hostd binary for AMD64 architecture. This is the first step in installing hostd. ```bash wget https://sia.tech/downloads/latest/hostd_linux_amd64.zip ``` -------------------------------- ### Download hostd for ARM64 Source: https://docs.sia.tech/provide-storage/setting-up-hostd/linux/other Download the latest hostd binary for ARM64 architecture. This is the first step in installing hostd. ```bash wget https://sia.tech/downloads/latest/hostd_linux_arm64.zip ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.sia.tech/provide-storage/setting-up-hostd/linux Perform an HTTP GET request on the current page URL with the `ask` query parameter to dynamically query documentation. The question should be specific and self-contained. ```http GET https://docs.sia.tech/provide-storage/setting-up-hostd/linux.md?ask= ``` -------------------------------- ### Start Rclone Configuration Wizard Source: https://docs.sia.tech/integrations/s3-integrations/rclone Initiates the interactive rclone configuration process to set up a new remote storage. ```shell rclone config ``` -------------------------------- ### Query Documentation with HTTP GET Source: https://docs.sia.tech/get-started-with-sia/learn-about-siacoins Perform an HTTP GET request to a specific page URL and append the `ask` query parameter with your question. The response will contain a direct answer and relevant excerpts from the documentation. ```http GET https://docs.sia.tech/get-started-with-sia/learn-about-siacoins.md?ask= ``` -------------------------------- ### Check hostd Version Source: https://docs.sia.tech/provide-storage/setting-up-hostd/linux/debian Verify that hostd has been installed successfully by checking its version. ```bash hostd version ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.sia.tech/provide-storage/setting-up-hostd/linux/other Perform an HTTP GET request to the current page URL with the 'ask' query parameter to dynamically query the documentation. The question should be specific and in natural language. ```bash GET https://docs.sia.tech/provide-storage/setting-up-hostd/linux/other.md?ask= ``` -------------------------------- ### Extract and Install hostd for AMD64 Source: https://docs.sia.tech/provide-storage/setting-up-hostd/linux/other Unzip the hostd binary, move it to the system's PATH, and clean up the downloaded zip file for AMD64 architecture. ```bash unzip -j hostd_linux_amd64.zip hostd &&\ sudo mv -t /usr/local/bin hostd &&\ rm -rf hostd_linux_amd64.zip ``` -------------------------------- ### Extract and Install hostd for ARM64 Source: https://docs.sia.tech/provide-storage/setting-up-hostd/linux/other Unzip the hostd binary, move it to the system's PATH, and clean up the downloaded zip file for ARM64 architecture. ```bash unzip -j hostd_linux_arm64.zip hostd &&\ sudo mv -t /usr/local/bin hostd &&\ rm -rf hostd_linux_arm64.zip ``` -------------------------------- ### View renterd Service Logs Source: https://docs.sia.tech/store-your-data/setting-up-renterd/linux/other If the renterd service fails to start, use this command to view real-time console output for debugging. ```bash journalctl -fu renterd ``` -------------------------------- ### Query Documentation with GET Request Source: https://docs.sia.tech/provide-storage/about-hosting-on-sia Perform an HTTP GET request to the current page URL with the 'ask' query parameter to dynamically query the documentation. Use this when the answer is not explicitly present, for clarification, or to retrieve related documentation sections. ```http GET https://docs.sia.tech/provide-storage/about-hosting-on-sia.md?ask= ``` -------------------------------- ### Query Documentation Index Source: https://docs.sia.tech/renting/setting-up-renterd Use this GET request to ask specific questions about the documentation. The response includes direct answers and relevant excerpts. ```http GET https://docs.sia.tech/store-your-data/setting-up-renterd.md?ask= ``` -------------------------------- ### Install curl Source: https://docs.sia.tech/store-your-data/setting-up-renterd/linux/ubuntu Ensure curl is installed on your system before proceeding with the repository setup. This command installs curl if it's not already present. ```bash sudo apt update && sudo apt install curl ``` -------------------------------- ### Set up Sia APT Repository Source: https://docs.sia.tech/provide-storage/setting-up-hostd/linux/debian Configure the Sia apt repository to install and manage hostd. This involves downloading the GPG key, setting permissions, and updating the package list. ```bash sudo curl -fsSL https://linux.sia.tech/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/siafoundation.gpg sudo chmod 644 /usr/share/keyrings/siafoundation.gpg echo "deb [signed-by=/usr/share/keyrings/siafoundation.gpg] https://linux.sia.tech/debian $(. /etc/os-release && echo "$VERSION_CODENAME") main" | sudo tee /etc/apt/sources.list.d/siafoundation.list sudo apt update ``` -------------------------------- ### Run hostd configuration wizard Source: https://docs.sia.tech/provide-storage/setting-up-hostd/docker Launch the interactive configuration wizard for hostd to set up your seed phrase and admin password. Use this command to initialize your hostd instance. ```bash docker compose run --rm -it hostd config ``` -------------------------------- ### Get Blockchain Updates Source: https://docs.sia.tech/miscellaneous/v2/exchanges Retrieves a batch of blockchain updates, including block data and spent UTXOs, starting after a specified index. This is useful for exchanges to poll for new deposits and update their internal databases. ```APIDOC ## GET /api/consensus/updates/:index ### Description Retrieves up to 10 blocks after the specified chain index. This endpoint is designed for exchanges to poll for new deposits and can handle reverted blocks. ### Method GET ### Endpoint /api/consensus/updates/:index ### Parameters #### Path Parameters - **index** (string) - Required - The chain index of the last block that has been processed. Format is typically `height::blockID`. ### Response #### Success Response (200) - **applied** (array) - An array of applied updates, each containing block data, spent UTXOs, and other relevant information. - **update** (object) - **siacoinElements** (array) - Details of siacoin outputs and their states. - **siafundElementDiffs** (array) - Details of siafund outputs and their states. - **fileContractElementDiffs** (array) - Details of file contract diffs. - **v2FileContractElementDiffs** (array) - Details of v2 file contract diffs. - **attestationElements** (array) - Details of attestation elements. - **chainIndexElement** (object) - Information about the current chain index. - **updatedLeaves** (object) - A map of updated leaves. - **treeGrowth** (object) - Information about tree growth. - **oldNumLeaves** (integer) - The number of leaves before the update. - **numLeaves** (integer) - The number of leaves after the update. - **state** (object) - The current state of the blockchain. - **index** (object) - The current chain index. - **prevTimestamps** (array) - Timestamps of previous blocks. - **depth** (string) - The depth of the blockchain. - **childTarget** (string) - The child target for mining. - **siafundTaxRevenue** (string) - The amount of siafund tax revenue. - **oakTime** (integer) - The oak time. - **oakTarget** (string) - The oak target. - **foundationSubsidyAddress** (string) - The foundation subsidy address. - **foundationManagementAddress** (string) - The foundation management address. - **totalWork** (string) - The total work done on the blockchain. - **difficulty** (string) - The current difficulty. - **oakWork** (string) - The oak work. - **elements** (object) - Details about blockchain elements. - **attestations** (integer) - The number of attestations. - **block** (object) - The block data. - **parentID** (string) - The ID of the parent block. - **nonce** (integer) - The nonce of the block. - **timestamp** (string) - The timestamp of the block. - **minerPayouts** (array) - Miner payouts for the block. - **transactions** (array) - Transactions included in the block. ### Request Example ```sh curl http://localhost:9980/api/consensus/updates/0::0000000000000000000000000000000000000000000000000000000000000000 ``` ### Response Example ```json { "applied": [ { "update": { "siacoinElements": [ { "siacoinElement": { "id": "35b81e41f594d7faeb88bd8eaac2eaa68ce99fe1c8fe5f0cba8fafa65ab3a70e", "stateElement": { "leafIndex": 0, "merkleProof": [ "88052fa2d1e22e4a5542fed9686cdad3fbeccbc60d15d4fd36a7691d61add1e1" ] }, "siacoinOutput": { "value": "1000000000000000000000000000000000000", "address": "3d7f707d05f2e0ec7ccc9220ed7c8af3bc560fbee84d068c2cc28151d617899e1ee8bc069946" }, "maturityHeight": 0 }, "created": true, "spent": false } ], "siafundElementDiffs": [ { "siafundElement": { "id": "69ad26a0fbd1a6985d2053246650bb3ba5f3491d818748b6c8562db1ddb2c45b", "stateElement": { "leafIndex": 1, "merkleProof": [ "837482a39d5bf66f07bae3b89191e4375b82c9f341ce6a17e22e14e0333ab9f6" ] }, "siafundOutput": { "value": 10000, "address": "053b2def3cbdd078c19d62ce2b4f0b1a3c5e0ffbeeff01280efb1f8969b2f5bb4fdc680f0807" }, "claimStart": "0" }, "created": true, "spent": false } ], "fileContractElementDiffs": null, "v2FileContractElementDiffs": null, "attestationElements": null, "chainIndexElement": { "id": "e23d2ee56fc5c79618ead2f8f36c1b72c6f3ec5e0f751c05e08bd6665a6ec22a", "stateElement": { "leafIndex": 2 }, "chainIndex": { "height": 0, "id": "e23d2ee56fc5c79618ead2f8f36c1b72c6f3ec5e0f751c05e08bd6665a6ec22a" } }, "updatedLeaves": {}, "treeGrowth": {}, "oldNumLeaves": 0, "numLeaves": 3 }, "state": { "index": { "height": 0, "id": "e23d2ee56fc5c79618ead2f8f36c1b72c6f3ec5e0f751c05e08bd6665a6ec22a" }, "prevTimestamps": [ "2023-01-13T00:53:20-08:00", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z" ], "depth": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "childTarget": "0000000100000000000000000000000000000000000000000000000000000000", "siafundTaxRevenue": "0", "oakTime": 0, "oakTarget": "00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff", "foundationSubsidyAddress": "053b2def3cbdd078c19d62ce2b4f0b1a3c5e0ffbeeff01280efb1f8969b2f5bb4fdc680f0807", "foundationManagementAddress": "000000000000000000000000000000000000000000000000000000000000000089eb0d6a8a69", "totalWork": "1", "difficulty": "4294967295", "oakWork": "4294967297", "elements": { "numLeaves": 3, "trees": [ "e1c3af98d77463b767d973f8a563947d949d06428ff145db30143a2811d10014", "134b1f08aec0c7fbc50203a514277d197947e3da3ab1854749bf093b56402912" ] }, "attestations": 0 }, "block": { "parentID": "0000000000000000000000000000000000000000000000000000000000000000", "nonce": 0, "timestamp": "2023-01-13T00:53:20-08:00", "minerPayouts": [], "transactions": [ { "id": "268ef8627241b3eb505cea69b21379c4b91c21dfc4b3f3f58c66316249058cfd", "siacoinOutputs": [ { "value": "1000000000000000000000000000000000000", "address": "3d7f707d05f2e0ec7ccc9220ed7c8af3bc560fbee84d068c2cc28151d617899e1ee8bc069946" } ], "siafundOutputs": [ { "value": 10000, "address": "053b2def3cbdd078c19d62ce2b4f0b1a3c5e0ffbeeff01280efb1f8969b2f5bb4fdc680f0807" } ] } ] } }, { "update": { "siacoinElements": [ { "siacoinElement": { "id": "ca02d6807c92f61af94e626604615fbcdb471f38fcd8f3add6c6e6e0485ce090", "stateElement": { "leafIndex": 3, "merkleProof": [ "e1c3af98d77463b767d973f8a563947d949d06428ff145db30143a2811d10014", "134b1f08aec0c7fbc50203a514277d197947e3da3ab1854749bf093b56402912" ] } } } ] } } ] } ``` ``` -------------------------------- ### Launch walletd configuration wizard Source: https://docs.sia.tech/wallet/setting-up-walletd/docker Execute this command to start the interactive configuration wizard for walletd. This process is necessary for setting up a new wallet, including creating a seed phrase and an admin password. ```console docker compose run --rm -it walletd config ``` -------------------------------- ### Download and Install renterd (AMD64) Source: https://docs.sia.tech/store-your-data/setting-up-renterd/linux/other Download the latest renterd version for AMD64 architecture, unzip it, move the binary to the system path, and clean up the zip file. This process is for both Mainnet and Zen Testnet, with different download URLs and destinations. ```bash wget https://sia.tech/downloads/latest/renterd_linux_amd64.zip &&\ unzip -j renterd_linux_amd64.zip renterd &&\ sudo mv renterd /usr/local/bin/renterd &&\ rm -fr renterd_linux_amd64.zip ``` ```bash wget https://sia.tech/downloads/latest/renterd_linux_arm64.zip &&\ unzip -j renterd_linux_arm64.zip renterd &&\ sudo mv renterd /usr/local/bin/renterd &&\ rm -fr renterd_linux_arm64.zip ``` ```bash wget https://sia.tech/downloads/latest/renterd_zen_linux_amd64.zip &&\ unzip -j renterd_zen_linux_amd64.zip renterd &&\ sudo mv renterd /usr/local/bin/renterd_zen &&\ rm -fr renterd_zen_linux_amd64.zip ``` ```bash wget https://sia.tech/downloads/latest/renterd_zen_linux_arm64.zip &&\ unzip -j renterd_zen_linux_arm64.zip renterd &&\ sudo mv renterd /usr/local/bin/renterd_zen &&\ rm -fr renterd_zen_linux_arm64.zip ``` -------------------------------- ### Querying Documentation with GET Request Source: https://docs.sia.tech/store-your-data/setting-up-renterd/linux To get more information not present on the page, make a GET request to the current URL with an 'ask' query parameter containing your question. ```bash GET https://docs.sia.tech/store-your-data/setting-up-renterd/linux.md?ask= ``` -------------------------------- ### Construct and Send Transaction (Go Example) Source: https://docs.sia.tech/miscellaneous/v2/exchanges Demonstrates how to construct, sign, and broadcast a transaction using the wallet API in Go. This involves creating a wallet, adding an address, constructing the transaction, signing it with a private key, and broadcasting it to the network. ```go package main import ( "go.sia.tech/core/types" "go.sia.tech/walletd/v2/api" "go.sia.tech/walletd/v2/wallet" ) const ( walletdAPIAddress = "http://localhost:9980/api" walletdAPIPassword = "change me" ) func main() { privateKey := types.GeneratePrivateKey() // private key is a standard ed25519 private key unlockConditions := types.StandardUnlockConditions(privateKey.PublicKey()) depositAddress := unlockConditions.UnlockHash() recipientAddress := types.VoidAddress sendAmount := types.Siacoins(10) client := api.NewClient(walletdAPIAddress, walletdAPIPassword) w, err := client.AddWallet(api.WalletUpdateRequest{ Name: "test wallet", }) if err != nil { panic(err) } // create a wallet and add an address wc := client.Wallet(w.ID) err = wc.AddAddress(wallet.Address{ Address: depositAddress, SpendPolicy: &types.SpendPolicy{ Type: types.PolicyTypeUnlockConditions(unlockConditions), }, }) if err != nil { panic(err) } cs, err := client.ConsensusTipState() if err != nil { panic(err) } // construct a transaction sending 10 SC to the void address resp, err := wc.Construct([]types.SiacoinOutput{ {Address: recipientAddress, Value: sendAmount}, }, nil, depositAddress) if err != nil { panic(err) } bases := resp.Basis txn := resp.Transaction for i, sig := range txn.Signatures { // calculate the sig hash sigHash := cs.WholeSigHash(txn, sig.ParentID, 0, 0, nil) // sign the hash sig := privateKey.SignHash(sigHash) // add the signature to the transaction txn.Signatures[i].Signature = sig[:] } // broadcast the transaction if err := client.TxpoolBroadcast(basis, []types.Transaction{txn}, nil); err != nil { panic(err) } } ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.sia.tech/integrations/s3-integrations/rclone To get additional information not directly present on the page, perform an HTTP GET request with the 'ask' query parameter. The question should be specific and self-contained. ```http GET https://docs.sia.tech/integrations/s3-integrations/rclone.md?ask= ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.sia.tech/zen-testnet To get additional information not directly present on a page, perform an HTTP GET request with the `ask` query parameter. The question should be specific and in natural language. ```http GET https://docs.sia.tech/zen-testnet.md?ask= ``` -------------------------------- ### Start walletd service Source: https://docs.sia.tech/wallet/setting-up-walletd/macos This command starts the walletd service. You will be prompted to set an API password, which is used to access the walletd UI in your browser. This password is not stored and must be re-entered each time walletd is started. ```sh walletd ``` -------------------------------- ### Create and Configure renterd Data Directory Source: https://docs.sia.tech/store-your-data/setting-up-renterd/linux/other Sets up the directory for renterd's data, assigns ownership, and restricts permissions. Choose the command based on whether you are setting up for Mainnet or Zen Testnet. ```bash sudo mkdir /var/lib/renterd &&\ sudo chown renterd:renterd /var/lib/renterd &&\ sudo chmod o-rwx /var/lib/renterd ``` ```bash sudo mkdir /var/lib/renterd_zen &&\ sudo chown renterd_zen:renterd_zen /var/lib/renterd_zen &&\ sudo chmod o-rwx /var/lib/renterd_zen ``` -------------------------------- ### Initialize renterd configuration Source: https://docs.sia.tech/store-your-data/setting-up-renterd/macos Create the necessary directory and navigate to it before running the configuration wizard to set up your renterd wallet and settings. ```bash mkdir "$HOME/Library/Application Support/renterd" cd "$HOME/Library/Application Support/renterd" renterd config ``` -------------------------------- ### Open renterd Configuration File Source: https://docs.sia.tech/store-your-data/setting-up-renterd/linux/other Opens the renterd configuration file using nano for editing. Select the command corresponding to your network (Mainnet or Zen Testnet). ```bash sudo nano /var/lib/renterd/renterd.yml ``` ```bash sudo nano /var/lib/renterd_zen/renterd.yml ``` -------------------------------- ### Wallet Events Response Example Source: https://docs.sia.tech/miscellaneous/v2/exchanges Example JSON response structure for wallet events, detailing transaction information, confirmations, and timestamps. ```json [ { "id": "268ef8627241b3eb505cea69b21379c4b91c21dfc4b3f3f58c66316249058cfd", "index": { "height": 0, "id": "e23d2ee56fc5c79618ead2f8f36c1b72c6f3ec5e0f751c05e08bd6665a6ec22a" }, "confirmations": 45791, "type": "v1Transaction", "data": { "transaction": { "id": "268ef8627241b3eb505cea69b21379c4b91c21dfc4b3f3f58c66316249058cfd", "siacoinOutputs": [ { "value": "1000000000000000000000000000000000000", "address": "3d7f707d05f2e0ec7ccc9220ed7c8af3bc560fbee84d068c2cc28151d617899e1ee8bc069946" } ], "siafundOutputs": [ { "value": 10000, "address": "053b2def3cbdd078c19d62ce2b4f0b1a3c5e0ffbeeff01280efb1f8969b2f5bb4fdc680f0807" } ] } }, "maturityHeight": 0, "timestamp": "2023-01-13T08:53:20Z", "relevant": [ "053b2def3cbdd078c19d62ce2b4f0b1a3c5e0ffbeeff01280efb1f8969b2f5bb4fdc680f0807" ] } ] ``` -------------------------------- ### Start hostd in detached mode Source: https://docs.sia.tech/provide-storage/setting-up-hostd/docker Launch the hostd Docker container in the background. This command starts the Sia hostd service after configuration is complete. ```bash docker compose up -d ``` -------------------------------- ### Walletd V2 Transaction Example Source: https://docs.sia.tech/miscellaneous/v2/exchanges This Go program demonstrates how to create, sign, and broadcast a V2 Siacoin transaction using walletd and vaultd. It covers wallet initialization, seed import, key generation, address management, transaction construction, and signing with vaultd. Ensure your vaultd and walletd instances are running and accessible at the specified addresses. ```go package main import ( "context" "go.sia.tech/core/types" vaultd "go.sia.tech/vaultd/api" walletd "go.sia.tech/walletd/v2/api" "go.sia.tech/walletd/v2/wallet" ) const ( // api address of your vaultd vaultdAPIAddress = "http://localhost:9980" // api password of your vaultd vaultdAPIPassword = "change me" walletdAPIAddress = "http://localhost:9880" walletdAPIPassword = "change me" // number of keys to generate and import into vaultd. Make sure this is // large enough. You can always generate more keys by calling GenerateKeys // again. keysToGenerate = 100 // your siad seed to import phrase = "touchy inroads aptitude perfect seventh tycoon zinger madness firm cause diode owls meant knife nuisance skirting umpire sapling reruns batch molten urchins jaded nodes" ) func main() { vclient := vaultd.NewClient(vaultdAPIAddress, vaultdAPIPassword) wclient := walletd.NewClient(walletdAPIAddress, walletdAPIPassword) // create a new walletd wallet. This should not be necessary if you // already have a wallet. mywallet, err := wclient.AddWallet(walletd.WalletUpdateRequest{ Name: "test", }) if err != nil { panic(err) } mywalletClient := wclient.Wallet(mywallet.ID) // import seed to vaultd meta, err := vclient.AddSeed(context.Background(), phrase) if err != nil { panic(err) } // Generate keysToGenerate keys, returning the address and spend policy // for each key. Each call will result in n new addresses being generated resp, err := vclient.GenerateKeys(context.Background(), meta.ID, keysToGenerate) if err != nil { panic(err) } // add the new addresses to the wallet for _, addr := range resp { mywalletClient.AddAddress(wallet.Address{ Address: addr.Address, SpendPolicy: &addr.SpendPolicy, }) } addrResp, err := mywalletClient.Addresses() if err != nil { panic(err) } // construct a transaction to send 1 SC to a recipient txnResp, err := mywalletClient.ConstructV2([]types.SiacoinOutput{ {Address: types.VoidAddress, Value: types.Siacoins(1)}, }, nil, addrResp[0].Address) if err != nil { panic(err) } cs, err := wclient.ConsensusTipState() if err != nil { panic(err) } // sign the transaction signedTxn, ok, err := vclient.SignV2(context.Background(), cs, txnResp.Transaction) if err != nil { panic(err) } else if !ok { panic("transaction not signed") } // broadcast the signed transaction if err := wclient.TxpoolBroadcast(txnResp.Basis, nil, []types.V2Transaction{signedTxn}); err != nil { panic(err) } } ``` -------------------------------- ### renterd Configuration Example Source: https://docs.sia.tech/store-your-data/setting-up-renterd/linux/other Example configuration for renterd.yml, including seed phrase, API password, and autopilot heartbeat. Ensure your seed phrase and API password are correctly entered. ```yaml seed: your seed phrase goes here http: password: your_api_password autopilot: heartbeat: 5m ```