This is a Node.js example for issuing an RGB token and verifying a consignment on Bitcoin testnet using rgb-lib
.
- Node.js >= 18
- npm or yarn
- Bitcoin Core running in testnet mode with
-txindex=1
- Some testnet coins in your wallet (via Bitcoin testnet faucet)
- RPC enabled in
bitcoin.conf
:
testnet=1
server=1
rpcuser=bitcoinrpc
rpcpassword=yourpassword
rpcallowip=127.0.0.1
txindex=1
rgb-lib
installed via npm
git clone https://github.com/AI-Robotic-Labs/demo-ai-agent-rgb.git
cd rgb-testnet-demo
npm install
Copy the example config and edit your RPC details:
cp config.json.example config.json
Edit config.json
to set your Bitcoin Core testnet RPC credentials:
{
"bitcoin": {
"rpc": {
"host": "127.0.0.1",
"port": 18332,
"user": "bitcoinrpc",
"pass": "yourpassword"
}
}
}
npm start
🤖 AI: Starting RGB Testnet Demo...
🤖 AI: Issuer public key: tpub...
🤖 AI: Anchor TXID: ...
🤖 AI: Consignment saved: demo-consignment.rgb
🤖 AI: ✅ Verification succeeded
MIT
# 1. Clone repo
git clone https://github.com/AI-Robotic-Labs/demo-ai-agent-rgb.git
cd rgb-testnet-demo
# 2. Install dependencies
npm install
# 3. Configure RPC
cp config.json.example config.json
# edit config.json with your Bitcoin Core testnet RPC creds
# 4. Start demo
npm start