From 477cd6e06a62f39bb690a03e5838e05e63c2ee87 Mon Sep 17 00:00:00 2001 From: bobinstein Date: Mon, 25 Mar 2024 13:24:40 -0400 Subject: [PATCH 1/2] docs: Updated delegate stake for cli tools --- docs/src/guides/delegated-staking.md | 43 ++++++++++++---------------- 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/docs/src/guides/delegated-staking.md b/docs/src/guides/delegated-staking.md index a6cfd1df..dfcdba35 100644 --- a/docs/src/guides/delegated-staking.md +++ b/docs/src/guides/delegated-staking.md @@ -45,11 +45,18 @@ yarn install ## Providing Wallet -In order to send tokens to be staked, you will need to use a wallet that has IO tokens in it. You can provide this wallet by saving a keyfile in the testnet-contract repo, and name the file `key.json`. +In order to send tokens to be staked, you will need to use a wallet that has IO tokens in it. The easiest way to provide your wallet is to put the path to your Keyfile in your `.env` as `WALLET_FILE_PATH`. You will need a small amount of AR in this wallet, in addition to the IO tokens, in order to pay for the contract interaction. -## Editing the script + +```js +//.env + +WALLET_FILE_PATH= +``` + + ## Running the Script -Once the above is set all that is left is to run the script. This can be done with a single command in your terminal. +Once the repo is installed and your wallet is provided, all that is left is to run the script. This can be done with a single command in your terminal. Make sure your terminal is in the root folder of the testnet-contract repo (the one named 'testnet-contract'), and run this command: ```bash -yarn ts-node tools/delegate-stake.ts +yarn delegate-stake ``` -## Withdrawing Stake +You will be prompted in your terminal for the number of tokens you want to stake, and the wallet address of the target gateway. -If you want to take your staked tokens out of a gateway, the process is very similar. You will be editing and running the `decrease-delegate-stake.ts` file instead of the `delegate-stake.ts` file. - -The structures of bot files are similar, and there are only the same two lines to edit: - -```ts -const qty = 500; -``` +## Withdrawing Stake -This line represents the number of tokens you want to remove from staking. +If you want to take your staked tokens out of a gateway, the process is very similar. You will be running the `decrease-delegate-stake` script instead of the `delegate-stake` script. -```ts - const target = 'QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ'; +```bash +yarn decrease-delegate-stake ``` -This line represents the address of the gateway you want to withdraw from. +You will again be prompted for the number of tokens you want to withdraw and the wallet address of the gateway you want to withdraw from. Only the wallet that owns the staked tokens can withdraw, so make sure you are using the same wallet to run the script as you used to stake the tokens initially. -Run the script in the same way you ran the staking script, being sure to use the decrease file and not the staking file. - -```bash -yarn ts-node tools/decrease-delegate-stake.ts -``` - -Token withdrawals are not instant, and there is a period where the tokens will remain unavailable after you run the script. The length of this hold may vary a bit during testnet while optimal times are iterated upon. +**NOTE**: Token withdrawals are not instant, and there is a period where the tokens will remain unavailable after you run the script. The length of this hold may vary a bit during testnet while optimal times are iterated upon. From 11b233f6042899df4927a526e26909ebc9098d47 Mon Sep 17 00:00:00 2001 From: bobinstein Date: Mon, 25 Mar 2024 13:33:07 -0400 Subject: [PATCH 2/2] docs: Edited enabling delegated stake docs --- .../gateways/ar-io-node/delegated-staking.md | 34 +++++++++++++++---- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/docs/src/gateways/ar-io-node/delegated-staking.md b/docs/src/gateways/ar-io-node/delegated-staking.md index 013effb4..fa0a0f7e 100644 --- a/docs/src/gateways/ar-io-node/delegated-staking.md +++ b/docs/src/gateways/ar-io-node/delegated-staking.md @@ -44,11 +44,17 @@ yarn install ## Providing Wallet -In order to update your gateway settings, you need to run the script using the wallet associated with your gateway. You can provide this wallet by saving a keyfile in the testnet-contract repo, and name the file `key.json`. +In order to update your gateway settings, you need to run the script using the wallet associated with your gateway. The easiest way to provide your wallet is to put the path to your Keyfile in your `.env` as `WALLET_FILE_PATH` -You will need a small amount of AR in this wallet, in addition to the IO tokens, in order to pay for the contract interaction. +You will need a small amount of AR in this wallet in order to pay for the contract interaction. -## Editing the Script +```js +//.env + +WALLET_FILE_PATH= +``` + + ## Running the Script -Once the above is set all that is left is to run the script. This can be done with a single command in your terminal. +Once the repo is installed and your wallet is provided, all that is left is to run the script. This can be done with a single command in your terminal. Make sure your terminal is in the root folder of the testnet-contract repo (the one named 'testnet-contract'), and run this command: ```bash -yarn ts-node tools/update-gateway-settings.ts -``` \ No newline at end of file +yarn update-gateway-settings +``` + +You will be prompted in your terminal for the values of various settings on your gateway. The default value for each prompt will be your current setting, so if you don't want to change something, simply press `ENTER` to move to the next prompt. + +- **Enter your a friendly name for your gateway**: This is a name or `label` for your gateway. +- **Enter your domain for this gateway**: This is the domain name for your gateway. It should be the full domain, without any protocol ("http/https") prefix. For example: "vilenarios.com". +- **Enter port used for this gateway**: The primary access port people should use to access your gateway. Except for some advanced use cases, this value should be 443. +- **Enter protocol used for this gateway**: http or https. Most users will want to use https. +- **Enter gateway properties transaction ID (use default if not sure)**: Arweave TxId for your gateway properties setting. This is not a widely implemented feature yet, so most people will just press `ENTER` to accept the default value. +- **Enter short note to further describe this gateway**: A short description of your gateway. Must be 256 characters or less. +- **Enter the observer wallet public address**: The public wallet address being used for your Observer. It will default to the wallet being used to join the network. +- **Enable or disable delegated staking?**: Do you want to allow people to stake tokens on your gateway? `y` for yes or `n` for no. +- **Enter the percent of gateway and observer rewards given to delegates**: What percentage of your gateway rewards do you want to give to your delegated stakers? Defaults to 10%. +- **Enter the minimum delegate stake for this gateway (in IO)**: The minimum number of tokens a person has to stake to delegate to your gateway. Defaults to 100. +- **CONFIRM GATEWAY DETAILS?**: This is your last chance to review all of your settings before submitting the transaction. `y` to confirm and submit, `n` to cancel. \ No newline at end of file