outchain

package
v0.0.0-...-84a2c7a Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2020 License: GPL-3.0, GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	Ada{
		Btc: BTC{
			NetID:        1,
			Host:         "localhost:18332",
			RPCUser:      "test",
			RPCPasswd:    "123456",
			CertPath:     "/home/pallet/wallet/btc/btctest/rpc.cert",
			WalletPasswd: "1",
		},
		Eth: ETH{
			NetID:      0,
			Rawurl:     "https://mainnet.infura.io/",
			TxQueryUrl: "http://api-cn.etherscan.com/api?apikey=VYSBPQ383RJXM7HBQVTIK5NGIG8ZYVV6T6",
		},
		ChainKeyKV: map[string]KeyInfo{
			"btc": {
				ChaincodeKeys: map[string][]byte{},
				AddressKeys:   map[string][]byte{},
			},
			"eth": {
				ChaincodeKeys: map[string][]byte{},
				AddressKeys:   map[string][]byte{},
			},
		},
	},
}

Functions

func GetBTCAdaptor

func GetBTCAdaptor() adaptor.ICryptoCurrency

func GetConfigTest

func GetConfigTest() error

func GetERC20Adaptor

func GetERC20Adaptor() adaptor.ICryptoCurrency

func GetETHAdaptor

func GetETHAdaptor() adaptor.ICryptoCurrency

func GetJuryAddr

func GetJuryAddr(chaincodeID string, chainName string, params []byte) (string, error)

func GetJuryAddress

func GetJuryAddress(chaincode, chainName string, params []byte, iadaptor adaptor.ICryptoCurrency) (string, error)

func GetJuryKeyInfo

func GetJuryKeyInfo(chaincode, chainName string, params []byte, iadaptor adaptor.ICryptoCurrency) ([]byte, error)

func GetJuryPubkey

func GetJuryPubkey(chaincodeID string, chainName string, params []byte) (string, error)

func ProcessOutChainCall

func ProcessOutChainCall(chaincodeID string, outChainCall *pb.OutChainCall) (result string, err error)

func SignMessage

func SignMessage(chaincodeID string, chainName string, params []byte) (string, error)

func SignTransaction

func SignTransaction(chaincodeID string, chainName string, params []byte) (string, error)

Types

type Ada

type Ada struct {
	Btc        BTC
	Eth        ETH
	ChainKeyKV map[string]KeyInfo //chainName --- keyInfo
}

type BTC

type BTC struct {
	NetID        int
	Host         string
	RPCUser      string
	RPCPasswd    string
	CertPath     string
	WalletPasswd string
}

type CCInfo

type CCInfo struct {
	CCName      string
	ChainCodeKV map[string][]byte
}

type Callback

type Callback func() adaptor.ICryptoCurrency

type CallbackExcpet

type CallbackExcpet func(chaincodeID, chainName string, params []byte) (string, error)

type Config

type Config struct {
	Ada
}

type ETH

type ETH struct {
	NetID      int
	Rawurl     string
	TxQueryUrl string
}

type KeyInfo

type KeyInfo struct {
	ChaincodeKeys map[string][]byte //chaincode --- privateKey
	AddressKeys   map[string][]byte //address --- privateKey
}

type OutChainMethod

type OutChainMethod struct {
	Method string `json:"method"`
}

Jump to

Keyboard shortcuts

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