Put lua script to /etc/swiftcmd/run.lua to start your own miner
you must use print() or printf() to print your script
eg : start aleo prover :
if param.Options.Type == Prover_CPU
then printf("/mnt/lotus/aleo/aleo-prover -a %s -p %s",param.Wallet,param.Pools[1])
elseif param.Options.Type == Prover_CPU_Taskset
then printf("taskset -c %s /mnt/lotus/aleo/aleo-prover -a %s -p %s",param.Options.TaskSet,param.Wallet,param.Pools[1])
elseif param.Options.Type == Prover_GPU
then printf("/mnt/lotus/aleo/aleo-prover -g %s -j %d -t 2 -a %s -p %s",param.Options.GSet,param.Options.JSet,param.Wallet,param.Pools[1])
elseif param.Options.Type == Prover_GPU_Taskset
then printf("taskset -c %s /mnt/lotus/aleo/aleo-prover -g %s -j %d -t 2 -a %s -p %s",param.Options.TaskSet,param.Options.GSet,param.Options.JSet,param.Wallet,param.Pools[1])
end
you can use those vairables and funcs blow in your script
type : userdata
golang struct :
type RuntimeParam struct {
HasGpu bool `json:"HasGpu"`
Pools []string `json:"Pools"`
Wallet string `json:"Wallet"`
Pass map[string]string `json:"Pass"`
Options models.ProverOption `json:"Options"`
}
type ProverOption struct {
Type int32 `json:"Type,omitempty"`
TaskSet string `json:"TaskSet,omitempty"`
JSet int `json:"JSet,omitempty"`
GSet string `json:"GSet,omitempty"`
Enable bool `json:"Enable,omitempty"`
Test bool `json:"Test,omitempty"`
CLevel int `json:"CLevel,omitempty"`
Fft int `json:"Fft,omitempty"`
Scalars int `json:"Scalars,omitempty"`
}
lua preload script
printf = function(s,...)
return print(s:format(...))
end -- function
-- cpu,不绑core
Prover_CPU = 0
-- cpu,绑core
Prover_CPU_Taskset = 2
-- gpu,不绑core
Prover_GPU = 1
-- gpu,绑core
Prover_GPU_Taskset = 3
Content type
Image
Digest
sha256:174fb69a4…
Size
38 MB
Last updated
about 4 years ago
docker pull storswift/swift-cmd