Documentation
¶
Index ¶
- Variables
- func AddAmtStr(base string, amts ...string) string
- func AdvanceBlock() error
- func AdvanceBlocks(blockCount uint64) error
- func AdvanceBlocksUntilDone(done chan bool)
- func CreateAccountsWithBalance(num int, amount string) ([]string, []string, error)
- func DialWebApiClient(target string) (*grpc.ClientConn, rpc.WebApiClient, error)
- func FundAccountsWithErc20(erc20Addr string, addrs []string, amount string) error
- func FundAddr(amt string, recipients []*common.Address) error
- func GetAddressFromKeystore(ksBytes []byte) (common.Address, error)
- func GetNextClientPort() string
- func KillProcess(process *os.Process)
- func RegisterRouters(ksfiles []string) error
- func SetEnvDir(dir string)
- func SetOutRootDir(dir string)
- func StartProcess(name string, args ...string) *os.Process
- func UnregisterRouter(ksfile string, registryAddr string) error
- func UpdateShadowStorage(storeDir, shadowDir string)
- type ClientController
- func StartC1WithoutProxy(keystorePath string, extraArgs ...string) (*ClientController, error)
- func StartC2WithoutProxy(keystorePath string, extraArgs ...string) (*ClientController, error)
- func StartClientController(listenPort string, keystorePath string, configPath string, dataPath string, ...) (*ClientController, error)
- func StartClientWithoutProxy(keystorePath string, profileFileName string, clientID string, ...) (*ClientController, error)
- func (cc *ClientController) ApplyAppChannelAction(cid string, action []byte) error
- func (cc *ClientController) AssertBalance(tokenAddr string, expectedFree string, expectedLocked string, ...) error
- func (cc *ClientController) ConfirmBooleanPay(paymentID string) error
- func (cc *ClientController) ConfirmOnChainResolvedPays(tokenType entity.TokenType, tokenAddr string) error
- func (cc *ClientController) ConfirmSettlePaymentChannel(tokenType entity.TokenType, tokenAddr string) error
- func (cc *ClientController) ConfirmWithdraw(tokenType entity.TokenType, tokenAddr string) error
- func (cc *ClientController) CooperativeWithdraw(tokenType entity.TokenType, tokenAddr string, withdrawAmount string) (*rpc.DepositOrWithdrawJob, error)
- func (cc *ClientController) CooperativeWithdrawNonBlocking(tokenType entity.TokenType, tokenAddr string, withdrawAmount string) (*rpc.DepositOrWithdrawJob, error)
- func (cc *ClientController) DeleteAppChannel(cid string) error
- func (cc *ClientController) Deposit(tokenType entity.TokenType, tokenAddr, amt string) (*rpc.DepositOrWithdrawJob, error)
- func (cc *ClientController) DepositNonBlocking(tokenType entity.TokenType, tokenAddr, amt string) (*rpc.DepositOrWithdrawJob, error)
- func (cc *ClientController) FinalizeAppChannelOnActionTimeout(cid string) error
- func (cc *ClientController) GetAccountBalance(tokenAddr string, ownerAddr string, conn *ethclient.Client) (*big.Int, error)
- func (cc *ClientController) GetAppChannelActionDeadline(cid string) (uint64, error)
- func (cc *ClientController) GetAppChannelBooleanOutcome(cid string, query []byte) (bool, bool, error)
- func (cc *ClientController) GetAppChannelSettleFinalizedTime(cid string) (uint64, error)
- func (cc *ClientController) GetAppChannelState(cid string, key int64) ([]byte, error)
- func (cc *ClientController) GetBalance(tokenAddress string) (string, string, string, error)
- func (cc *ClientController) GetCurrentBlockNumber() (uint64, error)
- func (cc *ClientController) GetIncomingPaymentInfo(paymentID string) (*rpc.PaymentInfo, error)
- func (cc *ClientController) GetIncomingPaymentStatus(paymentID string) (int, error)
- func (cc *ClientController) GetOutgoingPaymentStatus(paymentID string) (int, error)
- func (cc *ClientController) GetPayHistory(fromStart bool, itemsPerPage int32) ([]*msgrpc.OneHistoricalPay, bool, error)
- func (cc *ClientController) GetSettleFinalizedTime(tokenType entity.TokenType, tokenAddr string) (uint64, error)
- func (cc *ClientController) InstantiateChannel(tokenType entity.TokenType, tokenAddr string) (*rpc.ChannelID, error)
- func (cc *ClientController) IntendSettlePaymentChannel(tokenType entity.TokenType, tokenAddr string) error
- func (cc *ClientController) IntendWithdraw(tokenType entity.TokenType, tokenAddr string, withdrawAmount string) error
- func (cc *ClientController) IsConnectedToCeler(tokenAddress string, address string) (string, error)
- func (cc *ClientController) Kill()
- func (cc *ClientController) KillAndRemoveDB()
- func (cc *ClientController) KillWithoutRemovingKeystore()
- func (cc *ClientController) MonitorCooperativeWithdrawJob(jobID string) (*rpc.DepositOrWithdrawJob, error)
- func (cc *ClientController) MonitorDepositJob(jobID string) (*rpc.DepositOrWithdrawJob, error)
- func (cc *ClientController) NewAppChannelOnDeployedContract(contractAddress string, nonce uint64, participants []string, timeout uint64) (string, error)
- func (cc *ClientController) NewAppChannelOnVirtualContract(byteCode []byte, constructor []byte, nonce uint64, timeout uint64) (string, error)
- func (cc *ClientController) OpenChannel(selfAddress string, tokenType entity.TokenType, tokenAddr string, ...) (*rpc.ChannelID, error)
- func (cc *ClientController) RejectBooleanPay(paymentID string) error
- func (cc *ClientController) RunSQL(q string) ([]byte, error)
- func (cc *ClientController) SendPayment(destination string, amountWei string, tokenType entity.TokenType, ...) (string, error)
- func (cc *ClientController) SendPaymentWithBooleanConditions(destination string, amountWei string, tokenType entity.TokenType, ...) (string, error)
- func (cc *ClientController) SetDelegation(tokens []string, duration int64) error
- func (cc *ClientController) SetMsgDropper(dropRecv, dropSend bool) error
- func (cc *ClientController) SettleAppChannel(cid string, stateproof []byte) error
- func (cc *ClientController) SettleAppChannelByInvalidState(cid string, oracleProof []byte, cosignedStateProof []byte) error
- func (cc *ClientController) SettleAppChannelByInvalidTurn(cid string, oracleProof []byte, cosignedStateProof []byte) error
- func (cc *ClientController) SettleAppChannelByMoveTimeout(cid string, oracleProof []byte) error
- func (cc *ClientController) SettleAppChannelBySigTimeout(cid string, oracleProof []byte) error
- func (cc *ClientController) SettleConditionalPayOnChain(paymentID string) (string, uint64, error)
- func (cc *ClientController) SettleExpiredPays(tokenType entity.TokenType, tokenAddr string) error
- func (cc *ClientController) SettleOnChainResolvedPay(paymentID string) error
- func (cc *ClientController) SignData(data []byte) ([]byte, error)
- func (cc *ClientController) SignOutgoingState(sessionID string, state []byte) ([]byte, error)
- func (cc *ClientController) SubscribeIncomingPayments(paymentChan chan string) error
- func (cc *ClientController) SubscribeOutgoingPayments(completeChan chan string, errChan chan string) error
- func (cc *ClientController) SyncOnChainChannelStates(tokenType entity.TokenType, tokenAddr string) error
- func (cc *ClientController) TcbOpenChannel(selfAddress string, tokenType entity.TokenType, tokenAddr string, ...) (*rpc.ChannelID, error)
- func (cc *ClientController) WaitUntilDeadline(deadline uint64) error
- type ServerController
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // e2eProfile after deploy contracts, with hardcoded ethgw etc // serialized json will be saved as outRootDir/profile.json // tests wish to use a different profile can overrides fields like svrRpc // and keep contract addresses etc E2eProfile *profile.ProfileJSON )
Functions ¶
func AdvanceBlock ¶
func AdvanceBlock() error
func AdvanceBlocks ¶
func AdvanceBlocksUntilDone ¶
func AdvanceBlocksUntilDone(done chan bool)
func CreateAccountsWithBalance ¶
CreateAccountsWithBalance creates Ethereum accounts with balances.
func DialWebApiClient ¶ added in v1.1.1
func DialWebApiClient(target string) (*grpc.ClientConn, rpc.WebApiClient, error)
func FundAccountsWithErc20 ¶
func GetNextClientPort ¶
func GetNextClientPort() string
func KillProcess ¶
func RegisterRouters ¶
func SetOutRootDir ¶
func SetOutRootDir(dir string)
func UnregisterRouter ¶
func UpdateShadowStorage ¶
func UpdateShadowStorage(storeDir, shadowDir string)
UpdateShadowStorage updates the shadow directory for database storage
Types ¶
type ClientController ¶
type ClientController struct {
// contains filtered or unexported fields
}
func StartC1WithoutProxy ¶
func StartC1WithoutProxy( keystorePath string, extraArgs ...string) (*ClientController, error)
func StartC2WithoutProxy ¶
func StartC2WithoutProxy( keystorePath string, extraArgs ...string) (*ClientController, error)
func StartClientController ¶
func StartClientWithoutProxy ¶
func (*ClientController) ApplyAppChannelAction ¶
func (cc *ClientController) ApplyAppChannelAction(cid string, action []byte) error
func (*ClientController) AssertBalance ¶
func (*ClientController) ConfirmBooleanPay ¶
func (cc *ClientController) ConfirmBooleanPay(paymentID string) error
func (*ClientController) ConfirmOnChainResolvedPays ¶
func (cc *ClientController) ConfirmOnChainResolvedPays( tokenType entity.TokenType, tokenAddr string) error
func (*ClientController) ConfirmSettlePaymentChannel ¶
func (cc *ClientController) ConfirmSettlePaymentChannel( tokenType entity.TokenType, tokenAddr string) error
func (*ClientController) ConfirmWithdraw ¶
func (cc *ClientController) ConfirmWithdraw( tokenType entity.TokenType, tokenAddr string) error
func (*ClientController) CooperativeWithdraw ¶
func (cc *ClientController) CooperativeWithdraw( tokenType entity.TokenType, tokenAddr string, withdrawAmount string) (*rpc.DepositOrWithdrawJob, error)
func (*ClientController) CooperativeWithdrawNonBlocking ¶
func (cc *ClientController) CooperativeWithdrawNonBlocking( tokenType entity.TokenType, tokenAddr string, withdrawAmount string) (*rpc.DepositOrWithdrawJob, error)
func (*ClientController) DeleteAppChannel ¶
func (cc *ClientController) DeleteAppChannel(cid string) error
func (*ClientController) Deposit ¶
func (cc *ClientController) Deposit( tokenType entity.TokenType, tokenAddr, amt string) (*rpc.DepositOrWithdrawJob, error)
func (*ClientController) DepositNonBlocking ¶
func (cc *ClientController) DepositNonBlocking( tokenType entity.TokenType, tokenAddr, amt string) (*rpc.DepositOrWithdrawJob, error)
func (*ClientController) FinalizeAppChannelOnActionTimeout ¶
func (cc *ClientController) FinalizeAppChannelOnActionTimeout(cid string) error
func (*ClientController) GetAccountBalance ¶
func (*ClientController) GetAppChannelActionDeadline ¶
func (cc *ClientController) GetAppChannelActionDeadline(cid string) (uint64, error)
func (*ClientController) GetAppChannelBooleanOutcome ¶
func (*ClientController) GetAppChannelSettleFinalizedTime ¶
func (cc *ClientController) GetAppChannelSettleFinalizedTime(cid string) (uint64, error)
func (*ClientController) GetAppChannelState ¶
func (cc *ClientController) GetAppChannelState(cid string, key int64) ([]byte, error)
func (*ClientController) GetBalance ¶
func (*ClientController) GetCurrentBlockNumber ¶
func (cc *ClientController) GetCurrentBlockNumber() (uint64, error)
func (*ClientController) GetIncomingPaymentInfo ¶ added in v1.1.0
func (cc *ClientController) GetIncomingPaymentInfo(paymentID string) (*rpc.PaymentInfo, error)
func (*ClientController) GetIncomingPaymentStatus ¶
func (cc *ClientController) GetIncomingPaymentStatus(paymentID string) (int, error)
func (*ClientController) GetOutgoingPaymentStatus ¶
func (cc *ClientController) GetOutgoingPaymentStatus(paymentID string) (int, error)
func (*ClientController) GetPayHistory ¶
func (cc *ClientController) GetPayHistory(fromStart bool, itemsPerPage int32) ([]*msgrpc.OneHistoricalPay, bool, error)
GetPayHistory returns paginated historical pays. The returned boolean is true if there is more result to fetch.
func (*ClientController) GetSettleFinalizedTime ¶
func (*ClientController) InstantiateChannel ¶
func (*ClientController) IntendSettlePaymentChannel ¶
func (cc *ClientController) IntendSettlePaymentChannel( tokenType entity.TokenType, tokenAddr string) error
func (*ClientController) IntendWithdraw ¶
func (*ClientController) IsConnectedToCeler ¶
func (cc *ClientController) IsConnectedToCeler( tokenAddress string, address string) (string, error)
func (*ClientController) Kill ¶
func (cc *ClientController) Kill()
func (*ClientController) KillAndRemoveDB ¶
func (cc *ClientController) KillAndRemoveDB()
KillAndRemoveDB kill process and delete the dataPath/xxxx folder keystore is kept so we can test same eth start from scratch case Note this depends on cnode/kvstore init logic that creates eth address folder
func (*ClientController) KillWithoutRemovingKeystore ¶
func (cc *ClientController) KillWithoutRemovingKeystore()
func (*ClientController) MonitorCooperativeWithdrawJob ¶
func (cc *ClientController) MonitorCooperativeWithdrawJob(jobID string) (*rpc.DepositOrWithdrawJob, error)
func (*ClientController) MonitorDepositJob ¶
func (cc *ClientController) MonitorDepositJob(jobID string) (*rpc.DepositOrWithdrawJob, error)
func (*ClientController) NewAppChannelOnDeployedContract ¶
func (*ClientController) NewAppChannelOnVirtualContract ¶
func (*ClientController) OpenChannel ¶
func (*ClientController) RejectBooleanPay ¶
func (cc *ClientController) RejectBooleanPay(paymentID string) error
func (*ClientController) RunSQL ¶
func (cc *ClientController) RunSQL(q string) ([]byte, error)
RunSQL calls sqlite3 query directly on db file q needs to quote args properly
func (*ClientController) SendPayment ¶
func (*ClientController) SendPaymentWithBooleanConditions ¶
func (*ClientController) SetDelegation ¶
func (cc *ClientController) SetDelegation(tokens []string, duration int64) error
func (*ClientController) SetMsgDropper ¶
func (cc *ClientController) SetMsgDropper(dropRecv, dropSend bool) error
func (*ClientController) SettleAppChannel ¶
func (cc *ClientController) SettleAppChannel(cid string, stateproof []byte) error
func (*ClientController) SettleAppChannelByInvalidState ¶
func (cc *ClientController) SettleAppChannelByInvalidState(cid string, oracleProof []byte, cosignedStateProof []byte) error
func (*ClientController) SettleAppChannelByInvalidTurn ¶
func (cc *ClientController) SettleAppChannelByInvalidTurn(cid string, oracleProof []byte, cosignedStateProof []byte) error
func (*ClientController) SettleAppChannelByMoveTimeout ¶
func (cc *ClientController) SettleAppChannelByMoveTimeout(cid string, oracleProof []byte) error
func (*ClientController) SettleAppChannelBySigTimeout ¶
func (cc *ClientController) SettleAppChannelBySigTimeout(cid string, oracleProof []byte) error
func (*ClientController) SettleConditionalPayOnChain ¶
func (cc *ClientController) SettleConditionalPayOnChain(paymentID string) (string, uint64, error)
func (*ClientController) SettleExpiredPays ¶
func (cc *ClientController) SettleExpiredPays(tokenType entity.TokenType, tokenAddr string) error
func (*ClientController) SettleOnChainResolvedPay ¶
func (cc *ClientController) SettleOnChainResolvedPay(paymentID string) error
func (*ClientController) SignData ¶
func (cc *ClientController) SignData(data []byte) ([]byte, error)
func (*ClientController) SignOutgoingState ¶
func (cc *ClientController) SignOutgoingState(sessionID string, state []byte) ([]byte, error)
func (*ClientController) SubscribeIncomingPayments ¶
func (cc *ClientController) SubscribeIncomingPayments(paymentChan chan string) error
func (*ClientController) SubscribeOutgoingPayments ¶
func (cc *ClientController) SubscribeOutgoingPayments( completeChan chan string, errChan chan string) error
func (*ClientController) SyncOnChainChannelStates ¶
func (cc *ClientController) SyncOnChainChannelStates(tokenType entity.TokenType, tokenAddr string) error
func (*ClientController) TcbOpenChannel ¶
func (*ClientController) WaitUntilDeadline ¶
func (cc *ClientController) WaitUntilDeadline(deadline uint64) error
type ServerController ¶
type ServerController struct {
// contains filtered or unexported fields
}
func StartServerController ¶
func StartServerController(path string, args ...string) *ServerController
note address isn't used
func (*ServerController) Kill ¶
func (sc *ServerController) Kill() error
Click to show internal directories.
Click to hide internal directories.