A decentralized naming system built with Next.js and Solidity smart contracts.
Try it out: pns-swart.vercel.app
Documentation: PNS GitBook
The project consists of two main components:
pns-app/: A Next.js application that provides the user interfacepns-v2/: Solidity smart contracts that handle the code service
The frontend is built with:
- Next.js
- TypeScript
- Tailwind CSS
- Modern React patterns and best practices
The smart contracts are written in Solidity and handle the core functionality of the naming system.
- Node.js (v18 or higher)
- pnpm (for package management)
- A Web3 wallet (like MetaMask)
- Clone the repository:
git clone https://github.com/mokita-j/pns.git
cd pns- Install dependencies for the frontend:
cd pns-app
pnpm install- Set up your environment variables:
Create a .env.local file in the pns-app directory with the necessary environment variables.
To run the frontend application in development mode:
cd pns-app
pnpm devThe application will be available at http://localhost:3000.
Create a .env.local file in the pns-app directory with the following variables:
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=your_project_id_hereTo get your WalletConnect Project ID:
- Go to WalletConnect Cloud
- Sign up or log in
- Create a new project
- Copy the Project ID and paste it in your
.env.localfile
- Push your code to a GitHub repository
- Go to Vercel
- Sign up or log in with your GitHub account
- Click "New Project"
- Import your repository
- Configure the project:
- Root Directory: pns-app
- Add your environment variables in the Vercel dashboard
- Click "Deploy"
- Go to Remix IDE
- Connect your wallet (MetaMask or other Web3 wallet)
- Create a new file in the contracts directory
- Copy and paste your smart contract code
- Compile the contract:
- Click the "Solidity Compiler" tab
- Select the appropriate compiler version
- Click "Compile"
- Deploy the contract:
- Click the "Deploy & Run Transactions" tab
- Select your contract from the dropdown
- Click "Deploy"
- Confirm the transaction in your wallet
Note: Before deploying, make sure to:
- Add Asset Hub Westend Testnet to MetaMask:
- Network name: Asset-Hub Westend Testnet
- RPC URL:
https://westend-asset-hub-eth-rpc.polkadot.io - Chain ID:
420420421 - Currency Symbol:
WND - Block Explorer URL:
https://blockscout-asset-hub.parity-chains-scw.parity.io
- Get test tokens from the Westend Faucet
- Enter your MetaMask address
- You'll receive 100 WND tokens per request
- You can request tokens every 24 hours