Setup an Actor
This instruction explain how to be an actor Fair Math Computer. More details about actors can be found here.
Follow provided steps to run your own actor for FHE Computer.
Prerequisites
Get the actor execution file: Mac OS darwin-amd64 Mac OS darwin-arm64 Linux amd64 Linux arm64
Install fairmath certificate to
/etc/ssl/certs
Setup
Create an account in the Fairmath Testnet
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"
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
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 valueValidate your token’s amount:
$ ./fairmathd-linux-amd64 q bank balances <your address> --chain-id fairmath-tn1
Register actor
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 stringaccount name or address
- account name from step 2.bif 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.bquery-grpc-address
- grpc address of validator, should betestnet.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
andbackup-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
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/[email protected]/baseapp/baseapp.go:1023] with gas used: '36614': unknown request"}
Last updated