joinNetwork

joinNetwork is a method on the ARIO class that joins a gateway to the ar.io network via its associated wallet.

joinNetwork requires authentication.

Parameters

ParameterTypeDescriptionOptional
qtynumberNumber of tokens, in `mARIO` to stake when joining network.false
autoStakebooleanIf true, automatically stakes gateway rewards.false
allowDelegatedStakingbooleanIf true, allows third parties to delegate stake to the gateway.false
minDelegatedStakenumberMinimum number of tokens, in `mARIO` that can be delegated to the gateway.false
delegateRewardShareRationumberPercentage of gateway rewards to share with delegates. e.g. 10%false
labelstringFriendly name for gateway, min 1 character, max 64 characters.false
notestringA note to be associated with gateway, max 256 characters.false
propertiesstring - ArweaveTxIdArweaveTxId to properties object containing additional gateway configuration details.false
observerWalletstring - WalletAddressPublic wallet address for wallet used to upload network observations.false
fqdnstringFully qualified domain name, must be valid domain owned by gateway operator.false
portnumberPort number to use when accessing gateway, generally 443 (https)false
protocolstring - "http" || "https"Protocol to use when accessing gateway, only "https" is supported for network participation.false
tagsarrayAn array of GQL tag objects to attach to the joinNetwork AO message.true

Example

joinNetwork

 const fs = require("fs");
 const { ARIO, ArweaveSigner, ARIOToken } = require("@ar.io/sdk");

 async function main() {
 const jwk = JSON.parse(fs.readFileSync("KeyFile.json"));
 const ario = ARIO.init({
     signer: new ArweaveSigner(jwk),
 });

 const { id: txId } = await ario.joinNetwork(
     {
         qty: new ARIOToken(10_000).toMARIO(), // minimum operator stake allowed
         autoStake: true, // auto-stake operator rewards to the gateway
         allowDelegatedStaking: true, // allows delegated staking
         minDelegatedStake: new ARIOToken(100).toMARIO(), // minimum delegated stake allowed
         delegateRewardShareRatio: 10, // percentage of rewards to share with delegates (e.g. 10%)
         label: 'john smith', // min 1, max 64 characters
         note: 'The example gateway', // max 256 characters
         properties: 'FH1aVetOoulPGqgYukj0VE0wIhDy90WiQoV3U2PeY44', // Arweave transaction ID containing additional properties of the Gateway
         observerWallet: '0VE0wIhDy90WiQoV3U2PeY44FH1aVetOoulPGqgYukj', // wallet address of the observer, must match OBSERVER_WALLET on the observer
         fqdn: 'example.com', // fully qualified domain name - note: you must own the domain and set the OBSERVER_WALLET on your gateway to match `observerWallet`
         port: 443, // port number
         protocol: 'https', // only 'https' is supported
     },
     // optional additional tags
     { tags: [{ name: 'App-Name', value: 'My-Awesome-App' }] },
     );
 }

 main();