The Masa Oracle provides infrastructure for accessing, sharing, and rewarding providers of behavioral, personal, and identity data in a decentralized and private way. The Masa Oracle guarantees transparency, security, and equitable compensation for nodes participating in the Masa zk-Data Network & Marketplace.
- Getting Started 🌟
- Staking Tokens 🔐
- Running the Node 🚀
- Command-Line Interface (CLI) 💻
- Configuration 🔧
- Connecting Nodes 🔗
- Deploying a Node using Fly.io 🛫
- Requirements for Running Masa-Node on Fly.io 📋
Before diving in, ensure these prerequisites are installed:
- Go: Grab it from Go's official site 📥.
- Docker: Install from Docker's official docs 🐳.
-
Clone the repository:
git clone https://github.com/masa-finance/masa-oracle-go-testnet.git cd masa-oracle-go-testnet
- Build the node executable:
go build -v -o masa-node ./cmd/masa-node
To participate in the network and earn rewards, you must first stake your tokens:
-
Obtain Sepolia ETH and Masa tokens for your node's Ethereum address. The address's private key is created when you run the node for the first time using
./masa-node --start
and is saved locally:cat /Users/{USER}/.masa/masa_oracle_key.ecdsa
-
Import the private key into Metamask to access your Ethereum address.
-
Send Sepolia ETH and Masa testnet tokens to your address. Then you can stake!:
./masa-node --stake 100
Start your node and join the Masa network with default configurations:
./masa-node --start
Customize your node's behavior with various flags:
./masa-node --bootnodes=node1,node2,node3 --port=8080 --udp=true --tcp=false --start=true
To use a custom configuration file:
./masa-node --config=path/to/config.json
Connect to a specific node in the network:
./masa-node --bootnodes=/ip4/34.133.16.77/udp/4001/quic-v1/p2p/16Uiu2HAmAEDCYv5RrbLhZRmHXGWXNuSFa7YDoC5BGeN3NtDmiZEb --port=4001 --udp=true --tcp=false --start=true
Deploy a node using Fly.io by setting up your environment and configuring your deployment settings:
- Generate a key and stake tokens by running the node locally with
./masa-node --start
and./masa-node --stake 100
👆. - Install
flyctl
, the Fly.io command-line tool, from the official Fly.io documentation. - Sign up for and log into your Fly.io account.
-
Initialize your application with Fly.io using
fly launch
from themasa-oracle-go-testnet
project directory.fly launch
-
Set the
PRIVATE_KEY
environment variable in your Fly.io application using the private key from your local node setup.fly secrets set -a YOUR_APP_NAME PRIVATE_KEY="PRIVATE_KEY"
Deploy your application using fly deploy
:
fly deploy
Check the status of your deployment with fly status
:
fly status -a YOUR_APP_NAME
To run the masa-node
on Fly.io's free plan, your server should meet the following specifications:
- Operating System: Linux-based OS (Ubuntu 20.04 recommended)
- Processor: 4 x Shared CPU
- Memory: 1GB RAM
- Storage: 20GB SSD
- Network: Shared network resources
Please note that these are the specifications provided by Fly.io's free plan. For better performance, especially for production environments, a more powerful server may be necessary.
Before running the masa-node
, make sure to install the necessary dependencies as outlined in the Installation section.
Also, ensure that the necessary ports are open in your server's firewall settings to allow for incoming and outgoing connections.
Please refer to the Fly.io documentation for more details on their server specifications and how to configure your application.
After setting up, your node's address will be displayed, indicating it's ready to connect with other Masa nodes. Follow any additional configuration steps and best practices as per your use case or network