當前位置: 首頁>>代碼示例>>Golang>>正文


Golang httpjsonrpc.Call函數代碼示例

本文整理匯總了Golang中httpjsonrpc.Call函數的典型用法代碼示例。如果您正苦於以下問題:Golang Call函數的具體用法?Golang Call怎麽用?Golang Call使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了Call函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: GetGenerate

func GetGenerate(id interface{}) (map[string]interface{}, os.Error) {
	//Returns true or false whether bitcoind is currently generating hashes
	resp, err := httpjsonrpc.Call(Address, "getgenerate", id, nil)
	if err != nil {
		log.Println(err)
		return resp, err
	}
	result := resp["result"]
	log.Println(result)

	return resp, err
}
開發者ID:postfix,項目名稱:Go-HTTP-JSON-RPC,代碼行數:12,代碼來源:BitcoinJSONClient.go

示例2: WalletPassPhrase

func WalletPassPhrase(id interface{}, passphrase, timeout interface{}) (map[string]interface{}, os.Error) {
	//Stores the wallet decryption key in memory for <timeout> seconds.
	resp, err := httpjsonrpc.Call(Address, "walletpassphrase", id, []interface{}{passphrase, timeout})
	if err != nil {
		log.Println(err)
		return resp, err
	}
	result := resp["result"]
	log.Println(result)

	return resp, err
}
開發者ID:postfix,項目名稱:Go-HTTP-JSON-RPC,代碼行數:12,代碼來源:BitcoinJSONClient.go

示例3: WalletPassPhraseChange

func WalletPassPhraseChange(id interface{}, data []interface{}) (map[string]interface{}, os.Error) {
	//Changes the wallet passphrase from <oldpassphrase> to <newpassphrase>.
	resp, err := httpjsonrpc.Call(Address, "walletpassphrasechange", id, data)
	if err != nil {
		log.Println(err)
		return resp, err
	}
	result := resp["result"]
	log.Println(result)

	return resp, err
}
開發者ID:postfix,項目名稱:Go-HTTP-JSON-RPC,代碼行數:12,代碼來源:BitcoinJSONClient.go

示例4: Stop

func Stop(id interface{}) (map[string]interface{}, os.Error) {
	//Stop bitcoin server.
	resp, err := httpjsonrpc.Call(Address, "stop", id, nil)
	if err != nil {
		log.Println(err)
		return resp, err
	}
	result := resp["result"]
	log.Println(result)

	return resp, err
}
開發者ID:postfix,項目名稱:Go-HTTP-JSON-RPC,代碼行數:12,代碼來源:BitcoinJSONClient.go

示例5: VerifyMessage

func VerifyMessage(id interface{}, bitcoinaddress, signature, message interface{}) (map[string]interface{}, os.Error) {
	//Verify a signed message
	resp, err := httpjsonrpc.Call(Address, "validateaddress", id, []interface{}{bitcoinaddress, signature, message})
	if err != nil {
		log.Println(err)
		return resp, err
	}
	result := resp["result"]
	log.Println(result)

	return resp, err
}
開發者ID:postfix,項目名稱:Go-HTTP-JSON-RPC,代碼行數:12,代碼來源:BitcoinJSONClient.go

示例6: SendToAddress

func SendToAddress(id interface{}, data []interface{}) (map[string]interface{}, os.Error) {
	//<amount> is a real and is rounded to 8 decimal places. Returns the transaction ID <txid> if successful.
	resp, err := httpjsonrpc.Call(Address, "sendtoaddress", id, data)
	if err != nil {
		log.Println(err)
		return resp, err
	}
	result := resp["result"]
	log.Println(result)

	return resp, err
}
開發者ID:postfix,項目名稱:Go-HTTP-JSON-RPC,代碼行數:12,代碼來源:BitcoinJSONClient.go

示例7: SetTxFee

func SetTxFee(id interface{}, amount []interface{}) (map[string]interface{}, os.Error) {
	//<amount> is a real and is rounded to the nearest 0.00000001
	resp, err := httpjsonrpc.Call(Address, "settxfee", id, amount)
	if err != nil {
		log.Println(err)
		return resp, err
	}
	result := resp["result"]
	log.Println(result)

	return resp, err
}
開發者ID:postfix,項目名稱:Go-HTTP-JSON-RPC,代碼行數:12,代碼來源:BitcoinJSONClient.go

示例8: GetReceivedByAddress

func GetReceivedByAddress(id interface{}, data []interface{}) (map[string]interface{}, os.Error) {
	//Returns the total amount received by <bitcoinaddress> in transactions with at least [minconf] confirmations. While some might consider this obvious, value reported by this only considers *receiving* transactions. It does not check payments that have been made *from* this address. In other words, this is not "getaddressbalance".
	resp, err := httpjsonrpc.Call(Address, "getreceivedbyaddress", id, data)
	if err != nil {
		log.Println(err)
		return resp, err
	}
	result := resp["result"]
	log.Println(result)

	return resp, err
}
開發者ID:postfix,項目名稱:Go-HTTP-JSON-RPC,代碼行數:12,代碼來源:BitcoinJSONClient.go

示例9: Help

func Help(id interface{}, command string) (map[string]interface{}, os.Error) {
	//List commands, or get help for a command.
	resp, err := httpjsonrpc.Call(Address, "help", id, []interface{}{command})
	if err != nil {
		log.Println(err)
		return resp, err
	}
	result := resp["result"]
	log.Println(result)

	return resp, err
}
開發者ID:postfix,項目名稱:Go-HTTP-JSON-RPC,代碼行數:12,代碼來源:BitcoinJSONClient.go

示例10: GetNewAddress

func GetNewAddress(id interface{}, account []interface{}) (map[string]interface{}, os.Error) {
	//Returns a new bitcoin address for receiving payments. If [account] is specified (recommended), it is added to the address book so payments received with the address will be credited to [account].
	resp, err := httpjsonrpc.Call(Address, "getnewaddress", id, account)
	if err != nil {
		log.Println(err)
		return resp, err
	}
	result := resp["result"]
	log.Println(result)

	return resp, err
}
開發者ID:postfix,項目名稱:Go-HTTP-JSON-RPC,代碼行數:12,代碼來源:BitcoinJSONClient.go

示例11: GetReceivedByAccount

func GetReceivedByAccount(id interface{}, data []interface{}) (map[string]interface{}, os.Error) {
	//Returns the total amount received by addresses with [account] in transactions with at least [minconf] confirmations. If [account] not provided return will include all transactions to all accounts. (version 0.3.24-beta)
	resp, err := httpjsonrpc.Call(Address, "getreceivedbyaccount", id, data)
	if err != nil {
		log.Println(err)
		return resp, err
	}
	result := resp["result"]
	log.Println(result)

	return resp, err
}
開發者ID:postfix,項目名稱:Go-HTTP-JSON-RPC,代碼行數:12,代碼來源:BitcoinJSONClient.go

示例12: GetInfo

func GetInfo(id interface{}) (map[string]interface{}, os.Error) {
	//Returns an object containing various state info.
	resp, err := httpjsonrpc.Call(Address, "getinfo", id, nil)
	if err != nil {
		log.Println(err)
		return resp, err
	}
	result := resp["result"]
	log.Println(result)

	return resp, err
}
開發者ID:postfix,項目名稱:Go-HTTP-JSON-RPC,代碼行數:12,代碼來源:BitcoinJSONClient.go

示例13: BackupWallet

func BackupWallet(id interface{}, destination []interface{}) (map[string]interface{}, os.Error) {
	//Safely copies wallet.dat to destination, which can be a directory or a path with filename.
	resp, err := httpjsonrpc.Call(Address, "backupwallet", id, destination)
	if err != nil {
		log.Println(err)
		return resp, err
	}
	result := resp["result"]
	log.Println(result)

	return resp, err
}
開發者ID:postfix,項目名稱:Go-HTTP-JSON-RPC,代碼行數:12,代碼來源:BitcoinJSONClient.go

示例14: GetHashesPerSec

func GetHashesPerSec(id interface{}) (map[string]interface{}, os.Error) {
	//Returns a recent hashes per second performance measurement while generating.
	resp, err := httpjsonrpc.Call(Address, "gethashespersec", id, nil)
	if err != nil {
		log.Println(err)
		return resp, err
	}
	result := resp["result"]
	log.Println(result)

	return resp, err
}
開發者ID:postfix,項目名稱:Go-HTTP-JSON-RPC,代碼行數:12,代碼來源:BitcoinJSONClient.go

示例15: SendMany

func SendMany(id interface{}, data []interface{}) (map[string]interface{}, os.Error) {
	//amounts are double-precision floating point numbers
	resp, err := httpjsonrpc.Call(Address, "sendmany", id, data)
	if err != nil {
		log.Println(err)
		return resp, err
	}
	result := resp["result"]
	log.Println(result)

	return resp, err
}
開發者ID:postfix,項目名稱:Go-HTTP-JSON-RPC,代碼行數:12,代碼來源:BitcoinJSONClient.go


注:本文中的httpjsonrpc.Call函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。