Documentation
¶
Index ¶
- func BuildContractExtraData(op string, contractAdr common.Address, params string) []byte
- type BlockResp
- type CurBalanceResp
- type CurStakeResp
- type DipperinDebugApi
- type DipperinMercuryApi
- func (api *DipperinMercuryApi) AddAccount(derivationPath string, walletIdentifier accounts.WalletIdentifier) (accounts.Account, error)
- func (api *DipperinMercuryApi) CheckBootNode() ([]string, error)
- func (api *DipperinMercuryApi) CloseWallet(walletIdentifier accounts.WalletIdentifier) error
- func (api *DipperinMercuryApi) CreateERC20(from common.Address, tokenName, tokenSymbol string, amount *big.Int, ...) (ERC20Resp, error)
- func (api *DipperinMercuryApi) CurrentBalance(address common.Address) (resp *CurBalanceResp, err error)
- func (api *DipperinMercuryApi) CurrentBlock() (*BlockResp, error)
- func (api *DipperinMercuryApi) CurrentReputation(address common.Address) (uint64, error)
- func (api *DipperinMercuryApi) CurrentStake(address common.Address) (resp *CurStakeResp, err error)
- func (api *DipperinMercuryApi) ERC20Allowance(contractAddr, owner, spender common.Address) (interface{}, error)
- func (api *DipperinMercuryApi) ERC20Approve(contractAdr, from, to common.Address, amount, txFee *big.Int) (common.Hash, error)
- func (api *DipperinMercuryApi) ERC20Balance(contractAddr, owner common.Address) (interface{}, error)
- func (api *DipperinMercuryApi) ERC20TotalSupply(contractAddr common.Address) (interface{}, error)
- func (api *DipperinMercuryApi) ERC20Transfer(contractAddr, from, to common.Address, amount, txFee *big.Int) (common.Hash, error)
- func (api *DipperinMercuryApi) ERC20TransferFrom(contractAdr, owner, from, to common.Address, amount, txFee *big.Int) (common.Hash, error)
- func (api *DipperinMercuryApi) EstablishWallet(password, passPhrase string, walletIdentifier accounts.WalletIdentifier) (mnemonic string, err error)
- func (api *DipperinMercuryApi) GetAddressNonceFromWallet(address common.Address) (nonce uint64, err error)
- func (api *DipperinMercuryApi) GetBlockBody(hash common.Hash) *model.Body
- func (api *DipperinMercuryApi) GetBlockByHash(hash common.Hash) (*BlockResp, error)
- func (api *DipperinMercuryApi) GetBlockByNumber(number uint64) (*BlockResp, error)
- func (api *DipperinMercuryApi) GetBlockDiffVerifierInfo(blockNumber uint64) (map[economy_model.VerifierType][]common.Address, error)
- func (api *DipperinMercuryApi) GetBlockNumber(hash common.Hash) *uint64
- func (api *DipperinMercuryApi) GetBlockYear(blockNumber uint64) (uint64, error)
- func (api *DipperinMercuryApi) GetChainConfig() (conf chain_config.ChainConfig, err error)
- func (api *DipperinMercuryApi) GetContract(contractAddr common.Address) (interface{}, error)
- func (api *DipperinMercuryApi) GetContractInfo(eData *contract.ExtraDataForContract) (interface{}, error)
- func (api *DipperinMercuryApi) GetCurVerifiers() []common.Address
- func (api *DipperinMercuryApi) GetCurrentConnectPeers() ([]PeerInfoResp, error)
- func (api *DipperinMercuryApi) GetDeveloperInfo() map[string]*hexutil.Big
- func (api *DipperinMercuryApi) GetDeveloperLockDIP(address common.Address, blockNumber uint64) (*hexutil.Big, error)
- func (api *DipperinMercuryApi) GetEarlyTokenLockDIP(address common.Address, blockNumber uint64) (*hexutil.Big, error)
- func (api *DipperinMercuryApi) GetFoundationInfo(usage economy_model.FoundationDIPUsage) map[string]*hexutil.Big
- func (api *DipperinMercuryApi) GetGenesis() (*BlockResp, error)
- func (api *DipperinMercuryApi) GetInvestorInfo() map[string]*hexutil.Big
- func (api *DipperinMercuryApi) GetInvestorLockDIP(address common.Address, blockNumber uint64) (*hexutil.Big, error)
- func (api *DipperinMercuryApi) GetMaintenanceLockDIP(address common.Address, blockNumber uint64) (*hexutil.Big, error)
- func (api *DipperinMercuryApi) GetMineMasterDIPReward(blockNumber uint64) (*hexutil.Big, error)
- func (api *DipperinMercuryApi) GetMineMasterEDIPReward(blockNumber uint64, tokenDecimals int) (*hexutil.Big, error)
- func (api *DipperinMercuryApi) GetNextVerifiers() []common.Address
- func (api *DipperinMercuryApi) GetOneBlockTotalDIPReward(blockNumber uint64) (*hexutil.Big, error)
- func (api *DipperinMercuryApi) GetReMainRewardLockDIP(address common.Address, blockNumber uint64) (*hexutil.Big, error)
- func (api *DipperinMercuryApi) GetSlot(block model.AbstractBlock) *uint64
- func (api *DipperinMercuryApi) GetSyncStatus() bool
- func (api *DipperinMercuryApi) GetTransactionNonce(addr common.Address) (nonce uint64, err error)
- func (api *DipperinMercuryApi) GetVerifierDIPReward(blockNumber uint64) (map[economy_model.VerifierType]*hexutil.Big, error)
- func (api *DipperinMercuryApi) GetVerifierEDIPReward(blockNumber uint64, tokenDecimals int) (map[economy_model.VerifierType]*hexutil.Big, error)
- func (api *DipperinMercuryApi) GetVerifiersBySlot(slotNum uint64) ([]common.Address, error)
- func (api *DipperinMercuryApi) ListWallet() ([]accounts.WalletIdentifier, error)
- func (api *DipperinMercuryApi) ListWalletAccount(walletIdentifier accounts.WalletIdentifier) ([]accounts.Account, error)
- func (api *DipperinMercuryApi) NewBlock(ctx context.Context) (*rpc.Subscription, error)
- func (api *DipperinMercuryApi) NewSendTransactions(txs []model.Transaction) (int, error)
- func (api *DipperinMercuryApi) NewTransaction(transactionRlpB []byte) (TxHash common.Hash, err error)
- func (api *DipperinMercuryApi) OpenWallet(password string, walletIdentifier accounts.WalletIdentifier) error
- func (api *DipperinMercuryApi) RemoteHeight() uint64
- func (api *DipperinMercuryApi) RestoreWallet(password, mnemonic, passPhrase string, ...) error
- func (api *DipperinMercuryApi) SendCancelTransaction(from common.Address, fee *big.Int, nonce *uint64) (common.Hash, error)
- func (api *DipperinMercuryApi) SendEvidenceTransaction(from, target common.Address, fee *big.Int, voteA *model.VoteMsg, ...) (common.Hash, error)
- func (api *DipperinMercuryApi) SendRegisterTransaction(from common.Address, stake, fee *big.Int, nonce *uint64) (common.Hash, error)
- func (api *DipperinMercuryApi) SendTransaction(from, to common.Address, value, transactionFee *big.Int, data []byte, ...) (common.Hash, error)
- func (api *DipperinMercuryApi) SendTransactions(from common.Address, rpcTxs []model.RpcTransaction) (int, error)
- func (api *DipperinMercuryApi) SendUnStakeTransaction(from common.Address, fee *big.Int, nonce *uint64) (common.Hash, error)
- func (api *DipperinMercuryApi) SetBftSigner(address common.Address) error
- func (api *DipperinMercuryApi) SetMineCoinBase(addr common.Address) error
- func (api *DipperinMercuryApi) StartMine() error
- func (api *DipperinMercuryApi) StopDipperin()
- func (api *DipperinMercuryApi) StopMine() error
- func (api *DipperinMercuryApi) SubscribeBlock(ctx context.Context) (*rpc.Subscription, error)
- func (api *DipperinMercuryApi) Transaction(hash common.Hash) (resp *TransactionResp, err error)
- func (api *DipperinMercuryApi) VerifierStatus(address common.Address) (resp *VerifierStatus, err error)
- type DipperinP2PApi
- func (api *DipperinP2PApi) AddPeer(url string) error
- func (api *DipperinP2PApi) AddTrustedPeer(url string) error
- func (api *DipperinP2PApi) CsPmInfo() (*p2p.CsPmPeerInfo, error)
- func (api *DipperinP2PApi) Peers() ([]*p2p.PeerInfo, error)
- func (api *DipperinP2PApi) RemovePeer(url string) error
- func (api *DipperinP2PApi) RemoveTrustedPeer(url string) error
- type ERC20Resp
- type ElectionResp
- type ElectionStatus
- type GetElectionStatus
- type NewTransactionResp
- type P2PAPI
- type PeerInfoResp
- type SendTxReq
- type Service
- type TransactionResp
- type VerifierStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CurBalanceResp ¶
swagger:response CurBalanceResp
type CurStakeResp ¶
TODO please confirm with chuang, may use CurrBalanceResp swagger:response CurStakeResp
type DipperinDebugApi ¶
type DipperinDebugApi struct {
// contains filtered or unexported fields
}
func MakeDipperinDebugApi ¶
func MakeDipperinDebugApi(service debugAPI) *DipperinDebugApi
func (*DipperinDebugApi) Metrics ¶
func (api *DipperinDebugApi) Metrics(raw bool) (map[string]interface{}, error)
func (*DipperinDebugApi) PrintGos ¶
func (api *DipperinDebugApi) PrintGos()
type DipperinMercuryApi ¶
type DipperinMercuryApi struct {
// contains filtered or unexported fields
}
func MakeDipperinMercuryApi ¶
func MakeDipperinMercuryApi(service *service.MercuryFullChainService) *DipperinMercuryApi
func (*DipperinMercuryApi) AddAccount ¶
func (api *DipperinMercuryApi) AddAccount(derivationPath string, walletIdentifier accounts.WalletIdentifier) (accounts.Account, error)
wallet add account swagger:operation POST /url/AddAccount WalletOperation Wallet --- summary: wallet add account description: add account parameters:
- name: walletIdentifier in: body description: wallet identifier type: accounts.WalletIdentifier required: true
- name: derivationPath in: body description: the derived path type: string required: true
produces: - application/json responses:
"200": description: return the added account and the operation result
func (*DipperinMercuryApi) CheckBootNode ¶
func (api *DipperinMercuryApi) CheckBootNode() ([]string, error)
func (*DipperinMercuryApi) CloseWallet ¶
func (api *DipperinMercuryApi) CloseWallet(walletIdentifier accounts.WalletIdentifier) error
close wallet swagger:operation POST /url/CloseWallet WalletOperation Wallet --- summary: close wallet description: close wallet parameters:
- name: walletIdentifier in: body description: wallet identifier type: accounts.WalletIdentifier required: true
produces: - application/json responses:
"200": description: return operation result
func (*DipperinMercuryApi) CreateERC20 ¶
func (*DipperinMercuryApi) CurrentBalance ¶
func (api *DipperinMercuryApi) CurrentBalance(address common.Address) (resp *CurBalanceResp, err error)
get the current account balance swagger:operation POST /url/CurrentBalance account information CurBalanceResp --- summary: get all UTXO balances of current user description: get all UTXO balances of current user parameters:
- name: addresses in: body description: address type: []common.Address required: true
produces: - application/json responses:
"200": "$ref": "#/responses/CurBalanceResp"
func (*DipperinMercuryApi) CurrentBlock ¶
func (api *DipperinMercuryApi) CurrentBlock() (*BlockResp, error)
swagger:operation GET /url/CurrentBlock block information block --- summary: get the current block description: get the current block produces: - application/json responses:
"200": "$ref": "#/responses/BlockResp"
func (*DipperinMercuryApi) CurrentReputation ¶
func (api *DipperinMercuryApi) CurrentReputation(address common.Address) (uint64, error)
func (*DipperinMercuryApi) CurrentStake ¶
func (api *DipperinMercuryApi) CurrentStake(address common.Address) (resp *CurStakeResp, err error)
get address stake swagger:operation POST /url/CurrentStake stakeInfo stakeInfo --- summary: get address stake description: get address stake produces: - application/json responses:
"200": description: return address stake and the operation result
func (*DipperinMercuryApi) ERC20Allowance ¶
func (api *DipperinMercuryApi) ERC20Allowance(contractAddr, owner, spender common.Address) (interface{}, error)
func (*DipperinMercuryApi) ERC20Approve ¶
func (*DipperinMercuryApi) ERC20Balance ¶
func (api *DipperinMercuryApi) ERC20Balance(contractAddr, owner common.Address) (interface{}, error)
func (*DipperinMercuryApi) ERC20TotalSupply ¶
func (api *DipperinMercuryApi) ERC20TotalSupply(contractAddr common.Address) (interface{}, error)
func (*DipperinMercuryApi) ERC20Transfer ¶
func (*DipperinMercuryApi) ERC20TransferFrom ¶
func (*DipperinMercuryApi) EstablishWallet ¶
func (api *DipperinMercuryApi) EstablishWallet(password, passPhrase string, walletIdentifier accounts.WalletIdentifier) (mnemonic string, err error)
establish wallet swagger:operation POST /url/EstablishWallet WalletOperation Wallet --- summary: establish wallet description: establish wallet parameters:
- name: walletIdentifier in: body description: wallet identifier type: accounts.WalletIdentifier required: true
- name: password in: body description: wallet password type: string required: true
- name: passPhrase in: body description: wallet mnemonic passPhrase type: string required: true
produces: - application/json responses:
"200": description: return mnemonic and the operation result
func (*DipperinMercuryApi) GetAddressNonceFromWallet ¶
func (api *DipperinMercuryApi) GetAddressNonceFromWallet(address common.Address) (nonce uint64, err error)
get address nonce from wallet
func (*DipperinMercuryApi) GetBlockBody ¶
func (api *DipperinMercuryApi) GetBlockBody(hash common.Hash) *model.Body
consult block body by block hash swagger:operation POST /url/GetBlockBody block information block --- summary: consult block body by block hash description: consult block body by block hash parameters:
- name: hash in: body description: block hash type: common.Hash required: true
produces: - application/json responses:
"200": "$ref": "#/responses/Body"
func (*DipperinMercuryApi) GetBlockByHash ¶
func (api *DipperinMercuryApi) GetBlockByHash(hash common.Hash) (*BlockResp, error)
swagger:operation POST /url/GetBlockByHash block information block --- summary: get the block by block hash description: get the block by block hash parameters:
- name: hash in: body description: block hash type: common.Hash required: true
produces: - application/json responses:
"200": "$ref": "#/responses/BlockResp"
func (*DipperinMercuryApi) GetBlockByNumber ¶
func (api *DipperinMercuryApi) GetBlockByNumber(number uint64) (*BlockResp, error)
swagger:operation POST /url/GetBlockByNumber block information block --- summary: get the block by height description: get the block by height parameters:
- name: number in: body description: block height type: integer required: true
produces: - application/json responses:
"200": "$ref": "#/responses/BlockResp"
func (*DipperinMercuryApi) GetBlockDiffVerifierInfo ¶
func (api *DipperinMercuryApi) GetBlockDiffVerifierInfo(blockNumber uint64) (map[economy_model.VerifierType][]common.Address, error)
func (*DipperinMercuryApi) GetBlockNumber ¶
func (api *DipperinMercuryApi) GetBlockNumber(hash common.Hash) *uint64
swagger:operation POST /url/GetBlockNumber block information block --- summary: get the height of the block by block hash description: get block height by block hash parameters:
- name: hash in: body description: block hash type: common.Hash required: true
produces: - application/json responses:
"200": description: block height
func (*DipperinMercuryApi) GetBlockYear ¶
func (api *DipperinMercuryApi) GetBlockYear(blockNumber uint64) (uint64, error)
func (*DipperinMercuryApi) GetChainConfig ¶
func (api *DipperinMercuryApi) GetChainConfig() (conf chain_config.ChainConfig, err error)
func (*DipperinMercuryApi) GetContract ¶
func (api *DipperinMercuryApi) GetContract(contractAddr common.Address) (interface{}, error)
func (*DipperinMercuryApi) GetContractInfo ¶
func (api *DipperinMercuryApi) GetContractInfo(eData *contract.ExtraDataForContract) (interface{}, error)
func (*DipperinMercuryApi) GetCurVerifiers ¶
func (api *DipperinMercuryApi) GetCurVerifiers() []common.Address
get current verifiers swagger:operation POST /url/GetCurVerifiers verifierInfo verifierInfo --- summary: get current verifiers description: get current verifiers produces: - application/json responses:
"200": description: return verifier address list and the operation result
func (*DipperinMercuryApi) GetCurrentConnectPeers ¶
func (api *DipperinMercuryApi) GetCurrentConnectPeers() ([]PeerInfoResp, error)
get current practical verifiers
func (*DipperinMercuryApi) GetDeveloperInfo ¶
func (api *DipperinMercuryApi) GetDeveloperInfo() map[string]*hexutil.Big
func (*DipperinMercuryApi) GetDeveloperLockDIP ¶
func (*DipperinMercuryApi) GetEarlyTokenLockDIP ¶
func (*DipperinMercuryApi) GetFoundationInfo ¶
func (api *DipperinMercuryApi) GetFoundationInfo(usage economy_model.FoundationDIPUsage) map[string]*hexutil.Big
func (*DipperinMercuryApi) GetGenesis ¶
func (api *DipperinMercuryApi) GetGenesis() (*BlockResp, error)
get genesis block swagger:operation GET /url/GetGenesis block information block --- summary: get genesis block description: get genesis block produces: - application/json responses:
"200": "$ref": "#/responses/BlockResp"
func (*DipperinMercuryApi) GetInvestorInfo ¶
func (api *DipperinMercuryApi) GetInvestorInfo() map[string]*hexutil.Big
func (*DipperinMercuryApi) GetInvestorLockDIP ¶
func (*DipperinMercuryApi) GetMaintenanceLockDIP ¶
func (*DipperinMercuryApi) GetMineMasterDIPReward ¶
func (api *DipperinMercuryApi) GetMineMasterDIPReward(blockNumber uint64) (*hexutil.Big, error)
func (*DipperinMercuryApi) GetMineMasterEDIPReward ¶
func (*DipperinMercuryApi) GetNextVerifiers ¶
func (api *DipperinMercuryApi) GetNextVerifiers() []common.Address
get next verifiers swagger:operation POST /url/GetNextVerifiers verifierInfo verifierInfo --- summary: get next verifiers description: get next verifiers produces: - application/json responses:
"200": description: return verifier address list and the operation result
func (*DipperinMercuryApi) GetOneBlockTotalDIPReward ¶
func (api *DipperinMercuryApi) GetOneBlockTotalDIPReward(blockNumber uint64) (*hexutil.Big, error)
func (*DipperinMercuryApi) GetReMainRewardLockDIP ¶
func (*DipperinMercuryApi) GetSlot ¶
func (api *DipperinMercuryApi) GetSlot(block model.AbstractBlock) *uint64
func (*DipperinMercuryApi) GetSyncStatus ¶
func (api *DipperinMercuryApi) GetSyncStatus() bool
verify whether the chain is in sync
func (*DipperinMercuryApi) GetTransactionNonce ¶
func (api *DipperinMercuryApi) GetTransactionNonce(addr common.Address) (nonce uint64, err error)
get the nonce needed for the transaction: swagger:operation POST /url/Transaction transaction information Transaction --- summary: get the nonce needed for the transaction description: get the nonce needed for the transaction parameters:
- name: addr in: body description: address type: common.Address required: true
produces: - application/json responses:
"200": description: return nonce and the result
func (*DipperinMercuryApi) GetVerifierDIPReward ¶
func (api *DipperinMercuryApi) GetVerifierDIPReward(blockNumber uint64) (map[economy_model.VerifierType]*hexutil.Big, error)
func (*DipperinMercuryApi) GetVerifierEDIPReward ¶
func (*DipperinMercuryApi) GetVerifiersBySlot ¶
func (api *DipperinMercuryApi) GetVerifiersBySlot(slotNum uint64) ([]common.Address, error)
get verifiers info by round swagger:operation POST /url/GetVerifiersBySlot verifierInfo verifierInfo --- summary: get verifiers info by round description: get verifiers info by round parameters:
- name: slotNum in: body description: the round (slotNum = blockNumber/slotSize) type: uint64 required: true
produces: - application/json responses:
"200": description: return verifier address list and the operation result
func (*DipperinMercuryApi) ListWallet ¶
func (api *DipperinMercuryApi) ListWallet() ([]accounts.WalletIdentifier, error)
list wallet swagger:operation POST /url/ListWallet WalletOperation Wallet --- summary: list wallet description: list wallet produces: - application/json responses:
"200": description: return wallet identifier list and the operation result
func (*DipperinMercuryApi) ListWalletAccount ¶
func (api *DipperinMercuryApi) ListWalletAccount(walletIdentifier accounts.WalletIdentifier) ([]accounts.Account, error)
list wallet account swagger:operation POST /url/ListWalletAccount WalletOperation Wallet --- summary: list wallet account description: list wallet account parameters:
- name: walletIdentifier in: body description: wallet identifier type: accounts.WalletIdentifier required: true
produces: - application/json responses:
"200": description: return account list and the operation result
func (*DipperinMercuryApi) NewBlock ¶
func (api *DipperinMercuryApi) NewBlock(ctx context.Context) (*rpc.Subscription, error)
func (*DipperinMercuryApi) NewSendTransactions ¶
func (api *DipperinMercuryApi) NewSendTransactions(txs []model.Transaction) (int, error)
new send multiple-txs
func (*DipperinMercuryApi) NewTransaction ¶
func (api *DipperinMercuryApi) NewTransaction(transactionRlpB []byte) (TxHash common.Hash, err error)
create a new transaction Tx: swagger:operation POST /url/Transaction transaction information NewTransactionReq --- summary: create a new transaction Tx description: create a new transaction Tx parameters:
- name: tra in: body description: address type: model.Transaction required: true
produces: - application/json responses:
"200": description:return TxHash and the operation result
func (*DipperinMercuryApi) OpenWallet ¶
func (api *DipperinMercuryApi) OpenWallet(password string, walletIdentifier accounts.WalletIdentifier) error
open wallet swagger:operation POST /url/OpenWallet WalletOperation Wallet --- summary: open wallet description: open wallet parameters:
- name: walletIdentifier in: body description: wallet identifier type: accounts.WalletIdentifier required: true
- name: password in: body description: wallet password type: string required: true
produces: - application/json responses:
"200": description: return operation result
func (*DipperinMercuryApi) RemoteHeight ¶
func (api *DipperinMercuryApi) RemoteHeight() uint64
get remote node height
func (*DipperinMercuryApi) RestoreWallet ¶
func (api *DipperinMercuryApi) RestoreWallet(password, mnemonic, passPhrase string, walletIdentifier accounts.WalletIdentifier) error
restore wallet swagger:operation POST /url/RestoreWallet WalletOperation Wallet --- summary: restore wallet description: restore wallet parameters:
- name: walletIdentifier in: body description: wallet identifier type: accounts.WalletIdentifier required: true
- name: password in: body description: wallet password type: string required: true
- name: passPhrase in: body description: wallet mnemonic passPhrase type: string required: true
- name: mnemonic in: body description: wallet mnemonic type: string required: true
produces: - application/json responses:
"200": description: return operation result
func (*DipperinMercuryApi) SendCancelTransaction ¶
func (api *DipperinMercuryApi) SendCancelTransaction(from common.Address, fee *big.Int, nonce *uint64) (common.Hash, error)
send cancel transaction swagger:operation POST /url/SendCancelTransaction transactionOperation transaction --- summary: send cancel transaction description: send cancel transaction parameters:
- name: from in: body description: the address that send register transaction type: common.Address required: true
- name: fee in: body description: the transaction fee type: *big.Int required: true
produces: - application/json responses:
"200": description: return operation result
func (*DipperinMercuryApi) SendEvidenceTransaction ¶
func (api *DipperinMercuryApi) SendEvidenceTransaction(from, target common.Address, fee *big.Int, voteA *model.VoteMsg, voteB *model.VoteMsg, nonce *uint64) (common.Hash, error)
send evidence transaction swagger:operation POST /url/SendEvidenceTransaction transactionOperation transaction --- summary: send evidence transaction description: send evidence transaction parameters:
- name: from in: body description: the address that send register transaction type: common.Address required: true
- name: target in: body description: the report target type: common.Address required: true
- name: fee in: body description: the transaction fee type: *big.Int required: true
- name: voteA in: body description: the report evidence voteA type: *model.Verification required: true
- name: voteB in: body description: the report evidence voteB type: *model.Verification required: true
produces: - application/json responses:
"200": description: return operation result
func (*DipperinMercuryApi) SendRegisterTransaction ¶
func (api *DipperinMercuryApi) SendRegisterTransaction(from common.Address, stake, fee *big.Int, nonce *uint64) (common.Hash, error)
send register transaction swagger:operation POST /url/SendRegisterTransaction transactionOperation transaction --- summary: send register transaction description: send register transaction parameters:
- name: from in: body description: the address that send register transaction type: common.Address required: true
- name: stake in: body description: the register pledge type: *big.Int required: true
- name: fee in: body description: the transaction fee type: *big.Int required: true
produces: - application/json responses:
"200": description: return operation result
func (*DipperinMercuryApi) SendTransaction ¶
func (api *DipperinMercuryApi) SendTransaction(from, to common.Address, value, transactionFee *big.Int, data []byte, nonce *uint64) (common.Hash, error)
send transaction swagger:operation POST /url/SendTransaction transactionOperation transaction --- summary: send transaction description: send transaction parameters:
- name: from in: body description: the address that send coin type: common.Address required: true
- name: to in: body description: the address that receive coin type: common.Address required: true
- name: transactionFee in: body description: the transaction fee type: *big.Int required: true
- name: data in: body description: the transaction extra data type: []byte required: true
produces: - application/json responses:
"200": description: return operation result
func (*DipperinMercuryApi) SendTransactions ¶
func (api *DipperinMercuryApi) SendTransactions(from common.Address, rpcTxs []model.RpcTransaction) (int, error)
send multiple-txs
func (*DipperinMercuryApi) SendUnStakeTransaction ¶
func (api *DipperinMercuryApi) SendUnStakeTransaction(from common.Address, fee *big.Int, nonce *uint64) (common.Hash, error)
send unstake transaction swagger:operation POST /url/SendCancelTransaction transactionOperation transaction --- summary: send cancel transaction description: send cancel transaction parameters:
- name: from in: body description: the address that send register transaction type: common.Address required: true
- name: fee in: body description: the transaction fee type: *big.Int required: true
produces: - application/json responses:
"200": description: return operation result
func (*DipperinMercuryApi) SetBftSigner ¶
func (api *DipperinMercuryApi) SetBftSigner(address common.Address) error
set pbft account address swagger:operation POST /url/ListWalletAccount PbftAddressOperation pbftAddress --- summary: set pbft account address description: set pbft account address parameters:
- name: walletIdentifier in: body description: wallet identifier type: accounts.WalletIdentifier required: true
produces: - application/json responses:
"200": description: return account list and the operation result
func (*DipperinMercuryApi) SetMineCoinBase ¶
func (api *DipperinMercuryApi) SetMineCoinBase(addr common.Address) error
set mining address: swagger:operation POST /url/SetMineCoinBase mineOperation SetMineCoinBase --- summary: set mine CoinBase address description: set mine CoinBase address parameters:
- name: addr in: body description: address type: common.Address required: true
produces: - application/json responses:
"200": description: return the operation result
func (*DipperinMercuryApi) StartMine ¶
func (api *DipperinMercuryApi) StartMine() error
start mine: swagger:operation POST /url/StartMine mineOperation StartMine --- summary: start mine description: start mine produces: - application/json responses:
"200": description: return the operation result
func (*DipperinMercuryApi) StopDipperin ¶
func (api *DipperinMercuryApi) StopDipperin()
func (*DipperinMercuryApi) StopMine ¶
func (api *DipperinMercuryApi) StopMine() error
stop mine: swagger:operation POST /url/StopMine mineOperation StopMine --- summary: stop mine description: stop mine produces: - application/json responses:
"200": description: return the operation result
func (*DipperinMercuryApi) SubscribeBlock ¶
func (api *DipperinMercuryApi) SubscribeBlock(ctx context.Context) (*rpc.Subscription, error)
func (*DipperinMercuryApi) Transaction ¶
func (api *DipperinMercuryApi) Transaction(hash common.Hash) (resp *TransactionResp, err error)
fetch transaction data from TxID swagger:operation POST /url/Transaction transaction information TransactionReq --- summary: fetch transaction data, the height and block ID from TxID description: fetch transaction data, the height and block ID from TxID parameters:
- name: hash in: body description: transaction hash type: common.Hash required: true
produces: - application/json responses:
"200": "$ref": "#/responses/TransactionResp"
func (*DipperinMercuryApi) VerifierStatus ¶
func (api *DipperinMercuryApi) VerifierStatus(address common.Address) (resp *VerifierStatus, err error)
verifier status swagger:operation POST /url/VerifierStatus verifierInfo verifierInfo --- summary: verifier status description: verifier status produces: - application/json responses:
"200": description: return verifier status and the operation result
type DipperinP2PApi ¶
type DipperinP2PApi struct {
// contains filtered or unexported fields
}
func MakeDipperinP2PApi ¶
func MakeDipperinP2PApi(service P2PAPI) *DipperinP2PApi
func (*DipperinP2PApi) AddPeer ¶
func (api *DipperinP2PApi) AddPeer(url string) error
func (*DipperinP2PApi) AddTrustedPeer ¶
func (api *DipperinP2PApi) AddTrustedPeer(url string) error
func (*DipperinP2PApi) CsPmInfo ¶
func (api *DipperinP2PApi) CsPmInfo() (*p2p.CsPmPeerInfo, error)
func (*DipperinP2PApi) RemovePeer ¶
func (api *DipperinP2PApi) RemovePeer(url string) error
func (*DipperinP2PApi) RemoveTrustedPeer ¶
func (api *DipperinP2PApi) RemoveTrustedPeer(url string) error
type ElectionResp ¶
Election resp
type ElectionStatus ¶
type ElectionStatus int
const ( WaitPackaged ElectionStatus = iota Packaged Invalid )
type GetElectionStatus ¶
type GetElectionStatus struct { ElectionStatus VerifierRound uint64 }
get election status resp
type NewTransactionResp ¶
swagger:response NewTransactionResp
type PeerInfoResp ¶
current practical verifiers resp
type SendTxReq ¶
type SendTxReq struct {
Tx *model.Transaction `json:"tx"`
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func MakeRpcService ¶
type TransactionResp ¶
type TransactionResp struct { Transaction *model.Transaction `json:"transaction"` BlockHash common.Hash `json:"blockHash"` BlockNumber uint64 `json:"blockNumber"` TxIndex uint64 `json:"transactionIndex"` }
swagger:response TransactionResp