Skip to content

Commit 6d494de

Browse files
author
eddie
committed
support for pool
1 parent 83f02d5 commit 6d494de

File tree

5 files changed

+22
-13
lines changed

5 files changed

+22
-13
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ eg. plotng-client -hosts plotter1:8484,plotter2,plotter3:8485
5050
"Fingerprint": "",
5151
"FarmerPublicKey": "",
5252
"PoolPublicKey": "",
53+
"ContractAddress": "",
5354
"Threads": 0,
5455
"Buffers": 0,
5556
"DisableBitField": false,
@@ -78,7 +79,8 @@ Please note for Windows, please use capital drive letter and '/' eg. "D:/temp"
7879

7980
- Fingerprint : fingerprint passed to the chia command line tool (you can either use the fingerprint if the private has been installed on the plotter or use the following farmer/pool public key instead)
8081
- FarmerPublicKey : Farmer Public Key passed to the chia command line tool
81-
- PoolPublicKey : Pool Public Key passed to the chia command line tool
82+
- PoolPublicKey : Pool Public Key passed to the chia command line tool
83+
- ContractAddress: Pool NFT Contract Address for Portable Plot
8284
- Threads : number of threads use by the chia command line tool. If the value is zero or missing then chia will use the default
8385
- Buffers : number of buffers use by the chia command line tool. If the value is zero or missing then chia will use the default
8486
- DisableBitField : With BitField your plotting almost always gets faster. Set true if your CPU designed before 2010.

config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"Fingerprint": "",
33
"FarmerPublicKey": "",
44
"PoolPublicKey": "",
5+
"ContractAddress": "",
56
"Threads": 0,
67
"Buffers": 0,
78
"DisableBitField": false,

internal/activePlot.go

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ type ActivePlot struct {
3838
Fingerprint string
3939
FarmerPublicKey string
4040
PoolPublicKey string
41+
ContractAddress string
4142
Threads int
4243
PlotSize int
4344
Buffers int
@@ -209,23 +210,26 @@ func (ap *ActivePlot) createCmd(config *Config) (cmd string, args []string) {
209210
args = []string{
210211
"plots", "create",
211212
"-n1",
212-
"-t" + ap.PlotDir,
213-
"-d" + ap.TargetDir,
213+
"-t", ap.PlotDir,
214+
"-d", ap.TargetDir,
214215
}
215216
if len(ap.Fingerprint) > 0 {
216-
args = append(args, "-a"+ap.Fingerprint)
217+
args = append(args, "-a", ap.Fingerprint)
217218
}
218219
if len(ap.FarmerPublicKey) > 0 {
219-
args = append(args, "-f"+ap.FarmerPublicKey)
220+
args = append(args, "-f", ap.FarmerPublicKey)
220221
}
221222
if len(ap.PoolPublicKey) > 0 {
222-
args = append(args, "-p"+ap.PoolPublicKey)
223+
args = append(args, "-p", ap.PoolPublicKey)
224+
}
225+
if len(ap.ContractAddress) > 0 {
226+
args = append(args, "-c", ap.PoolPublicKey)
223227
}
224228
if ap.Threads > 0 {
225-
args = append(args, fmt.Sprintf("-r%d", ap.Threads))
229+
args = append(args, "-r", fmt.Sprintf("%d", ap.Threads))
226230
}
227231
if ap.PlotSize > 0 {
228-
args = append(args, fmt.Sprintf("-k%d", ap.PlotSize))
232+
args = append(args, "-k", fmt.Sprintf("%d", ap.PlotSize))
229233
if ap.PlotSize < 32 {
230234
args = append(args, "--override-k")
231235
}
@@ -234,20 +238,20 @@ func (ap *ActivePlot) createCmd(config *Config) (cmd string, args []string) {
234238
}
235239

236240
if ap.Buffers > 0 {
237-
args = append(args, fmt.Sprintf("-b%d", ap.Buffers))
241+
args = append(args, "-b", fmt.Sprintf("%d", ap.Buffers))
238242
} else {
239243
switch ap.PlotSize {
240244
case 32:
241-
args = append(args, fmt.Sprintf("-b%d", 3390))
245+
args = append(args, "-b", fmt.Sprintf("%d", 3390))
242246
break
243247
case 33:
244-
args = append(args, fmt.Sprintf("-b%d", 7400))
248+
args = append(args, "-b", fmt.Sprintf("%d", 7400))
245249
break
246250
case 34:
247-
args = append(args, fmt.Sprintf("-b%d", 14800))
251+
args = append(args, "-b", fmt.Sprintf("%d", 14800))
248252
break
249253
case 35:
250-
args = append(args, fmt.Sprintf("-b%d", 29600))
254+
args = append(args, "-b", fmt.Sprintf("%d", 29600))
251255
break
252256
default:
253257
break

internal/plotConfig.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ type Config struct {
1515
Fingerprint string
1616
FarmerPublicKey string
1717
PoolPublicKey string
18+
ContractAddress string
1819
Threads int
1920
PlotSize int
2021
Buffers int

internal/server.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ func (server *Server) createNewPlot(config *Config, targetDir string, plotDir st
139139
Fingerprint: config.Fingerprint,
140140
FarmerPublicKey: config.FarmerPublicKey,
141141
PoolPublicKey: config.PoolPublicKey,
142+
ContractAddress: config.ContractAddress,
142143
Threads: config.Threads,
143144
Buffers: config.Buffers,
144145
PlotSize: config.PlotSize,

0 commit comments

Comments
 (0)