LogoLogo
  • Overview
    • Intro
    • Fair Math Actor
      • Fair Math Controller
      • Fair Math VM
      • Setup an Actor
    • Hello (CIFAR) world!
  • FHE Computer
    • Overview
    • Architectural Layers
      • Application Layer
      • Orchestration Layer
      • Verification Layer
      • Execution Layer
      • Data Layer
    • ISA
      • fhe
      • arith
      • tensor
      • polycircuit
    • Operating System
      • Computer State
      • Application
        • Running Applications
        • External Functions
        • Interactive APPS
      • Execution Graph and Tasks
        • Atomic and Composite Instructions
        • Instruction Unrolling
        • Task Dependencies
        • Execution Graph
      • Process
        • Process lifecycle
        • Resource Allocation and Isolation
      • Order Book
        • Matching Mechanism
        • Task Complexity
        • Instruction Complexity
        • Task re-Delegation
      • Context
        • Context Structure
      • FHE Component Repository
    • Fair Math Actors
      • Task State Monitoring
      • Execution Pairs
      • Rewards and Penalties
    • Ethereum Endpoint
    • CIFAR10 App
  • Whitepapers
    • FHE Computer
    • FHERMA
  • FHERMA
  • Resources
    • Computer CLI
    • FHERMA
    • POLYCIRCUIT (CPP)
    • OpenFHE-rs
    • Talks and Podcasts
  • Social
    • Twitter
    • Linkedin
    • Website
    • Github
Powered by GitBook
LogoLogo
On this page
  • Prerequisites
  • Setup
  1. Overview
  2. Fair Math Actor

Setup an Actor

PreviousFair Math VMNextHello (CIFAR) world!

Last updated 5 months ago

This instruction explain how to be an actor Fair Math Computer. More details about actors can be found .

Follow provided steps to run your own actor for FHE Computer.

Prerequisites

  1. Get the actor execution file:

  2. Install fairmath certificate to /etc/ssl/certs

Setup

  1. Create an account in the Fairmath Testnet

    1. Run init command

      $ ./fairmathd-linux-amd64 init <username> --chain-id fairmath-tn1

      Update the .fairmath/config/client.toml file with the following fields:

      node = "https://testnet.computer.fairmath.xyz"
      chain-id = "fairmath-tn1"
      keyring-backend = "test"
    2. Create a Fairmath Net account

      $ ./fairmathd-linux-amd64 keys add <accountname> --keyring-backend=test

      Note that keyring backend test will store your private key in the open file, never use this option for mainnet

    3. Ask someone to send several tokens for your, it could be done via command

      $ ./fairmathd-linux-amd64 tx bank send <from address> <to address> 100fmth --from <from account> --chain-id fairmath-tn1 --keyring-backend test 

      You can use --gas-adjustment flag or perform transaction in dry-run mode to estimate needed gas value

      Validate your token’s amount:

      $ ./fairmathd-linux-amd64 q bank balances <your address> --chain-id fairmath-tn1
  2. Register actor

    1. Run a transaction to register your actor:

      $ ./fairmathd-linux-amd64 actor register <actorname> --from=<account name or address> --keyring-backend=test

      actorname - is an actor human readable name, just string

      account name or address - account name from step 2.b

      if everything is ok then you should see the message like this:

      $ ./fairmathd-linux-amd64 actor register testactor --from=testaccount --keyring-backend=test
      2024/11/04 15:29:10 registration is done: actor 'testactor' is registered under ID: <30>

      Also an actor config file template will be created in the ~/.faitmath. Config file name contains actor name and ID, so in the example below it should be ~/.fairmath/testactor-30.yaml with the following content:

      actor-id: 30
      tx:
          owner: ""
          gas-adjustment: 1.5
      query:
          query-grpc-address: ""
      orders:
          acquire-interval: 30s
          main-actor-ping: 1m0s
          backup-actor-ping: 1m0s
          min-price: 0fmth
          backup-min-price: 0fmth
      ext-storage:
          ipfs:
              node-url: <http://ipfs/url:8080>
      interpreter:
          path: /path/to/interpreter

      You have to specify some settings to run actor:

      • owner - your account name from step 2.b

      • query-grpc-address - grpc address of validator, should be testnet.computer.fairmath.xyz:9090

      • ipfs.node-url - address for IPFS node, kubo rpc should be available (our IPFS node - 167.235.197.94:5001)

      • min-price and backup-min-price - Set the minimum price for which your actor will perform the job.

      • interpreter - path to FHE virtual machine

      Also you should add a custom code component which is 18446744073709551615

      Example of the config:

      actor-id: 1
      tx:
          owner: "testaccount"
          gas-adjustment: 1.5
      query:
        query-grpc-address: "testnet.computer.fairmath.xyz:9090"
      orders:
          acquire-interval: 30s
          main-actor-ping: 1m0s
          backup-actor-ping: 1m0s
          min-price: 0fmth
          backup-min-price: 0fmth
      ext-storage:
          ipfs:
            node-url: 167.235.197.94:5001
      interpreter:
          path: /home/path/to/vm
      
  3. Your are ready to run your own actor, please run the command

    $ ./fairmathd-linux-amd64 actor run <actor config name> --keyring-backend=test 

    Note that you should NOT specify the full path to the actor config, just place the config file name, e.g. testactor-30.yaml. If you see logs then everything is ok:

    {"level":"warn","time":"2024-11-04T16:00:40+03:00","message":"heavy objects cache could not find the state file(cache will be reset): read cache state: open /home/gsm/yasha/dcomp/fairnet/bin/.actor/fhevm-store/actor-30/h-cache.json: no such file or directory"}
    {"level":"warn","time":"2024-11-04T16:00:50+03:00","message":"failed to acquire order send tx calculate gas: simulate tx: rpc error: code = Unknown desc = rpc error: code = Unknown desc = failed to execute message; message index: 0: acquire order tx: no available orders [cosmos/cosmos-sdk@v0.50.10/baseapp/baseapp.go:1023] with gas used: '36614': unknown request"}
Page cover image
here
Mac OS darwin-amd64
Mac OS darwin-arm64
Linux amd64
Linux arm64
2KB
fairmath.crt