npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

rns-domain-manager

v0.1.1

Published

CLI tool to manage RNS (.rsk) domains on Rootstock blockchain

Readme

RNS Domain Manager (CLI)

npm version npm downloads

A TypeScript CLI tool to manage RNS (.rsk) domains on the Rootstock blockchain. Register, transfer, and manage your blockchain domain names directly from your terminal.

📦 Install

npm install -g rns-domain-manager

🚀 Quick Usage

# Check domain availability
rsk rns:register mydomain --owner 0xYourAddress --network testnet --dry-run

# Register a domain
rsk rns:register mydomain --owner 0xYourAddress --network testnet

🌐 What is RNS?

RNS (Rootstock Name Service) is the official decentralized domain name system for the RSK blockchain, similar to ENS on Ethereum. It allows you to register human-readable .rsk domains instead of using long wallet addresses.

✨ Features

  • Domain Registration: Register new .rsk domains with commit-reveal process
  • Domain Transfer: Transfer ownership of existing domains
  • Availability Check: Check if domains are available before registration
  • Price Calculation: See registration costs in RIF tokens
  • Multi-Network: Support for both RSK Testnet and Mainnet
  • JSON Output: Machine-readable output for scripting
  • Dry Run: Test commands without executing transactions

🚀 Quick Start

1. Installation

Global Installation (Recommended)

# Install globally from NPM
npm install -g rns-domain-manager

# Use directly from anywhere
rsk --help

One-line Installation & Usage

# Install and use in one command (without global installation)
npx rns-domain-manager --help

# Register a domain directly
npx rns-domain-manager rns:register mydomain --owner 0xYourAddress --network testnet --dry-run

Local Development (For Contributors)

# Clone the repository
git clone https://github.com/yourusername/rns-domain-manager.git
cd rns-domain-manager

# Install dependencies
npm install

# Build the project
npm run build

# Use locally
node dist/index.js --help

2. Configuration

# Copy environment template
cp .env.example .env

# Edit .env with your settings

Required .env settings:

# Your private key (with 0x prefix)
PRIVATE_KEY=0xYOUR_PRIVATE_KEY

# RPC endpoints
RPC_URL_TESTNET=https://public-node.testnet.rsk.co
RPC_URL_MAINNET=https://public-node.rsk.co

3. Test the CLI

# Check help
rsk --help

# Test domain availability (dry run)
rsk rns:register mydomain --owner 0xYourAddress --network testnet --dry-run

📋 Commands

Register Domain

Register a new .rsk domain:

rsk rns:register <label> --owner <address> [options]

Options:

  • --owner <address> - Owner address (required)
  • --years <n> - Registration duration in years (default: 1)
  • --network <net> - Network: testnet or mainnet (default: testnet)
  • --dry-run - Check availability and price without registering
  • --json - Output in JSON format

Examples:

# Check availability and price
rsk rns:register mydomain --owner 0xCdC20B8B31f4AD4a996D1425aDF7f786BB94b0c3 --network testnet --dry-run

# Register for 1 year
rsk rns:register mydomain --owner 0xCdC20B8B31f4AD4a996D1425aDF7f786BB94b0c3 --network testnet

# Register for 2 years with JSON output
rsk rns:register mydomain --owner 0xCdC20B8B31f4AD4a996D1425aDF7f786BB94b0c3 --network testnet --years 2 --json

Transfer Domain

Transfer ownership of an existing domain:

rsk rns:transfer <domain> --to <address> [options]

Options:

  • --to <address> - Recipient address (required)
  • --network <net> - Network: testnet or mainnet (default: testnet)
  • --json - Output in JSON format

Examples:

# Transfer domain
rsk rns:transfer mydomain.rsk --to 0xNewOwnerAddress --network testnet

# Transfer with JSON output
rsk rns:transfer mydomain.rsk --to 0xNewOwnerAddress --network testnet --json

🌐 Networks

Testnet (Default)

  • Chain ID: 31
  • Purpose: Testing and development
  • Tokens: tRBTC (gas) + tRIF (registration)
  • Cost: 2 tRIF per year
  • Explorer: https://explorer.testnet.rsk.co

Mainnet

  • Chain ID: 30
  • Purpose: Production use
  • Tokens: RBTC (gas) + RIF (registration)
  • Cost: 2 RIF per year
  • Explorer: https://explorer.rsk.co

