Documentation
¶
Index ¶
Constants ¶
View Source
const ( ProveStatusInit = iota ProveStatusInProgress ProveStatusSuccess ProveStatusFailed )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProveRequest ¶ added in v0.3.25
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService( app sdk.AppCircuit, config ServiceConfig, srcChainConfigs SourceChainConfigs) (*Service, error)
NewService creates a new prover server instance that automatically manages compilation & setup, and serves as a GRPC server that interoperates with brevis sdk in other languages.
type ServiceConfig ¶
type ServiceConfig struct {
// ProverId is a unique identifier for this prover, defaults to hostname
ProverId string `mapstructure:"prover_id" json:"prover_id"`
// SetupDir saves the circuit compilation outputs (proving key, verifying key,
// verifying key hash)
SetupDir string `mapstructure:"setup_dir" json:"setup_dir"`
// SrsDir saves the SRS files that will be automatically downloaded. These files
// can be shared across different circuits. So the best practice is to have them
// in a shared directory for all projects. Default to use the same dir as
// SetupDir if not specified
SrsDir string `mapstructure:"srs_dir" json:"srs_dir"`
// GatewayUrl is the Brevis gateway URL, defaults to appsdkv3.brevis.network:443
GatewayUrl string `mapstructure:"gateway_url" json:"gateway_url"`
// DirectLoad indicates whether the setup process will parallel compile ccs and load pk vk, without digest check
DirectLoad bool `mapstructure:"direct_load" json:"direct_load"`
// ProofPersistenceType currently supporting "syncmap", "file", "badgerdb" and "s3".
// Defaults to "syncmap".
ProofPersistenceType string `mapstructure:"proof_persistence_type" json:"proof_persistence_type"`
// ProofPersistenceOptions as JSON string. See implementations for details.
ProofPersistenceOptions string `mapstructure:"proof_persistence_options" json:"proof_persistence_options"`
// PersistenceType currently supporting "syncmap", "file", "badgerdb" and "s3".
// Defaults to "file" under {setupDir}/input.
DataPersistenceType string `mapstructure:"data_persistence_type" json:"data_persistence_type"`
// DataPersistenceOptions as JSON string. See implementations for details.
DataPersistenceOptions string `mapstructure:"data_persistence_options" json:"data_persistence_options"`
// ConcurrentFetchLimit limits the number of concurrent on-chain fetches, defaults to 20
ConcurrentFetchLimit int `mapstructure:"concurrent_fetch_limit" json:"concurrent_fetch_limit"`
// ConcurrentProveLimit limits the number of concurrent prove actions, defaults to 1
ConcurrentProveLimit int `mapstructure:"concurrent_prove_limit" json:"concurrent_prove_limit"`
}
func (ServiceConfig) GetSetupDir ¶
func (c ServiceConfig) GetSetupDir() string
func (ServiceConfig) GetSrsDir ¶
func (c ServiceConfig) GetSrsDir() string
type SourceChainConfig ¶ added in v0.3.25
type SourceChainConfigs ¶ added in v0.3.25
type SourceChainConfigs []*SourceChainConfig
Click to show internal directories.
Click to hide internal directories.