Skip to content

Quick Start

Get up and running with DataMgmt Node in minutes.

Start the Node

After installation, start your node:

cd datamgmtnode
poetry run python datamgmtnode/main.py

You should see:

2024-01-15 10:30:00 - __main__ - INFO - Configuration validated successfully
2024-01-15 10:30:01 - __main__ - INFO - Node started successfully
2024-01-15 10:30:01 - __main__ - INFO -   - Internal API: http://localhost:8080
2024-01-15 10:30:01 - __main__ - INFO -   - External API: http://0.0.0.0:8081
2024-01-15 10:30:01 - __main__ - INFO -   - Dashboard API: http://localhost:8082
2024-01-15 10:30:01 - __main__ - INFO -   - P2P Port: 8000
2024-01-15 10:30:01 - __main__ - INFO - Press Ctrl+C to stop the node

Command-Line Options

# Start without the web dashboard
poetry run python datamgmtnode/main.py --no-dashboard

# Launch the Terminal UI instead
poetry run python datamgmtnode/main.py --tui

Check Node Health

Verify your node is running:

curl http://localhost:8080/health
import requests

response = requests.get("http://localhost:8080/health")
print(response.json())

Response:

{
  "status": "healthy",
  "components": {
    "blockchain": "connected",
    "p2p_network": "running",
    "encryption": "initialized"
  },
  "version": "0.1.0"
}

Share Data

Share encrypted data with another participant:

curl -X POST http://localhost:8081/share_data \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key" \
  -d '{
    "data": "Hello, secure world!",
    "recipient": "0x742d35Cc6634C0532925a3b844Bc9e7595f1dE01"
  }'
import requests

response = requests.post(
    "http://localhost:8081/share_data",
    headers={
        "Content-Type": "application/json",
        "X-API-Key": "your-api-key"
    },
    json={
        "data": "Hello, secure world!",
        "recipient": "0x742d35Cc6634C0532925a3b844Bc9e7595f1dE01"
    }
)
print(response.json())

Response:

{
  "success": true,
  "tx_hash": "0x1234567890abcdef...",
  "recipient": "0x742d35Cc6634C0532925a3b844Bc9e7595f1dE01"
}

Retrieve Data

Retrieve shared data by its hash:

curl http://localhost:8081/data/abc123def456... \
  -H "X-API-Key: your-api-key"
import requests

data_hash = "abc123def456..."
response = requests.get(
    f"http://localhost:8081/data/{data_hash}",
    headers={"X-API-Key": "your-api-key"}
)
print(response.json())

Share Data with Payment

Include payment when sharing data:

curl -X POST http://localhost:8081/share_data \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key" \
  -d '{
    "data": "Premium data content",
    "recipient": "0x742d35Cc6634C0532925a3b844Bc9e7595f1dE01",
    "payment_token": "0x6B175474E89094C44Da98b954EescdeCB5F1c2d3",
    "payment_amount": 1000000000000000000
  }'

View Network Statistics

Check your P2P network status:

curl http://localhost:8081/network/stats

Response:

{
  "total_peers": 5,
  "healthy_peers": 4,
  "data_sent": 1024000,
  "data_received": 512000,
  "uptime": 3600
}

Stop the Node

Press Ctrl+C to gracefully stop the node:

2024-01-15 11:30:00 - __main__ - INFO - Received signal SIGINT
2024-01-15 11:30:00 - __main__ - INFO - Shutting down node...
2024-01-15 11:30:01 - __main__ - INFO - Node stopped gracefully.

Access the Dashboard

Once your node is running, you can monitor it through:

Open http://localhost:8082 in your browser.

Note

The web dashboard must be built first. See Installation.

Start the TUI in a separate terminal:

poetry run python -m datamgmtnode.tui

Use keyboard shortcuts to navigate: m (main), h (health), t (tokens), n (network), q (quit).

Next Steps