💰 Token Requirements

Testnet

  • tRBTC: For gas fees (small amount needed)
  • tRIF: 2 tokens per year of registration

Mainnet

  • RBTC: For gas fees (small amount needed)
  • RIF: 2 tokens per year of registration

Getting Testnet Tokens:

  • tRBTC: RSK Testnet faucets
  • tRIF: RSK Testnet faucets or testnet DEXs

🔧 Contract Addresses

Testnet Contracts

  • Registry: 0x7d284aaac6e925aad802a53c0c69efe3764597b8
  • RIF Token: 0x19f64674d8a5b4e652319f5e239efd3bc969a1fe
  • RSK Owner: 0xca0a477e19bac7e0e172ccfd2e3c28a7200bdb71
  • FIFS Registrar: 0x90734bd6bf96250a7b262e2bc34284b0d47c1e8d

Mainnet Contracts

  • Registry: 0xcb868aeabd31e2b66f74e9a55cf064abb31a4ad5
  • RIF Token: 0x2acc95758f8b5f583470ba265eb685a8f45fc9d5
  • RSK Owner: 0x45d3e4fb311982a06ba52359d44cb4f5980e0ef1
  • FIFS Registrar: 0xd9c79ced86ecf49f5e4a973594634c83197c35ab

📖 Usage Examples

Complete Registration Flow

# 1. Check if domain is available
rsk rns:register myawesome --owner 0xYourAddress --network testnet --dry-run

# Output: {"domain": "myawesome.rsk", "available": true, "years": 1, "priceWei": "2000000000000000000"}

# 2. Register the domain
rsk rns:register myawesome --owner 0xYourAddress --network testnet

# Output: {"domain": "myawesome.rsk", "network": "testnet", "chainId": 31, "commitTxHash": "...", "registerTxHash": "..."}

Check Your Balance

# Check your wallet balances (example script)
node -e "
const { ethers } = require('ethers');
const provider = new ethers.providers.JsonRpcProvider('https://public-node.testnet.rsk.co', 31);
const wallet = new ethers.Wallet('YOUR_PRIVATE_KEY', provider);

async function checkBalance() {
  const tRBTCBalance = await wallet.getBalance();
  console.log('tRBTC:', ethers.utils.formatEther(tRBTCBalance));
  
  const rifContract = new ethers.Contract('0x19f64674d8a5b4e652319f5e239efd3bc969a1fe', 
    ['function balanceOf(address) view returns (uint256)'], provider);
  const rifBalance = await rifContract.balanceOf(wallet.address);
  console.log('tRIF:', ethers.utils.formatEther(rifBalance));
}
checkBalance();
"

🔍 Troubleshooting

Common Issues

1. "PRIVATE_KEY not set in .env"

  • Ensure your private key starts with 0x
  • Check the .env file exists and is readable

2. "Missing RPC URL"

  • Add the appropriate RPC URL to your .env file
  • Testnet: https://public-node.testnet.rsk.co
  • Mainnet: https://public-node.rsk.co

3. "Transaction may fail or may require manual gas limit"

  • Usually means insufficient RIF tokens for registration
  • Check your token balance (need 2 RIF per year)

4. "bad address checksum"

  • Ensure addresses are properly checksummed
  • Use tools like ethers.js to get correct checksum

Getting Help

# General help
rsk --help

# Command-specific help
rsk rns:register --help
rsk rns:transfer --help

🛠️ Development

Project Structure

src/
├── index.ts              # CLI entry point
├── config.ts             # Network configuration
├── types.ts              # TypeScript definitions
├── lib/
│   ├── rns.ts           # RNS SDK wrapper
│   └── ui.ts            # Output utilities
└── commands/
    └── rns/
        ├── register.ts   # Registration command
        └── transfer.ts   # Transfer command

Build & Run

# Development mode
npm run dev

# Build for production
npm run build

# Lint code
npm run lint

📦 NPM Package

This CLI is available as an NPM package for easy installation:

Package Stats

  • Size: ~8KB (lightweight)
  • Dependencies: Minimal and secure
  • Compatibility: Node.js 14+

📄 License

MIT

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

🎯 Support


Happy domain registering! 🎉