Overview
The Viction console is an interactive JavaScript runtime environment that provides a powerful interface for interacting with a Viction node. It exposes the full Web3 JavaScript API along with node administration interfaces.Commands
console
Start an interactive JavaScript environment with a new or existing Viction node.Description
Theconsole command starts a full Viction node and attaches an interactive JavaScript console to it. This is the primary method for local node interaction and administration.
The console exposes:
- Complete Web3 JavaScript Ðapp API
- Node administration interface
- Account management functions
- Network and peer management
- Blockchain query capabilities
Options
The console command accepts all standard node flags plus console-specific options:string
default:"."
JavaScript root path for
loadScript commandstring
Execute JavaScript statement and exit (non-interactive mode)
string
Comma separated list of JavaScript files to preload into the console
Interactive Example
Execute Single Command
Preload Scripts
attach
Connect to an already running Viction node.Description
Theattach command connects to a running Viction node via IPC, WebSocket, or HTTP and opens an interactive JavaScript console. This is useful for:
- Managing a node running as a background service
- Connecting to remote nodes
- Running multiple console sessions on the same node
Endpoint Formats
string
tomo attach /path/to/tomo.ipcConnects via IPC socket (most secure, local only)string
tomo attach ws://hostname:8546Connects via WebSocket (supports remote connections)string
tomo attach http://hostname:8545Connects via HTTP RPC (supports remote connections)Options
string
default:"."
JavaScript root path for
loadScript commandstring
Execute JavaScript statement and exit
string
Comma separated list of JavaScript files to preload
string
Data directory for finding the default IPC endpoint
Examples
Attach via IPC (default):~/.tomo/tomo.ipc
Attach via IPC with custom path:
js
Execute JavaScript files without interactive mode.Description
Thejs command starts an ephemeral Viction node, executes the specified JavaScript files in sequence, and then shuts down. This is useful for:
- Automated blockchain tasks
- Scripted deployments
- Batch operations
- Testing and development
Options
Accepts all standard node flags plus:string
default:"."
JavaScript root path for relative file paths
string
Comma separated list of JavaScript files to preload before execution
Example Scripts
check_balance.js:Usage
The node will wait for pending callbacks to complete. Press Ctrl-C to force exit.
JavaScript API
The console exposes several API modules:Web3 Modules
eth - Ethereum/Viction Protocol
eth - Ethereum/Viction Protocol
personal - Account Management
personal - Account Management
net - Network Information
net - Network Information
admin - Node Administration
admin - Node Administration
txpool - Transaction Pool
txpool - Transaction Pool
miner - Staking/Mining
miner - Staking/Mining
debug - Debugging
debug - Debugging
web3 - Utility Functions
web3 - Utility Functions
Console Features
Command History
The console maintains command history across sessions:- Up/Down arrows: Navigate history
- Ctrl+R: Reverse history search
- History file:
~/.tomo/history
Tab Completion
Press Tab to auto-complete:Loading Scripts
Pretty Printing
Large objects are automatically formatted:Common Console Tasks
Check Node Status
Account Operations
Send Transactions
Query Blockchain
Smart Contract Interaction
Masternode Management
Security Considerations
Tips and Tricks
Create Aliases
Create convenient aliases for common operations:Monitor Events
Exit Console
To exit the console:Ctrl+D
Troubleshooting
Cannot Connect via Attach
- Ensure the node is running
- Verify the endpoint path/URL
- For WebSocket/HTTP, ensure the server is enabled:
Module Not Available
If a module (e.g.,personal) is not available:
- Check which modules are enabled (shown at console start)
- For attach via HTTP/WS, enable the module:
Script Execution Errors
If scripts fail withloadScript:
- Verify the file path is correct
- Check file permissions
- Use absolute paths or set
--jspathcorrectly - Look for syntax errors in the script
See Also
- tomo Command - Main command overview
- Account Commands - Account management
- Flags Reference - RPC and WebSocket configuration flags