Some checks failed
Cross-Node Transaction Testing / transaction-test (push) Has been cancelled
Deploy to Testnet / deploy-testnet (push) Has been cancelled
Documentation Validation / validate-docs (push) Has been cancelled
Documentation Validation / validate-policies-strict (push) Has been cancelled
Multi-Node Stress Testing / stress-test (push) Has been cancelled
Coverage Phase 1 (70% Target) / test-coverage-70 (push) Has been cancelled
Coverage Phase 2 (85% Target) / test-coverage-85 (push) Has been cancelled
Python Tests / test-python (push) Has been cancelled
- ssh-access-patterns.md: Clarify ns3/aitbc container setup with correct paths and service names - Add container hostname verification command - Update paths: /etc/aitbc/blockchain.env, /opt/aitbc/apps/blockchain-node/ - Fix service name: aitbc-blockchain-node (not aitbc-blockchain-node-3) - Add service restart and log viewing examples - test_workflow.sh: Rewrite as comprehensive integration test suite - Add
126 lines
3.4 KiB
Markdown
126 lines
3.4 KiB
Markdown
# SSH Access Patterns for AITBC Nodes
|
|
|
|
## Purpose
|
|
Document SSH access patterns for all AITBC nodes in the infrastructure.
|
|
|
|
## Node Access Patterns
|
|
|
|
### aitbc (localhost)
|
|
Direct access - no SSH required.
|
|
```bash
|
|
# Run commands directly on localhost
|
|
echo "command"
|
|
systemctl restart service-name
|
|
curl http://127.0.0.1:8006/rpc/head
|
|
```
|
|
|
|
### aitbc1
|
|
Direct SSH access.
|
|
```bash
|
|
ssh aitbc1
|
|
# Or execute single command
|
|
ssh aitbc1 "command"
|
|
# Access aitbc1's blockchain RPC
|
|
ssh aitbc1 "curl http://127.0.0.1:8006/rpc/head"
|
|
# Access aitbc from aitbc1
|
|
ssh aitbc1 "curl http://aitbc:8006/rpc/head"
|
|
```
|
|
|
|
### gitea-runner (hosts aitbc2 blockchain node)
|
|
Direct SSH access. The aitbc2 blockchain node runs on this same host.
|
|
```bash
|
|
ssh gitea-runner
|
|
# Or execute single command
|
|
ssh gitea-runner "command"
|
|
# aitbc2 blockchain node runs on this host
|
|
|
|
# Execute aitbc2-specific commands
|
|
ssh gitea-runner "/opt/aitbc/aitbc-cli blockchain info"
|
|
ssh gitea-runner "systemctl status aitbc-blockchain-node --no-pager"
|
|
```
|
|
|
|
### ns3 (hosts hub.aitbc.bubuit.net incus container)
|
|
Direct SSH access. The hub.aitbc.bubuit.net service runs as an incus container named "aitbc" on ns3.
|
|
```bash
|
|
ssh ns3
|
|
# Or execute single command
|
|
ssh ns3 "command"
|
|
|
|
# Access the aitbc container (hub.aitbc.bubuit.net)
|
|
ssh ns3 "incus exec aitbc -- bash"
|
|
# Or execute single command in container
|
|
ssh ns3 "incus exec aitbc -- command"
|
|
|
|
# Check container hostname
|
|
ssh ns3 "incus exec aitbc -- hostname"
|
|
# Output: hub.aitbc.bubuit.net
|
|
|
|
# Container IP: 192.168.100.10
|
|
# Access via container IP from ns3
|
|
ssh ns3 "curl http://192.168.100.10:8006/rpc/head"
|
|
|
|
# Check environment configuration in container
|
|
ssh ns3 "incus exec aitbc -- cat /etc/aitbc/blockchain.env"
|
|
ssh ns3 "incus exec aitbc -- cat /etc/aitbc/node.env"
|
|
|
|
# Check blockchain node configuration
|
|
ssh ns3 "incus exec aitbc -- cat /opt/aitbc/apps/blockchain-node/src/aitbc_chain/config.py"
|
|
|
|
# Check service status in container
|
|
ssh ns3 "incus exec aitbc -- systemctl status aitbc-blockchain-node --no-pager"
|
|
|
|
# Restart service in container
|
|
ssh ns3 "incus exec aitbc -- systemctl restart aitbc-blockchain-node"
|
|
|
|
# View service logs in container
|
|
ssh ns3 "incus exec aitbc -- journalctl -u aitbc-blockchain-node -n 50 --no-pager"
|
|
```
|
|
|
|
## Important Notes
|
|
- **Never SSH to localhost**: Commands should run directly on the local machine
|
|
- **Use proper quoting**: When passing commands to SSH, use single quotes to prevent shell expansion
|
|
- **Test connectivity**: Verify RPC endpoints are accessible before running sync operations
|
|
|
|
## Common Operations
|
|
|
|
### Check service status on aitbc1
|
|
```bash
|
|
ssh aitbc1 "systemctl status aitbc-blockchain-node --no-pager"
|
|
```
|
|
|
|
### Restart service on gitea-runner (aitbc2)
|
|
```bash
|
|
ssh gitea-runner "systemctl restart aitbc-blockchain-node"
|
|
```
|
|
|
|
### Copy file to aitbc1
|
|
```bash
|
|
scp /path/to/file aitbc1:/path/to/destination
|
|
```
|
|
|
|
### Execute script on gitea-runner
|
|
```bash
|
|
ssh gitea-runner "bash /path/to/script.sh"
|
|
```
|
|
|
|
## Multi-Node Operations
|
|
|
|
### Run command on all remote nodes
|
|
```bash
|
|
for node in aitbc1 gitea-runner ns3; do
|
|
ssh "$node" "systemctl status aitbc-blockchain-node --no-pager"
|
|
done
|
|
```
|
|
|
|
### Check block heights across all nodes
|
|
```bash
|
|
for node in aitbc1 gitea-runner; do
|
|
echo "=== $node ==="
|
|
ssh "$node" "curl -s http://localhost:8006/rpc/bestBlock | jq '.height'"
|
|
done
|
|
|
|
# Check ns3 (public hub) separately as it may have different RPC port
|
|
echo "=== ns3 ==="
|
|
ssh ns3 "curl -s http://localhost:8006/rpc/bestBlock | jq '.height'"
|
|
```
|