synapse

package
v1.10.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2020 License: GPL-3.0, GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DATA_PATH   string = "/data"
	SYMBOL_PATH string = "/data/symbol"
	PARAM_PATH  string = "/data/params"
)
View Source
const (
	PLUGIN_PATH         string = "plugins/"
	PLUGIN_POST_FIX     string = "libcvm_runtime.so"
	MinMemoryUsage      int64  = 2 * 1024 * 1024 * 1024
	ReservedMemoryUsage int64  = 512 * 1024 * 1024
)

Variables

View Source
var (
	KERNEL_RUNTIME_ERROR = errors.New("cvm kernel runtime error")
	KERNEL_LOGIC_ERROR   = errors.New("cvm kernel logic error")
)
View Source
var CvmDolFixTorrHashes = map[string]string{

	"31f75c90e8fe1c5b16cbdc466dc6127487a92add": "c816d85a023abacb687080ca57f580d4999b8b1d",
}
View Source
var CvmFixHashes = map[string][]byte{
	"0x53f8e0b0c93dedff2706e28643804470d67d79a9f1447b75dab09304ed8d1fe0": []byte{19, 52, 238, 252, 208, 237, 223, 227, 243, 91},
	"0xe0c42bc0779d627e14fba7c4e6f355644aa2535dfe9786d64684fb05f1de615c": []byte{6, 252, 4, 59, 242, 0, 247, 30, 224, 217},
}

Functions

func CVMVersion added in v1.10.7

func CVMVersion(config *params.ChainConfig, num *big.Int) int

func RLPHashString added in v1.0.0

func RLPHashString(x interface{}) string

func ReadData added in v1.0.0

func ReadData(r *inference.NpyReader) ([]byte, error)

Types

type Config

type Config struct {
	// StorageDir    string `toml:",omitempty"`
	IsNotCache     bool   `toml:",omitempty"`
	DeviceType     string `toml:",omitempty"`
	DeviceId       int    `toml:",omitempty"`
	IsRemoteInfer  bool   `toml:",omitempty"`
	InferURI       string `toml:",omitempty"`
	Debug          bool   `toml:",omitempty"`
	MaxMemoryUsage int64
	Storagefs      torrentfs.CortexStorage
}
var (
	DefaultConfig Config = Config{

		IsNotCache:     false,
		DeviceType:     "cpu",
		DeviceId:       0,
		IsRemoteInfer:  false,
		InferURI:       "",
		Debug:          false,
		MaxMemoryUsage: 4 * 1024 * 1024 * 1024,
	}
)

type Synapse

type Synapse struct {
	// contains filtered or unexported fields
}

func Engine

func Engine() *Synapse

func New

func New(config *Config) *Synapse

func (*Synapse) Available added in v1.9.51

func (s *Synapse) Available(entry common.StorageEntry, cvmNetworkID int64) error

func (*Synapse) Close

func (s *Synapse) Close()

func (*Synapse) Download added in v1.10.7

func (s *Synapse) Download(info common.StorageEntry) error

Download is used to control the torrentfs, not for remote invoked now

func (*Synapse) GetGasByInfoHashWithSize added in v1.10.8

func (s *Synapse) GetGasByInfoHashWithSize(model common.StorageEntry, cvmNetworkID int64) (gas uint64, err error)

func (*Synapse) InferByInfoHashWithSize added in v1.10.8

func (s *Synapse) InferByInfoHashWithSize(model, input common.StorageEntry, cvmVersion int, cvmNetworkID int64) ([]byte, error)

func (*Synapse) InferByInputContentWithSize added in v1.10.8

func (s *Synapse) InferByInputContentWithSize(model common.StorageEntry, inputContent []byte, cvmVersion int, cvmNetworkID int64) ([]byte, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL