Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultDebugBBArgs() map[string]*string
- func GetIdlePort() (int, error)
- func Pstring(s string) *string
- func RunBigBangServer(optionsPtr *RunBigBangOptions) (func(), error)
- func UtilDataEncoding(data string) string
- func Wait4balanceReach(addr string, balance float64, client *Client, msg ...string) error
- func Wait4nBlocks(n int, client *Client) error
- type AddnewtemplateParam
- type AddnewtemplateParamDelegate
- type AddnewtemplateParamDexBBCMap
- type AddnewtemplateParamMint
- type AddnewtemplateParamMultisig
- type AddnewtemplateParamVote
- type AddrKeypair
- type AddressData
- type AddressInfo
- type BalanceInfo
- type BlockDetail
- type BlockInfo
- type Client
- func (c *Client) Addnewtemplate(p AddnewtemplateParam) (*string, error)
- func (c *Client) CallJSONRPC(method string, params map[string]interface{}, result interface{}) ([]byte, error)
- func (c *Client) Createtransaction(cmd CmdCreatetransaction) (*string, error)
- func (c *Client) Decodetransaction(txdata string) (*NoneSerializedTransaction, error)
- func (c *Client) Exportkey(pubkey string) (string, error)
- func (c *Client) Getbalance(fork *string, address *string) ([]BalanceInfo, error)
- func (c *Client) Getblock(hash string) (*BlockInfo, error)
- func (c *Client) GetblockByHeight(height uint64, fork *string) (*BlockInfo, error)
- func (c *Client) Getblockcount(fork *string) (*int, error)
- func (c *Client) Getblockdetail(blockHash string) (*BlockDetail, error)
- func (c *Client) Getblockhash(height int, fork *string) ([]string, error)
- func (c *Client) Getforkheight(fork *string) (h int, err error)
- func (c *Client) Getnewkey(passphrase string) (string, error)
- func (c *Client) Getpubkeyaddress(pubkey string, reversal *string) (*string, error)
- func (c *Client) Gettransaction(txid string, serialized *bool) (*TransactionDetail, error)
- func (c *Client) Importkey(pubkey string, syncTx *bool) (string, error)
- func (c *Client) Importprivkey(privkey, passphrase string, syncTx *bool) (*string, error)
- func (c *Client) Importpubkey(pubkey string) (*string, error)
- func (c *Client) Importtemplate(data string) (*string, error)
- func (c *Client) ListBlockDetailsBetween(fork *string, fromHeight, toHeight int) ([]BlockDetail, error)
- func (c *Client) ListBlockDetailsSince(fork *string, targetBlockHash string, count int) (int, []BlockDetail, error)
- func (c *Client) ListTransactionsSinceBlock(targetBlockHash string, count int) (string, []TransactionDetail, error)
- func (c *Client) Listaddress() ([]AddressData, error)
- func (c *Client) Listdelegate(count int) (ret []Delegate, error error)
- func (c *Client) Listfork(all bool) (ret []ForkProfile, err error)
- func (c *Client) Listkey() ([]PubkeyInfo, error)
- func (c *Client) Listpeer() ([]PeerInfo, error)
- func (c *Client) Listtransaction(count *uint, offset *int) ([]Transaction, error)
- func (c *Client) Listunspent(address string, fork *string, max uint) (*UnspentTotal, error)
- func (c *Client) Makekeypair() (*Keypair, error)
- func (c *Client) NextID() uint64
- func (c *Client) PendingPostCount() int
- func (c *Client) Sendfrom(cmd CmdSendfrom) (*string, error)
- func (c *Client) Sendtransaction(txdata string) (*string, error)
- func (c *Client) Shutdown()
- func (c *Client) Signrawtransactionwithwallet(addrIn, txdata string) (*SigntransactionResult, error)
- func (c *Client) Signtransaction(txdata string) (*SigntransactionResult, error)
- func (c *Client) Unlockkey(pubkey, passphrase string, timeout *int64) (*string, error)
- func (c *Client) Validateaddress(addr string) (*AddressInfo, error)
- func (c *Client) Version() (string, error)
- type ClusterNode
- type CmdCreatetransaction
- type CmdSendfrom
- type ConnConfig
- type DataDetail
- type Delegate
- type DockerCore
- type ForkProfile
- type Keypair
- type NoneSerializedTransaction
- type PeerInfo
- type PubkeyInfo
- type Request
- type RunBigBangOptions
- type SigntransactionResult
- type TW
- func (tw *TW) AllNotZero(msg string, values ...interface{}) *TW
- func (tw *TW) Continue(_continue bool) *TW
- func (tw *TW) Copy() *TW
- func (tw *TW) Equal(expected, actual interface{}, args ...interface{}) *TW
- func (tw *TW) IsZero(v interface{}, args ...interface{}) *TW
- func (tw *TW) Nil(x interface{}, args ...interface{}) *TW
- func (tw *TW) NotZero(v interface{}, args ...interface{}) *TW
- func (tw *TW) True(flag bool, args ...interface{}) *TW
- type TemplateData
- type Transaction
- type TransactionDetail
- type UnspentTotal
- type VinPoint
Constants ¶
const ( TransactionTypeWork = "work" TransactionTypeToken = "token" TransactionTypeStake = "stake" TransactionTypeGenesis = "genesis" TransactionTypeCertification = "certification" )
transaction types
const ( TDefaultPort = 19900 TDefaultRPCPort = 19906 TDefaultPort2 = 19901 TDefaultRPCPort2 = 19907 TDefaultRPCUser = "rpcusr" TDefaultRPCPassword = "pwd" )
一些测试用常量
Variables ¶
var ( // ErrInvalidAuth is an error to describe the condition where the client // is either unable to authenticate or the specified endpoint is // incorrect. ErrInvalidAuth = errors.New("authentication failure") // ErrClientShutdown is an error to describe the condition where the // client is either already shutdown, or in the process of shutting // down. Any outstanding futures when a client shutdown occurs will // return this error as will any new requests. ErrClientShutdown = errors.New("the client has been shutdown") )
var ( TCryptonightAddr = AddrKeypair{ Keypair: Keypair{Privkey: "eadae10eb384b4d090c10bf2469ee359e32c179026f616ebdf38318ccda5a068", Pubkey: "639ddcfda6e7357cb6543ecb328d6abd130daedaa26beb09bf0e34260f583d77"}, Address: "1ewyng3s66g7by2fbdehdnbgd2eypn39jscz59dkw6qktdzewknhsmk4t"} TCryptonightKey = AddrKeypair{ Keypair: Keypair{Privkey: "174c4fabefc9573c9cd506dff7f6cb0c54ecaaa63cc0d9f53da7e9c133a01c3a", Pubkey: "ea34707897e6a9ec8e4038179a75fb29d1204a3a5bc4bd07c1c6454d3feac3f7"}, Address: "1yz1ymftd8q3c21xxrhdkmjh0t4mzpxct2ww413qcn7k9ey3g6knfswbw"} //几组地址 TAddr0 = AddrKeypair{ Keypair: Keypair{Privkey: "195cd69eff4580ad2430f92d2c86865c596e72edb33f40df5d41c97883241c7c", Pubkey: "a7386f6cbe769fda91462637393970850ae7528d2cee5214c26cc4b27c014a65"}, Address: "1cn502z5jrhpc452jxrp8tmq71a2q0e9s6wk4d4etkxvbwv3f72ksbkdn"} TAddr1 = AddrKeypair{ Keypair: Keypair{Privkey: "3de774bfb200a46f6d969f5e080572859bc5d7b297fdb34471f55be3326b2153", Pubkey: "1fb8c0c79a506fd8fcca12065331110ae4aedceb2eac38f75379174c6a5b1bff"}, Address: "1zwdnptjc2xwn7xsrngqeqq5ewg512cak0r9cnz6rdx89nhy0q0fstv2y"} TAddr2 = AddrKeypair{ Keypair: Keypair{Privkey: "8c49b0f3788e07025303ef763e55d14781c09d43cb749628d26280f8f6912336", Pubkey: "5910534ab7629ccb73659df42afc3c382597223a9caa4040a687dbebbe1aa88a"}, Address: "1ham1nfqbve3tcg20nae3m8mq4mw3sz1ayjepawybkhhbejjk21cvjnx3"} TAddr3 = AddrKeypair{ Keypair: Keypair{Privkey: "5dd0705adf24f1177cedf2795521748358ec08b2d46ddb659f4f68e870433e60", Pubkey: "e4dcb0b8282298a43d5f8c5cbdd3bc27e7f6a44bf0be04e38301655c09038fdb"}, Address: "1ve7g62awcm0r7rr4qvr4q97pwwkvsmxxbj65yfd4k0h2he5gvkj3d8dz"} )
一些测试用数据
Functions ¶
func DefaultDebugBBArgs ¶
DefaultDebugBBArgs debug BigBang args testnet,listen4,debug,port=19900,rpcport=19906,rpcuser=rpcusr,rpcpassword=pwd
func RunBigBangServer ¶
func RunBigBangServer(optionsPtr *RunBigBangOptions) (func(), error)
RunBigBangServer run bigbang server,print out to stdout, require bigbang in the $PATH, this func is used for testing BigBang in local test env return func() to kill bigbang server usage:
killBigbang, err := RunBigBangServer(options) defer killBigBang()
func Wait4balanceReach ¶
Wait4balanceReach 每次休眠1s,等待地址的余额达到
Types ¶
type AddnewtemplateParam ¶
AddnewtemplateParam .
type AddnewtemplateParamDelegate ¶
type AddnewtemplateParamDelegate struct { Delegate string `json:"delegate,omitempty"` //(string, required) delegate public key Owner string `json:"owner,omitempty"` //(string, required) owner address }
AddnewtemplateParamDelegate .
func (AddnewtemplateParamDelegate) ParamName ¶
func (p AddnewtemplateParamDelegate) ParamName() string
ParamName .
func (AddnewtemplateParamDelegate) TemplateType ¶
func (p AddnewtemplateParamDelegate) TemplateType() string
TemplateType .
type AddnewtemplateParamDexBBCMap ¶
type AddnewtemplateParamDexBBCMap struct {
Owner string `json:"owner,omitempty"` //(string, required) owner address
}
AddnewtemplateParamDexBBCMap .
func (AddnewtemplateParamDexBBCMap) ParamName ¶
func (p AddnewtemplateParamDexBBCMap) ParamName() string
ParamName .
func (AddnewtemplateParamDexBBCMap) TemplateType ¶
func (p AddnewtemplateParamDexBBCMap) TemplateType() string
TemplateType .
type AddnewtemplateParamMint ¶
type AddnewtemplateParamMint struct { Mint string `json:"mint,omitempty"` //mint public key Spent string `json:"spent,omitempty"` //spent address }
AddnewtemplateParamMint .
func (AddnewtemplateParamMint) ParamName ¶
func (p AddnewtemplateParamMint) ParamName() string
ParamName .
func (AddnewtemplateParamMint) TemplateType ¶
func (p AddnewtemplateParamMint) TemplateType() string
TemplateType .
type AddnewtemplateParamMultisig ¶
type AddnewtemplateParamMultisig struct { Required int `json:"required,omitempty"` Pubkeys []string `json:"pubkeys,omitempty"` }
AddnewtemplateParamMultisig .
func (AddnewtemplateParamMultisig) ParamName ¶
func (p AddnewtemplateParamMultisig) ParamName() string
ParamName .
func (AddnewtemplateParamMultisig) TemplateType ¶
func (p AddnewtemplateParamMultisig) TemplateType() string
TemplateType .
type AddnewtemplateParamVote ¶
type AddnewtemplateParamVote struct { Delegate string `json:"delegate,omitempty"` //(string, required) delegate public key Owner string `json:"owner,omitempty"` //(string, required) owner address }
AddnewtemplateParamVote .
func (AddnewtemplateParamVote) ParamName ¶
func (p AddnewtemplateParamVote) ParamName() string
ParamName .
func (AddnewtemplateParamVote) TemplateType ¶
func (p AddnewtemplateParamVote) TemplateType() string
TemplateType .
type AddrKeypair ¶
AddrKeypair address and keypair
type AddressData ¶
type AddressData struct { Address string `json:"address,omitempty"` //(string, required) wallet address Ismine bool `json:"ismine,omitempty"` //(bool, required) is mine Type string `json:"type,omitempty"` //(string, required) type, pubkey or template // (if type=pubkey) Pubkey *string `json:"pubkey,omitempty"` //(string, required) public key // (if type=template) Template *string `json:"template,omitempty"` //(string, required) template type name // (if type=template && ismine=true) Templatedata *TemplateData `json:"templatedata,omitempty"` //(object, required) template data }
AddressData .
type AddressInfo ¶
type AddressInfo struct { Isvalid bool `json:"isvalid,omitempty"` //": true|false, (bool, required) is valid // (if isvalid=true) Addressdata *AddressData `json:"addressdata,omitempty"` //(object, required) address data }
AddressInfo .
type BalanceInfo ¶
type BalanceInfo struct { Address string `json:"address,omitempty"` //(string, required) wallet address Avail float64 `json:"avail,omitempty"` //(double, required) balance available amount Locked float64 `json:"locked,omitempty"` //(double, required) locked amount Unconfirmed float64 `json:"unconfirmed,omitempty"` //(double, required) unconfirmed amount }
BalanceInfo .
type BlockDetail ¶
type BlockDetail struct { Hash string `json:"hash,omitempty"` //(string, required) block hash HashPrev string `json:"hashPrev,omitempty"` //(string, required) block prev hash Version uint `json:"version,omitempty"` //(uint, required) version Type string `json:"type,omitempty"` //(string, required) block type Time uint `json:"time,omitempty"` //(uint, required) block time Bits uint `json:"bits,omitempty"` //(uint, required) nBits Fork string `json:"fork,omitempty"` //(string, required) fork hash Height uint `json:"height,omitempty"` //(uint, required) block height Prev string `json:"prev,omitempty"` //(string, optional) previous block hash Txmint NoneSerializedTransaction `json:"txmint,omitempty"` // (object, required) transaction mint data Tx []NoneSerializedTransaction `json:"tx,omitempty"` }
BlockDetail 区块详细信息
type BlockInfo ¶
type BlockInfo struct { Hash string `json:"hash"` //(string, required) block hash Version uint `json:"version"` //(uint, required) version Type string `json:"type"` //(string, required) block type Time uint `json:"time"` //(uint, required) block time Fork string `json:"fork"` //(string, required) fork hash Height uint `json:"height"` //(uint, required) block height Txmint string `json:"txmint"` //(string, required) transaction mint hash Prev string `json:"prev"` //(string, optional) previous block hash Tx []string `json:"tx"` //(string, required) transaction hash }
BlockInfo 块信息
type Client ¶
type Client struct { Debug bool //print some debug log when true // contains filtered or unexported fields }
Client .
func NewClientWith ¶
func NewClientWith(config *ConnConfig, httpClient *http.Client) (*Client, error)
NewClientWith .
func TesttoolRunServerAndBeginMint ¶
func TesttoolRunServerAndBeginMint(t *testing.T, opts ...RunBigBangOptions) (func(), *Client, string)
TesttoolRunServerAndBeginMint (测试中)启动bigbang,使用预置的私钥开始挖矿, opts 作为可选参数只使用第一个值(如果有) 返回:killBigbang(), Client, 挖矿模版地址
func (*Client) Addnewtemplate ¶
func (c *Client) Addnewtemplate(p AddnewtemplateParam) (*string, error)
Addnewtemplate https://github.com/bigbangcore/BigBang/wiki/JSON-RPC#addnewtemplate
func (*Client) CallJSONRPC ¶
func (c *Client) CallJSONRPC(method string, params map[string]interface{}, result interface{}) ([]byte, error)
CallJSONRPC any rpc
func (*Client) Createtransaction ¶
func (c *Client) Createtransaction(cmd CmdCreatetransaction) (*string, error)
Createtransaction https://github.com/bigbangcore/BigBang/wiki/JSON-RPC#createtransaction
func (*Client) Decodetransaction ¶
func (c *Client) Decodetransaction(txdata string) (*NoneSerializedTransaction, error)
Decodetransaction https://github.com/bigbangcore/BigBang/wiki/JSON-RPC#decodetransaction
func (*Client) Exportkey ¶
Exportkey https://github.com/bigbangcore/BigBang/wiki/JSON-RPC#exportkey
func (*Client) Getbalance ¶
func (c *Client) Getbalance(fork *string, address *string) ([]BalanceInfo, error)
Getbalance https://github.com/bigbangcore/BigBang/wiki/JSON-RPC#getbalance
func (*Client) Getblock ¶
Getblock https://github.com/bigbangcore/BigBang/wiki/JSON-RPC#getblock
func (*Client) GetblockByHeight ¶
GetblockByHeight .
func (*Client) Getblockcount ¶
Getblockcount https://github.com/bigbangcore/BigBang/wiki/JSON-RPC#getblockcount
func (*Client) Getblockdetail ¶
func (c *Client) Getblockdetail(blockHash string) (*BlockDetail, error)
Getblockdetail https://github.com/bigbangcore/BigBang/wiki/JSON-RPC#getblockdetail
func (*Client) Getblockhash ¶
Getblockhash https://github.com/bigbangcore/BigBang/wiki/JSON-RPC#getblockhash
func (*Client) Getforkheight ¶
Getforkheight https://github.com/bigbangcore/BigBang/wiki/JSON-RPC#getforkheight
func (*Client) Getnewkey ¶
Getnewkey https://github.com/bigbangcore/BigBang/wiki/JSON-RPC#getnewkey
func (*Client) Getpubkeyaddress ¶
Getpubkeyaddress https://github.com/bigbangcore/BigBang/wiki/JSON-RPC#getpubkeyaddress
func (*Client) Gettransaction ¶
func (c *Client) Gettransaction(txid string, serialized *bool) (*TransactionDetail, error)
Gettransaction https://github.com/bigbangcore/BigBang/wiki/JSON-RPC#gettransaction
func (*Client) Importkey ¶
Importkey https://github.com/bigbangcore/BigBang/wiki/JSON-RPC#importkey
func (*Client) Importprivkey ¶
Importprivkey https://github.com/bigbangcore/BigBang/wiki/JSON-RPC#importprivkey
func (*Client) Importpubkey ¶
Importpubkey https://github.com/bigbangcore/BigBang/wiki/JSON-RPC#importpubkey
func (*Client) Importtemplate ¶
Importtemplate https://github.com/bigbangcore/BigBang/wiki/JSON-RPC#importtemplate
func (*Client) ListBlockDetailsBetween ¶
func (c *Client) ListBlockDetailsBetween(fork *string, fromHeight, toHeight int) ([]BlockDetail, error)
ListBlockDetailsBetween 列出[from,to]内所有区块详情 return: blockDetails, error
func (*Client) ListBlockDetailsSince ¶
func (c *Client) ListBlockDetailsSince(fork *string, targetBlockHash string, count int) (int, []BlockDetail, error)
ListBlockDetailsSince 列出自某个区块以来的所有区块详情,不包含targetBlock的交易 return: topBlockHeight, blockDetails, error
func (*Client) ListTransactionsSinceBlock ¶
func (c *Client) ListTransactionsSinceBlock(targetBlockHash string, count int) (string, []TransactionDetail, error)
ListTransactionsSinceBlock 列出自某个区块以来的所有交易,不包含targetBlock的交易 return: scan2BlockHash, tx, error
func (*Client) Listaddress ¶
func (c *Client) Listaddress() ([]AddressData, error)
Listaddress https://github.com/bigbangcore/BigBang/wiki/JSON-RPC#listaddress
func (*Client) Listdelegate ¶
func (*Client) Listfork ¶
func (c *Client) Listfork(all bool) (ret []ForkProfile, err error)
Listfork https://github.com/bigbangcore/BigBang/wiki/JSON-RPC#listfork
func (*Client) Listkey ¶
func (c *Client) Listkey() ([]PubkeyInfo, error)
Listkey https://github.com/bigbangcore/BigBang/wiki/JSON-RPC#listkey
func (*Client) Listpeer ¶
Listpeer https://github.com/bigbangcore/BigBang/wiki/JSON-RPC#listpeer
func (*Client) Listtransaction ¶
func (c *Client) Listtransaction(count *uint, offset *int) ([]Transaction, error)
Listtransaction https://github.com/bigbangcore/BigBang/wiki/JSON-RPC#listtransaction
func (*Client) Listunspent ¶
Listunspent https://github.com/bigbangcore/BigBang/wiki/JSON-RPC#listunspent
func (*Client) Makekeypair ¶
Makekeypair https://github.com/bigbangcore/BigBang/wiki/JSON-RPC#makekeypair
func (*Client) NextID ¶
NextID returns the next id to be used when sending a JSON-RPC message. This ID allows responses to be associated with particular requests per the JSON-RPC specification. Typically the consumer of the client does not need to call this function, however, if a custom request is being created and used this function should be used to ensure the ID is unique amongst all requests being made.
func (*Client) PendingPostCount ¶
PendingPostCount current post request count waiting for process
func (*Client) Sendfrom ¶
func (c *Client) Sendfrom(cmd CmdSendfrom) (*string, error)
Sendfrom https://github.com/bigbangcore/BigBang/wiki/JSON-RPC#sendfrom
func (*Client) Sendtransaction ¶
Sendtransaction https://github.com/bigbangcore/BigBang/wiki/JSON-RPC#sendtransaction
func (*Client) Shutdown ¶
func (c *Client) Shutdown()
Shutdown shuts down the client by disconnecting any connections associated with the client and, when automatic reconnect is enabled, preventing future attempts to reconnect. It also stops all goroutines.
func (*Client) Signrawtransactionwithwallet ¶
func (c *Client) Signrawtransactionwithwallet(addrIn, txdata string) (*SigntransactionResult, error)
Signrawtransactionwithwallet https://github.com/bigbangcore/BigBang/wiki/JSON-RPC#signrawtransactionwithwallet
func (*Client) Signtransaction ¶
func (c *Client) Signtransaction(txdata string) (*SigntransactionResult, error)
Signtransaction https://github.com/bigbangcore/BigBang/wiki/JSON-RPC#signtransaction
func (*Client) Unlockkey ¶
Unlockkey https://github.com/bigbangcore/BigBang/wiki/JSON-RPC#unlockkey
func (*Client) Validateaddress ¶
func (c *Client) Validateaddress(addr string) (*AddressInfo, error)
Validateaddress https://github.com/bigbangcore/BigBang/wiki/JSON-RPC#validateaddress
type ClusterNode ¶
ClusterNode .
func TesttoolRunClusterWith2nodes ¶
func TesttoolRunClusterWith2nodes(t *testing.T) (func(), []ClusterNode)
TesttoolRunClusterWith2nodes 运行2个节点,返回的第一个节点为矿工节点,发生错误则终止测试,矿工节点的日志会打印出来
type CmdCreatetransaction ¶
type CmdCreatetransaction struct { From string `json:"from,omitempty"` //(string, required) from address To string `json:"to,omitempty"` //(string, required) to address Amount float64 `json:"amount,omitempty"` //(double, required) amount Txfee *float64 `json:"txfee,omitempty"` //(double, optional) transaction fee Fork *string `json:"fork,omitempty"` //(string, optional) fork hash Data *string `json:"data,omitempty"` //(string, optional) output data }
CmdCreatetransaction .
type CmdSendfrom ¶
type CmdSendfrom struct { From string `json:"from"` //(string, required) from address To string `json:"to"` //(string, required) to address Amount float64 `json:"amount"` //(double, required) amount Txfee *float64 `json:"txfee,omitempty"` //(double, optional) transaction fee Fork *string `json:"fork,omitempty"` //(string, optional) fork hash Data *string `json:"data,omitempty"` //(string, optional) output data SignM *string `json:"sign_m,omitempty"` //(string, optional) exchange sign m SignS *string `json:"sign_s,omitempty"` //(string, optional) exchange sign s Sendtodata *string `json:"sendtodata,omitempty"` //(string, optional) If the 'to' address of transaction is a template, this option allows to save the template hex data. The hex data is equal output of RPC 'exporttemplate' Type *uint `json:"type,omitempty"` //(uint, optional, default=0) 0: common token tx, 2: defi relation tx }
CmdSendfrom .
type ConnConfig ¶
type ConnConfig struct { // Host is the IP address and port of the RPC server you want to connect // to. Host string // User is the username to use to authenticate to the RPC server. User string // Pass is the passphrase to use to authenticate to the RPC server. Pass string // DisableTLS specifies whether transport layer security should be // disabled. It is recommended to always use TLS if the RPC server // supports it as otherwise your username and password is sent across // the wire in cleartext. DisableTLS bool // Certificates are the bytes for a PEM-encoded certificate chain used // for the TLS connection. It has no effect if the DisableTLS parameter // is true. Certificates []byte }
ConnConfig describes the connection configuration parameters for the client. This
type DataDetail ¶
DataDetail .
type Delegate ¶
type Delegate struct { Address string `json:"address,omitempty"` Votes float64 `json:"votes,omitempty"` }
Delegate .
type DockerCore ¶
type DockerCore struct { Client *Client MinerAddress string //矿工地址(资金来源) MinerOwnerPubk string //矿工owner address 公钥 UnlockPass string //已有地址解锁密码 Conf ConnConfig }
func CmdRunDockerDevCore ¶
func CmdRunDockerDevCore(imageName string) (func(), DockerCore, error)
CmdRunDockerDevCore 运行1个bbc core
func MustDockerRunDevCore ¶
func MustDockerRunDevCore(t *testing.T, imageName string) DockerCore
MustDockerRunDevCore 运行1个bbc core, 运行失败时t.Fatal, 自动注册 cleanup func
type ForkProfile ¶
type ForkProfile struct { Fork string `json:"fork,omitempty"` //(string, required) fork id with hex system Name string `json:"name,omitempty"` //(string, required) fork name Symbol string `json:"symbol,omitempty"` //(string, required) fork symbol Amount float64 `json:"amount,omitempty"` //(double, required) amount Reward float64 `json:"reward,omitempty"` //(double, required) mint reward Halvecycle uint64 `json:"halvecycle,omitempty"` //(uint, required) halve cycle: 0: fixed reward, >0: blocks of halve cycle Isolated bool `json:"isolated,omitempty"` //(bool, required) is isolated Private bool `json:"private,omitempty"` //(bool, required) is private Enclosed bool `json:"enclosed,omitempty"` //(bool, required) is enclosed Owner string `json:"owner,omitempty"` //(string, required) owner's address }
ForkProfile .
type NoneSerializedTransaction ¶
type NoneSerializedTransaction struct { Txid string `json:"txid,omitempty"` //(string, required) transaction hash Version uint `json:"version,omitempty"` //(uint, required) version Type string `json:"type,omitempty"` //(string, required) transaction type Time uint `json:"time,omitempty"` //(uint, required) transaction timestamp Lockuntil uint `json:"lockuntil,omitempty"` //(uint, required) unlock time Anchor string `json:"anchor,omitempty"` //(string, required) anchor hash Blockhash string `json:"blockhash"` //block hash Sendfrom string `json:"sendfrom,omitempty"` //(string, required) send from address Sendto string `json:"sendto,omitempty"` //(string, required) send to address Amount float64 `json:"amount,omitempty"` //(double, required) amount Txfee float64 `json:"txfee,omitempty"` //(double, required) transaction fee Data string `json:"data,omitempty"` //(string, required) data Sig string `json:"sig,omitempty"` //(string, required) sign Fork string `json:"fork,omitempty"` //(string, required) fork hash Confirmations *int `json:"confirmations,omitempty"` //(int, optional) confirmations Vin []VinPoint `json:"vin,omitempty"` //(object, required) vin struct }
NoneSerializedTransaction .
type PeerInfo ¶
type PeerInfo struct { Address string `json:"address,omitempty"` //(string, required) peer address Services string `json:"services,omitempty"` //(string, required) service Lastsend string `json:"lastsend,omitempty"` //(int, required) last send time Lastrecv string `json:"lastrecv,omitempty"` //(int, required) last receive time Conntime string `json:"conntime,omitempty"` //(int, required) active time Pingtime int `json:"pingtime"` //(int, required) ping pong time Version string `json:"version,omitempty"` //(string, required) version Subver string `json:"subver,omitempty"` //(string, required) sub version Inbound bool `json:"inbound,omitempty"` //(bool, required) accept multiple connection or not Height int `json:"height,omitempty"` //(int, required) starting height Banscore int `json:"banscore,omitempty"` //(int, required) ban score }
PeerInfo .
type PubkeyInfo ¶
type PubkeyInfo struct { Key string `json:"key,omitempty"` //public key with hex system Version int64 `json:"version,omitempty"` Locked bool `json:"locked,omitempty"` Timeout *int64 `json:"timeout,omitempty"` //public key timeout locked }
PubkeyInfo .
type Request ¶
type Request struct { Jsonrpc string `json:"jsonrpc"` Method string `json:"method"` Params json.RawMessage `json:"params"` ID interface{} `json:"id"` }
Request is a type for raw JSON-RPC 1.0 requests. The Method field identifies the specific command type which in turns leads to different parameters. Callers typically will not use this directly since this package provides a statically typed command infrastructure which handles creation of these requests, however this struct it being exported in case the caller wants to construct raw requests for some reason.
type RunBigBangOptions ¶
type RunBigBangOptions struct { NewTmpDir bool //创建并使用新的临时目录作为datadir TmpDirTag string //tag会作为临时路径的前缀 KeepTmpDirInKill bool //kill func中保留临时目录 Args map[string]*string //k-v ,v 为nil时为flag NotPrint2stdout bool //不打印到stdout }
RunBigBangOptions .
type SigntransactionResult ¶
type SigntransactionResult struct { Hex string `json:"hex,omitempty"` //(string, required) hex of transaction data Completed bool `json:"completed,omitempty"` //(bool, required) transaction completed or not }
SigntransactionResult .
type TW ¶
TW testing.T wrap
func (*TW) AllNotZero ¶
AllNotZero all values should not be zero
type TemplateData ¶
type TemplateData struct { Type string `json:"type,omitempty"` //(string, required) template type Hex string `json:"hex,omitempty"` //(string, required) temtplate data // (if type=delegate) Delegate *struct { Delegate string `json:"delegate,omitempty"` //(string, required) delegate public key Owner string `json:"owner,omitempty"` //(string, required) owner address } `json:"delegate,omitempty"` // (if type=vote) Vote *struct { Delegate string `json:"delegate,omitempty"` //(string, required) delegate public key Owner string `json:"owner,omitempty"` //(string, required) owner address } `json:"vote,omitempty"` // (if type=fork) Fork *struct { Redeem string `json:"redeem,omitempty"` //(string, required) redeem address Fork string `json:"fork,omitempty"` //(string, required) fork hash } `json:"fork,omitempty"` // (if type=mint) Mint *struct { Mint string `json:"mint,omitempty"` //(string, required) mint public key Spent string `json:"spent,omitempty"` //(string, required) spent address } `json:"mint,omitempty"` // (if type=multisig) Multisig *struct { Required int64 `json:"required,omitempty"` //(int, required) required weight Addresses []string `json:"addresses,omitempty"` //(string, required) public key } `json:"multisig,omitempty"` // (if type=exchange) Exchange *struct { SpendS string `json:"spend_s,omitempty"` //(string, required) spend_s SpendM string `json:"spend_m,omitempty"` //(string, required) spend_m HeightM int64 `json:"height_m,omitempty"` //(int, required) height m HeightS int64 `json:"height_s,omitempty"` //(int, required) height s ForkM string `json:"fork_m,omitempty"` //(string, required) fork m ForkS string `json:"fork_s,omitempty"` //(string, required) fork s } `json:"exchange,omitempty"` // (if type=weighted) Weighted *struct { Required int64 `json:"required,omitempty"` //(int, required) required weight Pubkey []struct { Key string `json:"key,omitempty"` //(string, required) public key Weight int64 `json:"weight,omitempty"` //(int, required) weight } `json:"pubkey,omitempty"` } `json:"weighted,omitempty"` Dexbbcmap *struct { Owner string `json:"owner"` } `json:"dexbbcmap,omitempty"` }
TemplateData .
type Transaction ¶
type Transaction struct { Txid string `json:"txid,omitempty"` //(string, required) transaction hash Fork string `json:"fork,omitempty"` //(string, required) fork hash Type string `json:"type,omitempty"` //(string, required) transaction type Time uint `json:"time,omitempty"` //(uint, required) transaction timestamp Send bool `json:"send,omitempty"` //(bool, required) is from me To string `json:"to,omitempty"` //(string, required) to address Amount float64 `json:"amount,omitempty"` //(double, required) transaction amount Fee float64 `json:"fee,omitempty"` //(double, required) transaction fee Lockuntil uint `json:"lockuntil,omitempty"` //(uint, required) lockuntil Blockheight *int `json:"blockheight,omitempty"` //(int, optional) block height From *string `json:"from,omitempty"` //(string, optional) from address }
Transaction .
type TransactionDetail ¶
type TransactionDetail struct { // (if serialized=true) Serialization *string `json:"serialization,omitempty"` //(string, optional) transaction hex data // (if serialized=false) Transaction *NoneSerializedTransaction `json:"transaction,omitempty"` //(object, optional) transaction data }
TransactionDetail .
type UnspentTotal ¶
type UnspentTotal struct { Total decimal.Decimal `json:"total,omitempty"` Addresses []struct { Address string `json:"address,omitempty"` Unspents []struct { Txid string `json:"txid,omitempty"` Out uint `json:"out,omitempty"` Amount decimal.Decimal `json:"amount,omitempty"` Time int64 `json:"time,omitempty"` Lockuntil int64 `json:"lockuntil,omitempty"` } `json:"unspents,omitempty"` Sum decimal.Decimal `json:"sum,omitempty"` } `json:"addresses,omitempty"` }
UnspentTotal .