本文整理匯總了Golang中github.com/NebulousLabs/Sia/modules/wallet.New函數的典型用法代碼示例。如果您正苦於以下問題:Golang New函數的具體用法?Golang New怎麽用?Golang New使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了New函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: createTpoolTester
// createTpoolTester returns a ready-to-use tpool tester, with all modules
// initialized.
func createTpoolTester(name string) (*tpoolTester, error) {
// Initialize the modules.
testdir := build.TempDir(modules.TransactionPoolDir, name)
g, err := gateway.New("localhost:0", false, filepath.Join(testdir, modules.GatewayDir))
if err != nil {
return nil, err
}
cs, err := consensus.New(g, false, filepath.Join(testdir, modules.ConsensusDir))
if err != nil {
return nil, err
}
tp, err := New(cs, g, filepath.Join(testdir, modules.TransactionPoolDir))
if err != nil {
return nil, err
}
w, err := wallet.New(cs, tp, filepath.Join(testdir, modules.WalletDir))
if err != nil {
return nil, err
}
var key crypto.TwofishKey
_, err = rand.Read(key[:])
if err != nil {
return nil, err
}
_, err = w.Encrypt(key)
if err != nil {
return nil, err
}
err = w.Unlock(key)
if err != nil {
return nil, err
}
m, err := miner.New(cs, tp, w, filepath.Join(testdir, modules.MinerDir))
if err != nil {
return nil, err
}
// Assemble all of the objects into a tpoolTester
tpt := &tpoolTester{
cs: cs,
gateway: g,
tpool: tp,
miner: m,
wallet: w,
walletKey: key,
persistDir: testdir,
}
// Mine blocks until there is money in the wallet.
for i := types.BlockHeight(0); i <= types.MaturityDelay; i++ {
b, _ := tpt.miner.FindBlock()
err = tpt.cs.AcceptBlock(b)
if err != nil {
return nil, err
}
}
return tpt, nil
}
示例2: createConsensusSetTester
// createConsensusSetTester creates a consensusSetTester that's ready for use.
func createConsensusSetTester(name string) (*consensusSetTester, error) {
testdir := build.TempDir(modules.ConsensusDir, name)
// Create modules.
g, err := gateway.New(":0", filepath.Join(testdir, modules.GatewayDir))
if err != nil {
return nil, err
}
cs, err := New(g, filepath.Join(testdir, modules.ConsensusDir))
if err != nil {
return nil, err
}
tp, err := transactionpool.New(cs, g)
if err != nil {
return nil, err
}
w, err := wallet.New(cs, tp, filepath.Join(testdir, modules.WalletDir))
if err != nil {
return nil, err
}
key, err := crypto.GenerateTwofishKey()
if err != nil {
return nil, err
}
_, err = w.Encrypt(key)
if err != nil {
return nil, err
}
err = w.Unlock(key)
if err != nil {
return nil, err
}
m, err := miner.New(cs, tp, w, filepath.Join(testdir, modules.MinerDir))
if err != nil {
return nil, err
}
// Assemble all objects into a consensusSetTester.
cst := &consensusSetTester{
gateway: g,
miner: m,
tpool: tp,
wallet: w,
walletKey: key,
cs: cs,
persistDir: testdir,
}
// Mine until the wallet has money.
for i := types.BlockHeight(0); i <= types.MaturityDelay; i++ {
b, _ := cst.miner.FindBlock()
err = cst.cs.AcceptBlock(b)
if err != nil {
return nil, err
}
}
return cst, nil
}
示例3: createMinerTester
// createMinerTester creates a minerTester that's ready for use.
func createMinerTester(name string) (*minerTester, error) {
testdir := build.TempDir(modules.MinerDir, name)
// Create the modules.
g, err := gateway.New(":0", filepath.Join(testdir, modules.GatewayDir))
if err != nil {
return nil, err
}
cs, err := consensus.New(g, filepath.Join(testdir, modules.ConsensusDir))
if err != nil {
return nil, err
}
tp, err := transactionpool.New(cs, g)
if err != nil {
return nil, err
}
w, err := wallet.New(cs, tp, filepath.Join(testdir, modules.WalletDir))
if err != nil {
return nil, err
}
var key crypto.TwofishKey
_, err = rand.Read(key[:])
if err != nil {
return nil, err
}
_, err = w.Encrypt(key)
if err != nil {
return nil, err
}
err = w.Unlock(key)
if err != nil {
return nil, err
}
m, err := New(cs, tp, w, filepath.Join(testdir, modules.MinerDir))
if err != nil {
return nil, err
}
// Assemble the minerTester.
mt := &minerTester{
gateway: g,
cs: cs,
tpool: tp,
wallet: w,
walletKey: key,
miner: m,
}
// Mine until the wallet has money.
for i := types.BlockHeight(0); i <= types.MaturityDelay; i++ {
b, _ := m.FindBlock()
err = cs.AcceptBlock(b)
if err != nil {
return nil, err
}
}
return mt, nil
}
示例4: newRenterTester
// newRenterTester creates a ready-to-use renter tester with money in the
// wallet.
func newRenterTester(name string) (*renterTester, error) {
// Create the modules.
testdir := build.TempDir("renter", name)
g, err := gateway.New("localhost:0", false, filepath.Join(testdir, modules.GatewayDir))
if err != nil {
return nil, err
}
cs, err := consensus.New(g, false, filepath.Join(testdir, modules.ConsensusDir))
if err != nil {
return nil, err
}
tp, err := transactionpool.New(cs, g, filepath.Join(testdir, modules.TransactionPoolDir))
if err != nil {
return nil, err
}
w, err := wallet.New(cs, tp, filepath.Join(testdir, modules.WalletDir))
if err != nil {
return nil, err
}
key, err := crypto.GenerateTwofishKey()
if err != nil {
return nil, err
}
_, err = w.Encrypt(key)
if err != nil {
return nil, err
}
err = w.Unlock(key)
if err != nil {
return nil, err
}
r, err := New(cs, w, tp, filepath.Join(testdir, modules.RenterDir))
if err != nil {
return nil, err
}
m, err := miner.New(cs, tp, w, filepath.Join(testdir, modules.MinerDir))
if err != nil {
return nil, err
}
// Assemble all pieces into a renter tester.
rt := &renterTester{
cs: cs,
gateway: g,
miner: m,
tpool: tp,
wallet: w,
renter: r,
}
// Mine blocks until there is money in the wallet.
for i := types.BlockHeight(0); i <= types.MaturityDelay; i++ {
_, err := rt.miner.AddBlock()
if err != nil {
return nil, err
}
}
return rt, nil
}
示例5: newHostDBTester
// newHostDBTester creates a ready-to-use hostdb tester with money in the
// wallet.
func newHostDBTester(name string) (*hostdbTester, error) {
// Create the modules.
testdir := build.TempDir("hostdb", name)
g, err := gateway.New(":0", filepath.Join(testdir, modules.GatewayDir))
if err != nil {
return nil, err
}
cs, err := consensus.New(g, filepath.Join(testdir, modules.ConsensusDir))
if err != nil {
return nil, err
}
tp, err := transactionpool.New(cs, g)
if err != nil {
return nil, err
}
w, err := modWallet.New(cs, tp, filepath.Join(testdir, modules.WalletDir))
if err != nil {
return nil, err
}
key, err := crypto.GenerateTwofishKey()
if err != nil {
return nil, err
}
_, err = w.Encrypt(key)
if err != nil {
return nil, err
}
err = w.Unlock(key)
if err != nil {
return nil, err
}
hdb, err := New(cs, w, tp, filepath.Join(testdir, modules.RenterDir))
if err != nil {
return nil, err
}
m, err := miner.New(cs, tp, w, filepath.Join(testdir, modules.MinerDir))
if err != nil {
return nil, err
}
// Assemble all pieces into a hostdb tester.
ht := &hostdbTester{
cs: cs,
gateway: g,
miner: m,
tpool: tp,
wallet: w,
hostdb: hdb,
}
// Mine blocks until there is money in the wallet.
for i := types.BlockHeight(0); i <= types.MaturityDelay; i++ {
_, err := ht.miner.AddBlock()
if err != nil {
return nil, err
}
}
return ht, nil
}
示例6: TestIntegrationWalletBlankEncrypt
// TestIntegrationWalletBlankEncrypt tries to encrypt and unlock the wallet
// through the api using a blank encryption key - meaning that the wallet seed
// returned by the encryption call can be used as the encryption key.
func TestIntegrationWalletBlankEncrypt(t *testing.T) {
if testing.Short() {
t.SkipNow()
}
// Create a server object without encrypting or unlocking the wallet.
testdir := build.TempDir("api", "TestIntegrationWalletBlankEncrypt")
g, err := gateway.New(":0", filepath.Join(testdir, modules.GatewayDir))
if err != nil {
t.Fatal(err)
}
cs, err := consensus.New(g, filepath.Join(testdir, modules.ConsensusDir))
if err != nil {
t.Fatal(err)
}
tp, err := transactionpool.New(cs, g)
if err != nil {
t.Fatal(err)
}
w, err := wallet.New(cs, tp, filepath.Join(testdir, modules.WalletDir))
if err != nil {
t.Fatal(err)
}
srv, err := NewServer(":0", cs, g, nil, nil, nil, nil, tp, w, nil)
if err != nil {
t.Fatal(err)
}
// Assemble the serverTester.
st := &serverTester{
cs: cs,
gateway: g,
tpool: tp,
wallet: w,
server: srv,
}
go func() {
listenErr := srv.Serve()
if listenErr != nil {
panic(listenErr)
}
}()
// Make a call to /wallet/encrypt and get the seed. Provide no encryption
// key so that the encryption key is the seed that gets returned.
var wep WalletEncryptPOST
err = st.postAPI("/wallet/encrypt", url.Values{}, &wep)
if err != nil {
t.Fatal(err)
}
// Use the seed to call /wallet/unlock.
unlockValues := url.Values{}
unlockValues.Set("encryptionpassword", wep.PrimarySeed)
err = st.stdPostAPI("/wallet/unlock", unlockValues)
if err != nil {
t.Fatal(err)
}
// Check that the wallet actually unlocked.
if !w.Unlocked() {
t.Error("wallet is not unlocked")
}
}
示例7: newTestingWallet
// newTestingWallet is a helper function that creates a ready-to-use wallet
// and mines some coins into it.
func newTestingWallet(testdir string, cs modules.ConsensusSet, tp modules.TransactionPool) (modules.Wallet, error) {
w, err := modWallet.New(cs, tp, filepath.Join(testdir, modules.WalletDir))
if err != nil {
return nil, err
}
key, err := crypto.GenerateTwofishKey()
if err != nil {
return nil, err
}
if !w.Encrypted() {
_, err = w.Encrypt(key)
if err != nil {
return nil, err
}
}
err = w.Unlock(key)
if err != nil {
return nil, err
}
// give it some money
m, err := miner.New(cs, tp, w, filepath.Join(testdir, modules.MinerDir))
if err != nil {
return nil, err
}
for i := types.BlockHeight(0); i <= types.MaturityDelay; i++ {
_, err := m.AddBlock()
if err != nil {
return nil, err
}
}
return w, nil
}
示例8: createExplorerTester
// createExplorerTester creates a tester object for the explorer module.
func createExplorerTester(name string) (*explorerTester, error) {
// Create and assemble the dependencies.
testdir := build.TempDir(modules.HostDir, name)
g, err := gateway.New(":0", filepath.Join(testdir, modules.GatewayDir))
if err != nil {
return nil, err
}
cs, err := consensus.New(g, filepath.Join(testdir, modules.ConsensusDir))
if err != nil {
return nil, err
}
tp, err := transactionpool.New(cs, g)
if err != nil {
return nil, err
}
w, err := wallet.New(cs, tp, filepath.Join(testdir, modules.WalletDir))
if err != nil {
return nil, err
}
key, err := crypto.GenerateTwofishKey()
if err != nil {
return nil, err
}
_, err = w.Encrypt(key)
if err != nil {
return nil, err
}
err = w.Unlock(key)
if err != nil {
return nil, err
}
m, err := miner.New(cs, tp, w, filepath.Join(testdir, modules.RenterDir))
if err != nil {
return nil, err
}
e, err := New(cs, filepath.Join(testdir, modules.ExplorerDir))
if err != nil {
return nil, err
}
et := &explorerTester{
cs: cs,
gateway: g,
miner: m,
tpool: tp,
wallet: w,
walletKey: key,
explorer: e,
}
// Mine until the wallet has money.
for i := types.BlockHeight(0); i <= types.MaturityDelay; i++ {
b, _ := et.miner.FindBlock()
err = et.cs.AcceptBlock(b)
if err != nil {
return nil, err
}
}
return et, nil
}
示例9: TestIntegrationWalletGETEncrypted
// TestIntegrationWalletGETEncrypted probes the GET call to /wallet when the
// wallet has never been encrypted.
func TestIntegrationWalletGETEncrypted(t *testing.T) {
if testing.Short() {
t.SkipNow()
}
// Check a wallet that has never been encrypted.
testdir := build.TempDir("api", "TestIntegrationWalletGETEncrypted")
g, err := gateway.New(":0", filepath.Join(testdir, modules.GatewayDir))
if err != nil {
t.Fatal("Failed to create gateway:", err)
}
cs, err := consensus.New(g, filepath.Join(testdir, modules.ConsensusDir))
if err != nil {
t.Fatal("Failed to create consensus set:", err)
}
tp, err := transactionpool.New(cs, g)
if err != nil {
t.Fatal("Failed to create tpool:", err)
}
w, err := wallet.New(cs, tp, filepath.Join(testdir, modules.WalletDir))
if err != nil {
t.Fatal("Failed to create wallet:", err)
}
srv, err := NewServer(":0", "Sia-Agent", cs, nil, g, nil, nil, nil, tp, w)
if err != nil {
t.Fatal(err)
}
// Assemble the serverTester and start listening for api requests.
st := &serverTester{
cs: cs,
gateway: g,
tpool: tp,
wallet: w,
server: srv,
}
go func() {
listenErr := srv.Serve()
if listenErr != nil {
t.Fatal("API server quit:", listenErr)
}
}()
defer st.server.Close()
var wg WalletGET
err = st.getAPI("/wallet", &wg)
if err != nil {
t.Fatal(err)
}
if wg.Encrypted {
t.Error("Wallet has never been unlocked")
}
if wg.Unlocked {
t.Error("Wallet has never been unlocked")
}
}
示例10: createConsensusSetTester
// createConsensusSetTester creates a consensusSetTester that's ready for use.
func createConsensusSetTester(name string) (*consensusSetTester, error) {
testdir := build.TempDir(modules.ConsensusDir, name)
// Create modules.
g, err := gateway.New(":0", filepath.Join(testdir, modules.GatewayDir))
if err != nil {
return nil, err
}
cs, err := New(g, filepath.Join(testdir, modules.ConsensusDir))
if err != nil {
return nil, err
}
tp, err := transactionpool.New(cs, g)
if err != nil {
return nil, err
}
w, err := wallet.New(cs, tp, filepath.Join(testdir, modules.WalletDir))
if err != nil {
return nil, err
}
m, err := miner.New(cs, tp, w, filepath.Join(testdir, modules.MinerDir))
if err != nil {
return nil, err
}
// Assemble all objects into a consensusSetTester.
cst := &consensusSetTester{
gateway: g,
miner: m,
tpool: tp,
wallet: w,
cs: cs,
persistDir: testdir,
csUpdateChan: cs.ConsensusSetNotify(),
minerUpdateChan: m.MinerNotify(),
tpoolUpdateChan: tp.TransactionPoolNotify(),
walletUpdateChan: w.WalletNotify(),
}
cst.csUpdateWait()
// Mine until the wallet has money.
for i := types.BlockHeight(0); i <= types.MaturityDelay; i++ {
b, _ := cst.miner.FindBlock()
err = cst.cs.AcceptBlock(b)
if err != nil {
return nil, err
}
cst.csUpdateWait()
}
return cst, nil
}
示例11: createConsensusSetTester
// createConsensusSetTester creates a consensusSetTester that's ready for use.
func createConsensusSetTester(name string) (*consensusSetTester, error) {
testdir := build.TempDir(modules.ConsensusDir, name)
// Create modules.
g, err := gateway.New(":0", filepath.Join(testdir, modules.GatewayDir))
if err != nil {
return nil, err
}
cs, err := New(g, filepath.Join(testdir, modules.ConsensusDir))
if err != nil {
return nil, err
}
tp, err := transactionpool.New(cs, g)
if err != nil {
return nil, err
}
w, err := wallet.New(cs, tp, filepath.Join(testdir, modules.WalletDir))
if err != nil {
return nil, err
}
key, err := crypto.GenerateTwofishKey()
if err != nil {
return nil, err
}
_, err = w.Encrypt(key)
if err != nil {
return nil, err
}
err = w.Unlock(key)
if err != nil {
return nil, err
}
m, err := miner.New(cs, tp, w, filepath.Join(testdir, modules.MinerDir))
if err != nil {
return nil, err
}
// Assemble all objects into a consensusSetTester.
cst := &consensusSetTester{
gateway: g,
miner: m,
tpool: tp,
wallet: w,
walletKey: key,
cs: cs,
persistDir: testdir,
}
cst.addSiafunds()
cst.mineSiacoins()
return cst, nil
}
示例12: reorgToBlank
// reorgToBlank creates a bunch of empty blocks on top of the genesis block
// that reorgs the explorer to a state of all blank blocks.
func (et *explorerTester) reorgToBlank() error {
// Get a unique directory name to house the persistence of the miner
// dependencies.
dir := et.testdir + " - " + persist.RandomSuffix()
// Create a miner and all dependencies to create an alternate chain.
g, err := gateway.New("localhost:0", false, filepath.Join(dir, modules.GatewayDir))
if err != nil {
return err
}
cs, err := consensus.New(g, false, filepath.Join(dir, modules.ConsensusDir))
if err != nil {
return err
}
tp, err := transactionpool.New(cs, g, filepath.Join(dir, modules.TransactionPoolDir))
if err != nil {
return err
}
w, err := wallet.New(cs, tp, filepath.Join(dir, modules.WalletDir))
if err != nil {
return err
}
key, err := crypto.GenerateTwofishKey()
if err != nil {
return err
}
_, err = w.Encrypt(key)
if err != nil {
return err
}
err = w.Unlock(key)
if err != nil {
return err
}
m, err := miner.New(cs, tp, w, filepath.Join(dir, modules.RenterDir))
if err != nil {
return err
}
// Mine blocks until the height is higher than the existing consensus,
// submitting each block to the explorerTester.
currentHeight := cs.Height()
for i := types.BlockHeight(0); i <= currentHeight+1; i++ {
block, err := m.AddBlock()
if err != nil {
return err
}
et.cs.AcceptBlock(block) // error is not checked, will not always be nil
}
return nil
}
示例13: blankHostTester
// blankHostTester creates a host tester where the modules are created but no
// extra initialization has been done, for example no blocks have been mined
// and the wallet keys have not been created.
func blankHostTester(name string) (*hostTester, error) {
testdir := build.TempDir(modules.HostDir, name)
// Create the modules.
g, err := gateway.New("localhost:0", filepath.Join(testdir, modules.GatewayDir))
if err != nil {
return nil, err
}
cs, err := consensus.New(g, filepath.Join(testdir, modules.ConsensusDir))
if err != nil {
return nil, err
}
tp, err := transactionpool.New(cs, g, filepath.Join(testdir, modules.TransactionPoolDir))
if err != nil {
return nil, err
}
w, err := wallet.New(cs, tp, filepath.Join(testdir, modules.WalletDir))
if err != nil {
return nil, err
}
m, err := miner.New(cs, tp, w, filepath.Join(testdir, modules.MinerDir))
if err != nil {
return nil, err
}
h, err := New(cs, tp, w, "localhost:0", filepath.Join(testdir, modules.HostDir))
if err != nil {
return nil, err
}
/*
r, err := renter.New(cs, w, tp, filepath.Join(testdir, modules.RenterDir))
if err != nil {
return nil, err
}
*/
// Assemble all objects into a hostTester
ht := &hostTester{
cs: cs,
gateway: g,
miner: m,
// renter: r,
tpool: tp,
wallet: w,
host: h,
persistDir: testdir,
}
return ht, nil
}
示例14: createExplorerTester
func createExplorerTester(name string, t *testing.T) *explorerTester {
testdir := build.TempDir(modules.HostDir, name)
// Create the modules
g, err := gateway.New(":0", filepath.Join(testdir, modules.GatewayDir))
if err != nil {
t.Fatal(err)
}
cs, err := consensus.New(g, filepath.Join(testdir, modules.ConsensusDir))
if err != nil {
t.Fatal(err)
}
tp, err := transactionpool.New(cs, g)
if err != nil {
t.Fatal(err)
}
w, err := wallet.New(cs, tp, filepath.Join(testdir, modules.WalletDir))
if err != nil {
t.Fatal(err)
}
m, err := miner.New(cs, tp, w, filepath.Join(testdir, modules.RenterDir))
if err != nil {
t.Fatal(err)
}
be, err := New(cs)
if err != nil {
t.Fatal(err)
}
et := &explorerTester{
cs: cs,
gateway: g,
miner: m,
tpool: tp,
wallet: w,
explorer: be,
csUpdateChan: cs.ConsensusSetNotify(),
beUpdateChan: be.BlockExplorerNotify(),
tpoolUpdateChan: tp.TransactionPoolNotify(),
minerUpdateChan: m.MinerNotify(),
walletUpdateChan: w.WalletNotify(),
t: t,
}
et.csUpdateWait()
return et
}
示例15: startDaemon
// startDaemon uses the config parameters to initialize Sia modules and start
// siad.
func startDaemon(config Config) (err error) {
// Prompt user for API password.
if config.Siad.AuthenticateAPI {
config.APIPassword, err = speakeasy.Ask("Enter API password: ")
if err != nil {
return err
}
if config.APIPassword == "" {
return errors.New("password cannot be blank")
}
}
// Process the config variables after they are parsed by cobra.
config, err = processConfig(config)
if err != nil {
return err
}
// Print a startup message.
fmt.Println("Loading...")
loadStart := time.Now()
// Create the server and start serving daemon routes immediately.
fmt.Printf("(0/%d) Loading siad...\n", len(config.Siad.Modules))
srv, err := NewServer(config.Siad.APIaddr, config.Siad.RequiredUserAgent, config.APIPassword)
if err != nil {
return err
}
servErrs := make(chan error)
go func() {
servErrs <- srv.Serve()
}()
// Initialize the Sia modules
i := 0
var g modules.Gateway
if strings.Contains(config.Siad.Modules, "g") {
i++
fmt.Printf("(%d/%d) Loading gateway...\n", i, len(config.Siad.Modules))
g, err = gateway.New(config.Siad.RPCaddr, !config.Siad.NoBootstrap, filepath.Join(config.Siad.SiaDir, modules.GatewayDir))
if err != nil {
return err
}
defer g.Close()
}
var cs modules.ConsensusSet
if strings.Contains(config.Siad.Modules, "c") {
i++
fmt.Printf("(%d/%d) Loading consensus...\n", i, len(config.Siad.Modules))
cs, err = consensus.New(g, !config.Siad.NoBootstrap, filepath.Join(config.Siad.SiaDir, modules.ConsensusDir))
if err != nil {
return err
}
defer cs.Close()
}
var e modules.Explorer
if strings.Contains(config.Siad.Modules, "e") {
i++
fmt.Printf("(%d/%d) Loading explorer...\n", i, len(config.Siad.Modules))
e, err = explorer.New(cs, filepath.Join(config.Siad.SiaDir, modules.ExplorerDir))
if err != nil {
return err
}
defer e.Close()
}
var tpool modules.TransactionPool
if strings.Contains(config.Siad.Modules, "t") {
i++
fmt.Printf("(%d/%d) Loading transaction pool...\n", i, len(config.Siad.Modules))
tpool, err = transactionpool.New(cs, g, filepath.Join(config.Siad.SiaDir, modules.TransactionPoolDir))
if err != nil {
return err
}
defer tpool.Close()
}
var w modules.Wallet
if strings.Contains(config.Siad.Modules, "w") {
i++
fmt.Printf("(%d/%d) Loading wallet...\n", i, len(config.Siad.Modules))
w, err = wallet.New(cs, tpool, filepath.Join(config.Siad.SiaDir, modules.WalletDir))
if err != nil {
return err
}
defer w.Close()
}
var m modules.Miner
if strings.Contains(config.Siad.Modules, "m") {
i++
fmt.Printf("(%d/%d) Loading miner...\n", i, len(config.Siad.Modules))
m, err = miner.New(cs, tpool, w, filepath.Join(config.Siad.SiaDir, modules.MinerDir))
if err != nil {
return err
}
defer m.Close()
}
var h modules.Host
if strings.Contains(config.Siad.Modules, "h") {
//.........這裏部分代碼省略.........