reapapis

package
v0.2.14 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FromBegining = -2
	ToEnd        = -1
)
View Source
const GovernanceAddress = "0xe10f734218c24be1d64864c25f3ae2f1d45ceda8"

테스트용 Account Address.

Variables

This section is empty.

Functions

func Deserialize

func Deserialize(stream string, into *ProxyCall) error

func GetNonceTransaction

func GetNonceTransaction(client *rpc.Client, account common.Address, blockNumber *big.Int) (uint64, error)

blockchain, pending area에서 nonce 값을 비교하여 큰 값을 가져 온다. todo 이 함수도 ethclient.go에 비슷한 기능이 함수가 있음

func IsWritable

func IsWritable(path string) (isWritable bool, err error)

func NewHttpRpc

func NewHttpRpc(endpoint string) (*rpcApi, error)

ex) NewHttpRpc("http://192.168.0.15:8541")

func NewKafkaClient

func NewKafkaClient(brokers []string, topic string, procCallBack func(message kafka.Message) bool) *kafkaClient

변수 초기화.

func PublishTransaction

func PublishTransaction(client *rpc.Client, tx *types.Transaction) error

todo 이 함수도 ethclient.go에 비슷한 기능이 함수가 있음

func TransactionReceipt

func TransactionReceipt(client *rpc.Client, txHash common.Hash) (*types.Receipt, error)

Types

type Account

type Account struct {
	// contains filtered or unexported fields
}

func NewImportAccount

func NewImportAccount() *Account

func (*Account) Account

func (g *Account) Account() accounts.Account

func (*Account) Import

func (g *Account) Import(path string) error

Account private key가 keystore import 한다. ex) /node/keystore/UTC--2020-11..... 일 경우, Import("/node")

func (*Account) SignTx

func (g *Account) SignTx(tx *types.Transaction, chainID *big.Int) (*types.Transaction, error)

Account 계정으로 Tx를 sign 한다.

func (*Account) SignTxWithPassphrase

func (g *Account) SignTxWithPassphrase(tx *types.Transaction, passphrase string, chainID *big.Int) (*types.Transaction, error)

Account 계정으로 Tx를 sign한다. 패스워드 값필요.

type Config

type Config struct {
	Scanner `yaml:"scanner"`
	Proxy   `yaml:"proxy"`
}

func LoadConfigFile

func LoadConfigFile(ABSPath string) (Config, error)

type DB

type DB struct {
	Ip      string `yaml:"ip"`
	Port    string `yaml:"port"`
	Account string `yaml:"account"`
	Passwd  string `yaml:"passwd"`
	DBname  string `yaml:"dbname"`
}

type MiddleBooks

type MiddleBooks struct {
	// contains filtered or unexported fields
}

func NewMiddleBooks

func NewMiddleBooks() *MiddleBooks

func (*MiddleBooks) Create

func (m *MiddleBooks) Create(id string) (accounts.Account, error)

H/L의 계정(id)에 매칭되는 Reapchain 계정을 생성. 생성 후, 장부(Books)에 기록함.

func (*MiddleBooks) CreateMiddleBooks

func (m *MiddleBooks) CreateMiddleBooks(path string) error

H/L의 계정을 이용하여 랜덤계정을 생성, private key들을 저장할 서버 디렉토리 지정한다.

func (*MiddleBooks) Find

func (m *MiddleBooks) Find(id string) (accounts.Account, bool)

H/L의 계정(id)에 매칭되는 Reapchain 계정리턴 함

type Proxy

type Proxy struct {
	Local      ProxyInfo `yaml:"local,omitempty"`
	Test       ProxyInfo `yaml:"test,omitempty"`
	Production ProxyInfo `yaml:"production,omitempty"`
}

type ProxyCall

type ProxyCall struct {
	Guid    ProxyCallGuid `json:"gid"`
	Service string        `json:"service,omitempty"`
	Call    string        `json:"call"`
	Account string        `json:"account"`
	Value   uint          `json:"value,omitempty"`
	To      string        `json:"to,omitempty"`
}

func (*ProxyCall) Serialize

func (s *ProxyCall) Serialize() []byte

type ProxyCallGuid

type ProxyCallGuid struct {
	Category string `json:"category"` //iot|did|...
}

type ProxyInfo

type ProxyInfo struct {
	Ratio      float32 `yaml:"ratio"`
	Governance string  `yaml:"governance,omitempty"`
	Kafka      struct {
		Address string `yaml:"address"`
		Topic   string `yaml:"topic"`
	} `yaml:"kafka"`
	Node struct {
		RpcAddress string `yaml:"rpcaddress"`
	} `yaml:"node"`
}

type Scanner

type Scanner struct {
	Local      DB `yaml:"local,omitempty"`
	Test       DB `yaml:"test,omitempty"`
	Production DB `yaml:"production,omitempty"`
}

Jump to

Keyboard shortcuts

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