chain

package
v1.777.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainChainmakerClient

type ChainChainmakerClient struct {
	ChainConfig    *ChainConfig `json:"chain_config"`
	ContractName   string       `json:"contract_name"`
	ContractMethod string       `json:"contract_method"`
	Data           string       `json:"data"`
	TxId           string       `json:"txId"`
}

func (*ChainChainmakerClient) Commit

func (client *ChainChainmakerClient) Commit(data string, lang string) (string, string, string, error)

func (*ChainChainmakerClient) Query

func (client *ChainChainmakerClient) Query(txId string, data string, lang string) (string, error)

type ChainClientInterface

type ChainClientInterface interface {
	Commit(data string, lang string) (string, string, string, error)
	Query(txId string, data string, lang string) (string, error)
}

func NewChainClient

func NewChainClient(providerType string, clientId string, clientSecret string, region string, networkId string, chainId string, endponit string, text string, UserKey string, UserCert string, SignKey string, SignCert string, ContractName string, ContractMethod string, lang string) (ChainClientInterface, error)

type ChainConfig

type ChainConfig struct {
	ChainId            string `json:"chain_id"`
	OrgId              string `json:"org_id"`
	AuthType           string `json:"auth_type"`
	UserKey            string `json:"user_key"`
	UserCert           string `json:"user_cert"`
	SignKey            string `json:"sign_key"`
	SignCert           string `json:"sign_cert"`
	NodeAddr           string `json:"node_addr"`
	ChainmakerEndpoint string `json:"chainmaker_endpoint"`
}

type ChainTencentChainmakerClient

type ChainTencentChainmakerClient struct {
	ClientId     string
	ClientSecret string
	Region       string
	NetworkId    string
	ChainId      string
	Client       *tbaas.Client
}

func (*ChainTencentChainmakerClient) Commit

func (client *ChainTencentChainmakerClient) Commit(data string, lang string) (string, string, string, error)

func (ChainTencentChainmakerClient) Query

func (client ChainTencentChainmakerClient) Query(blockId string, data string, lang string) (string, error)

type ChainTencentChainmakerDemoClient

type ChainTencentChainmakerDemoClient struct {
	ClientId     string
	ClientSecret string
	Region       string
	NetworkId    string
	ChainId      string
	Client       *tbaas.Client
}

func (*ChainTencentChainmakerDemoClient) Commit

func (client *ChainTencentChainmakerDemoClient) Commit(data string, lang string) (string, string, string, error)

func (ChainTencentChainmakerDemoClient) Query

func (client ChainTencentChainmakerDemoClient) Query(txId string, data string, lang string) (string, error)

type ChainmakerResponse

type ChainmakerResponse struct {
	TxId      string `json:"tx_id"`
	Result    string `json:"result"`
	Block     string `json:"block"`
	BlockHash string `json:"block_hash"`
}

func SendChainmakerRequest

func SendChainmakerRequest(info *ChainChainmakerClient, method string, lang string) (*ChainmakerResponse, error)

type EthereumClient

type EthereumClient struct {
	Client          *ethclient.Client
	PrivateKey      *ecdsa.PrivateKey
	FromAddress     common.Address
	ContractAddress common.Address
	ContractMethod  string
}

func (*EthereumClient) Commit

func (client *EthereumClient) Commit(data string, lang string) (string, string, string, error)

Commit sends a transaction to the Ethereum network to invoke a contract method with the provided data.

func (*EthereumClient) Query

func (client *EthereumClient) Query(txHash string, data string, lang string) (string, error)

Query retrieves the transaction receipt and decodes the event logs to get the data.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL