register
register
is a method on the ANTRegistry
class that registers a new ANT process with the ANT Registry, making it discoverable and accessible.
register
requires authentication.
Parameters
← Swipe to see more →
Parameter | Type | Description | Optional |
---|---|---|---|
processId | string | The process ID of the ANT to register | false |
tags | array | An array of GQL tag objects to attach to the registration AO message | true |
← Swipe to see more →
Examples
register
const fs = require("fs");
const { ANTRegistry, ArweaveSigner } = require("@ar.io/sdk");
async function main() {
const jwk = JSON.parse(fs.readFileSync("KeyFile.json"));
const antRegistry = ANTRegistry.init({
signer: new ArweaveSigner(jwk),
});
const { id: txId } = await antRegistry.register(
{
processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM"
},
// optional additional tags
{ tags: [{ name: 'App-Name', value: 'My-Awesome-App' }] },
);
console.log(txId);
}
main();