Documentation
¶
Index ¶
- Constants
- type CacheProtoContract
- func (pc *CacheProtoContract) CallFunc(funcName string, args ...any) (any, error)
- func (pc *CacheProtoContract) ClaimOrder(ctx context.Context, orderId [32]byte) error
- func (pc *CacheProtoContract) ClaimWorkReward(ctx context.Context, nodeAcc common.Address) (string, error)
- func (pc *CacheProtoContract) ClaimWorkRewardServer(ctx context.Context, nodeAcc common.Address) error
- func (pc *CacheProtoContract) CreateCacheOrder(ctx context.Context, teeAcc common.Address, traffic string) (string, error)
- func (pc *CacheProtoContract) ExitNetwork(ctx context.Context, nodeAcc common.Address) error
- func (pc *CacheProtoContract) QueryCacheOrder(orderId [32]byte) (Order, error)
- func (pc *CacheProtoContract) QueryCdnL1NodeByIndex(index int64) (common.Address, error)
- func (pc *CacheProtoContract) QueryCurrencyTerm() (*big.Int, error)
- func (pc *CacheProtoContract) QueryNodeReward(nodeAcc common.Address) (string, error)
- func (pc *CacheProtoContract) QueryRegisterInfo(nodeAcc common.Address) (NodeInfo, error)
- func (pc *CacheProtoContract) RegisterNode(ctx context.Context, req RegisterReq) error
- func (pc *CacheProtoContract) Signature(data []byte) ([]byte, error)
- func (pc *CacheProtoContract) VerifySign(hash []byte, sign []byte) bool
- type Client
- func (cli *Client) AddWorkContract(name string, contract Contract)
- func (cli Client) GetContractAddress(name string) Contract
- func (cli Client) GetEthClient() *ethclient.Client
- func (cli Client) GetPrivateKey() ecdsa.PrivateKey
- func (cli Client) GetSignature(data []byte) ([]byte, error)
- func (cli Client) NewTransactionOption(ctx context.Context, value string) (*bind.TransactOpts, error)
- func (cli Client) ParsingTransactionLogs(ctx context.Context, tx *types.Transaction, callback func(types.Log) bool) error
- func (cli Client) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, callback func(types.Log) bool) error
- func (cli *Client) UpdateClient() error
- func (cli Client) VerifySign(data []byte, sign []byte) bool
- type Contract
- type LogFilter
- type NewTransactionOption
- type NodeInfo
- type Option
- type Order
- type RegisterReq
Constants ¶
View Source
const (
CACHE_PRICE = "1192092895"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheProtoContract ¶
type CacheProtoContract struct { Address common.Address Node common.Address NewOption NewTransactionOption LogFilter LogFilter[ethereum.FilterQuery] CacheProto *contract.CacheProto // contains filtered or unexported fields }
func NewProtoContract ¶
func NewProtoContract(cli *ethclient.Client, hexAddr, nodeSk string, optFunc NewTransactionOption, filter LogFilter[ethereum.FilterQuery]) (*CacheProtoContract, error)
func (*CacheProtoContract) CallFunc ¶
func (pc *CacheProtoContract) CallFunc(funcName string, args ...any) (any, error)
func (*CacheProtoContract) ClaimOrder ¶
func (pc *CacheProtoContract) ClaimOrder(ctx context.Context, orderId [32]byte) error
func (*CacheProtoContract) ClaimWorkReward ¶
func (*CacheProtoContract) ClaimWorkRewardServer ¶
func (*CacheProtoContract) CreateCacheOrder ¶
func (*CacheProtoContract) ExitNetwork ¶
func (*CacheProtoContract) QueryCacheOrder ¶
func (pc *CacheProtoContract) QueryCacheOrder(orderId [32]byte) (Order, error)
func (*CacheProtoContract) QueryCdnL1NodeByIndex ¶
func (pc *CacheProtoContract) QueryCdnL1NodeByIndex(index int64) (common.Address, error)
func (*CacheProtoContract) QueryCurrencyTerm ¶
func (pc *CacheProtoContract) QueryCurrencyTerm() (*big.Int, error)
func (*CacheProtoContract) QueryNodeReward ¶
func (pc *CacheProtoContract) QueryNodeReward(nodeAcc common.Address) (string, error)
func (*CacheProtoContract) QueryRegisterInfo ¶
func (pc *CacheProtoContract) QueryRegisterInfo(nodeAcc common.Address) (NodeInfo, error)
func (*CacheProtoContract) RegisterNode ¶
func (pc *CacheProtoContract) RegisterNode(ctx context.Context, req RegisterReq) error
func (*CacheProtoContract) Signature ¶
func (pc *CacheProtoContract) Signature(data []byte) ([]byte, error)
func (*CacheProtoContract) VerifySign ¶
func (pc *CacheProtoContract) VerifySign(hash []byte, sign []byte) bool
type Client ¶
type Client struct { RpcAddrs []string ChainID int64 GasFeeCap *big.Int GasLimit uint64 Account common.Address Contracts map[string]Contract // contains filtered or unexported fields }
func (*Client) AddWorkContract ¶
func (Client) GetContractAddress ¶
func (Client) GetEthClient ¶
func (Client) GetPrivateKey ¶
func (cli Client) GetPrivateKey() ecdsa.PrivateKey
func (Client) NewTransactionOption ¶
func (Client) ParsingTransactionLogs ¶
func (Client) SubscribeFilterLogs ¶
func (*Client) UpdateClient ¶
type NewTransactionOption ¶
type Option ¶
func AccountPrivateKey ¶
func ConnectionRpcAddresss ¶
func EthereumGas ¶
func NodeEthAccount ¶
Click to show internal directories.
Click to hide internal directories.