2PM.Network
WebsiteXDiscordLinkedinGithub
  • Overview
    • What is 2PM.Network
    • Architecture
    • FAQ
    • Official Social Channels
  • 2PM Data VSIES Service
    • What is Data VSIES and why is it important
    • [V] Data Validation (ZK)
    • [SI] Data Standardization and Index
    • [E] Data Encryption Client (FHE)
    • [S] Data Storage and Access
    • Data VSIES SDK
  • Node Framework
    • Modular Architecture
    • Federated Learning
      • Horizontal Federated Learning Task
      • Logistic Regression Task
      • On-chain Secure Aggregation
      • Typical Scenarios
    • FHE Machine Learning
      • Built-in Models
      • Deep Learning
      • Typical Scenarios
    • Task Submission
    • Running a 2PM Node
      • Installation
      • Chain Connector Configuration
      • Data Preparation
      • Joining a Subnet
  • Security and Verification
    • Node Staking and Slash Mechanism
    • Running Verification Client
      • EigenLayer
      • Mind Network
    • Restaking and Delegation
  • Model Inference
    • 2PM Node Inference API
    • Posting Request to a Subnet Model
    • Getting Inference Results on Chain
      • Oracle Adapters
  • Monetization and Incentives
    • AI Model IP Assets
    • Distribution Algorithm
  • 2PM DAO
    • Build Subnets
      • Establishing New Subnets
      • General Requirements
      • Data Schema Definition
      • Model Selection
      • Task Implementation
    • $DMP Token
  • Deployed Smart Contracts
    • Subnets on Testnets
    • Local Deployment Guideline
  • Ecosystem
    • Partners
    • Use Cases
      • Private Personalized Recommendation
Powered by GitBook
On this page
  • Downloading the Image
  • Initializing Configuration
  • Modifying Configuration Files
  • Launching the Node Service
  1. Node Framework
  2. Running a 2PM Node

Installation

The Node Framework is currently undergoing testing and will be released soon.

Starting a 2PM Node Using Docker Image We recommend deploying using the 2PM Node Docker image for optimal performance and ease.

Downloading the Image

Pull the latest release version of the image from Docker Hub:

$ docker pull 2pmmpc/2pm-node:latest

Initializing Configuration

The 2PM-node node stores data including configuration files, saved user data, and system operation logs. Before launching the node service, it is necessary to initialize the configuration:

First, create a new directory named 2pm_node which will serve as the root directory for the node launch:

$ mkdir 2pm_node

Within the node root directory, enter the command:

$ cd 2pm_node
$ docker run -it --rm -v ${PWD}:/app 2pmmpc/2pm-node:latest init

After running the command, new directories such as config, task, and data will be created within the root directory 2pm_node. The config folder stores the node's configuration files, the task folder holds intermediate results of node tasks, and data stores the data provided by the node.

Modifying Configuration Files

In the config folder, there will be a pre-generated configuration file config.yaml. Before the first launch, it is essential to modify certain entries. One of the necessary changes is the address of the Chain Connector, which should be updated to the IP address configured in the previous section. Another is the 2PM Node's own IP address, which is needed for identity registration on the blockchain, allowing other nodes to communicate with this node. Find the public IP address of this node and enter it into the configuration file:

# Blockchain node connection configuration
chain_connector:
  # Address of the blockchain connector
  host: "127.0.0.1"
  # Port of the blockchain connector
  port: 4500  

# This node's public address, which will be published to the blockchain for other 2PM Node connections
node:
  # Name of this node
  name: "2pm_node_1"
  # Public address of this node
  url: "127.0.0.1:6700"

# Zero-knowledge proof service connection configuration
zk:
  # Zero-knowledge proof service address
  host: ""
  # Zero-knowledge proof service port
  port: 3400

# Listening address for this node's HTTP service, used for 2PM Task registration
api_port: 6700

After completing the configuration, you are now ready to launch the 2PM Node.

Launching the Node Service

Use the Docker command line to create and start the node container, binding the folder created in the previous step to the container's internal /app folder. Additionally, the 2PM Node needs to expose port 6700 for external APIs and node-to-node communication:

$ docker run -d --name=2pm_node_1 -v ${PWD}:/app -p 6700:6700 2pmmpc/2pm-node:0.8.3

To monitor the container's execution status and confirm that the node has started successfully, use Docker's logs command:

$ docker logs -f 2pm_node_1

The 2PM Node also outputs logs to the log directory within the local data folder, where you can review the node's operational logs.

With the 2PM Node now up and running, before executing any 2PM computation tasks, ensure to place some required data within the data folder of the 2PM Node, as this data will be needed for the computation tasks:

Alternatively, you can request data for FHE Machine Learning Tasks from 0G Storage Nodes Through Node Data Connector.

PreviousRunning a 2PM NodeNextChain Connector Configuration

Last updated 10 months ago

Data Preparation