Skip to content

pokt-network/pocket-knife

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pocket Knife

Syntactic sugar for pocketd – a Swiss army knife of common helpful commands and operations

Python License

Overview

Pocket Knife is a powerful Python-based CLI wrapper for Pocket Network's pocketd command line tool. It streamlines complex blockchain operations with beautiful output, sensible defaults, and user-friendly commands.

Quick Start

# Install
git clone https://github.com/buildwithgrove/pocket-knife.git
cd pocket-knife
make install

# Use anywhere
pocketknife --help

Commands

Command Description Documentation
add-services Add or modify services from file 📖 Docs
delete-keys Delete keys from keyring (all or by pattern) 📖 Docs
export-keys Export private keys in hex format 📖 Docs
fetch-suppliers Get all operator addresses for an owner 📖 Docs
generate-keys Generate multiple keys with mnemonics 📖 Docs
import-keys Import keys from mnemonic or hex 📖 Docs
stake-apps Stake applications (single or batch) 📖 Docs
treasury Comprehensive balance analysis 📖 Docs
treasury-tools Individual balance queries (liquid, stakes, etc.) 📖 Docs
unstake Batch unstake operator addresses 📖 Docs

Installation

Quick Install (Recommended)

git clone https://github.com/buildwithgrove/pocket-knife.git
cd pocket-knife
make install

Manual Installation

# Prerequisites: Python 3.8+, pocketd CLI

# Clone repository
git clone https://github.com/buildwithgrove/pocket-knife.git
cd pocket-knife

# Install with pipx (recommended)
pipx install .

# Or install in development mode
pip install -e .

Keyring Backends

The os backend is used by default. For testing and development, you can use other backends:

# Example: Using test backend (no password required)
pocketknife generate-keys 5 myapp 0 --keyring-backend test
pocketknife export-keys mykey --keyring-backend test

Common Usage Patterns

Generate and Export Keys

# Generate keys (test keyring - no password)
pocketknife generate-keys 10 grove-app 0 --keyring-backend test

# Export for backup
pocketknife export-keys --file keynames.txt --keyring-backend test

Import and Use Keys

# Import from backup
pocketknife import-keys --file backup.txt -t recover --keyring-backend os --pwd YOUR_PASSWORD

# Stake applications
pocketknife stake-apps pokt1abc... 1000000 anvil --keyring-backend os --pwd YOUR_PASSWORD

Manage Keys

# List keys
pocketd keys list --keyring-backend test

# Delete test keys by pattern
pocketknife delete-keys --keyring test --pattern grove-app --pwd 12345678

# Clean up all test keys
pocketknife delete-keys --keyring test --pwd 12345678

Configuration

Default Settings

  • Home directory: ~/.pocket/
  • Keyring backend: os (most commands) or test (unstake)
  • Network: main
  • Default password: 12345678 (⚠️ always override with --pwd for os keyring!)

Network Endpoints

  • Main RPC: https://shannon-grove-rpc.mainnet.poktroll.com
  • Beta RPC: https://shannon-testnet-grove-rpc.beta.poktroll.com

Development

Built with:

  • Typer - Modern CLI framework
  • Rich - Beautiful terminal output
  • pocketd - Pocket Network CLI tool

License

MIT License - see LICENSE file for details.


Made with ❤️ for the Pocket Network community

Report BugRequest Feature

About

Syntactic sugar for pocketd – a Swiss army knife of common helpful commands and operations

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •