Categorygithub.com/filecoin-project/dealbot
repositorypackage
0.0.54
Repository: https://github.com/filecoin-project/dealbot.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# README

Dealbot

A tool to test and analyze storage and retrieval deal capability on the Filecoin network.

Getting Started

Clone the repo and build:

git clone [email protected]:filecoin-project/dealbot.git
cd dealbot
go build

Dealbot requires a local synced instance of Lotus to communicate with miners and the chain. This can be a Devnet instance for testing or a node connected to a larger network. The node needs to have wallet address with funds for making deals and a data cap for making verified deals (if verified deals are necessary).

Usage

Dealbot runs on multiple machines with a centralized controller. The controller can be started with:

./dealbot controller --configpath config.toml

See dealbot-example.toml for configuration parameters. Individual Dealbot nodes run with the daemon command:

./dealbot --api [LOTUS_API_URL] daemon --configpath config.toml

The --api parameter points to the Lotus API and can be specified as a URL token pair. Alternatively you can specify --lotus-path either as a parameter or environment variable:

--api [lotus_api_url]:[lotus_api_token]
export FULLNODE_API_INFO=[lotus_api_url]:[lotus_api_token]
--lotus-path ~/.lotus
export LOTUS_PATH=~/.lotus

Dealbot can also run individual storage or retrieval task when invoked from the command-line with:

./dealbot --api [api] storage-deal --data-dir [shared-dir] --miner [miner-address] --size 2GB

or

./dealbot --api [api] retrieval-deal --data-dir [shared-dir] --miner [miner-address] --cid [payload-cid]

To start Lotus locally, or tunnel to a remote Lotus, see devnet/README.md.

Flags

Dealbot Controller

FlagEnv VarFunction
listenDEALBOT_LISTENexposed host:port for daemons to contact and for tasking the system
graphqlDEALBOT_GRAPHQL_LISTENexposed host:port for external public graphql queries
metricsDEALBOT_METRICSeither prometheus to expose a /metrics api, or log to write metrics to stdout
identityDEALBOT_IDENTITY_KEYPAIRfilepath of a libp2p identity to sign public records of dealbot activity
driverDEALBOT_PERSISTENCE_DRIVERpostgres
dblocDEALBOT_PERSISTENCE_CONNdb conn string from postgres
gqlAccessTokenDEALBOT_GRAPHQL_ACCESS_TOKENa static key for querying non-public data from the graphql server
devAssetDir-serve controller assets from disk rather the compiled binary for development
basicauthDEALBOT_BASICAUTHbasic authentication credentials if the controller is being served behind them to make xhrs work in that environment
datapointlogDEALBOT_DATAPOINT_LOGfile / stream to write out a json line for each completed task
gateway-apiDEALBOT_LOTUS_GATEWAYaddress of lotus gateway to query for wallet balances for controller UX

Dealbot Daemon

FlagEnv VarFunction
idDEALBOT_IDThe worker name to report to the controller
listenDEALBOT_LISTENa host:port to bind to when metrics are exposed
stage-timeoutSTAGE_TIMEOUTa list of stagenames and timeouts (example: DealAccepted=15m)
tagsDEALBOT_TAGStags to use when accepting tasks
workersDEALBOT_WORKERShow many tasks to accept at a time
minfilDEALBOT_MIN_FILminimum balance lotus must report before the bot will accept tasks
mincapDEALBOT_MIN_CAPminimum dealcap lotus must report before the bot will accept tasks
posthookDEALBOT_POST_HOOKa bash script that will be run as bash $posthook $uuid when a task finishes
endpointDEALBOT_CONTROLLER_ENDPOINTthe host:port of the controller to ask for tasks
data-dirDEALBOT_DATA_DIRECTORYthe directory for the bot to make cars in or verify they have shown up in
node-data-dirDEALBOT_NODE_DATA_DIRECTORYthe directory for lotus to import the cars from or write them to
walletDEALBOT_WALLET_ADDRESSan explicit wallet to use with lotus if not the default one

Versioning and Releases

Tagged releases indicate versions run on our local deployment. Semver is used to indicate when data would be lost on downgrading (miner version bumps) and when data becomes incompatible (major version bumps)

Code of Conduct

Dealbot follows the Filecoin Project Code of Conduct. Before contributing, please acquaint yourself with our social courtesies and expectations.

Contributing

We welcome new issues and pull requests.

License

The Filecoin Project and Dealbot is dual-licensed under Apache 2.0 and MIT terms: