leaveNetwork

leaveNetwork is a method on the ARIO class that sets the gateway as leaving on the ar.io network. The gateways operator and delegate stakes are vaulted and will be returned after the leave periods. The gateway will be removed from the network after the leave period.

leaveNetwork requires authentication.

Parameters

ParameterTypeDescriptionOptional
tagsarrayAn array of GQL tag objects to attach to the leaveNetwork AO message.true

Example

leaveNetwork

 const fs = require("fs");
 const { ARIO, ArweaveSigner } = 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.leaveNetwork(
         // optional additional tags
         { tags: [{ name: 'App-Name', value: 'My-Awesome-App' }] },
     );
 }

 main();