evmsdk

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: GPL-3.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VERSION            = ""
	EngineStateRunning = "running"
	EngineStateStopped = "stopped"

	RequestPath = ""
	ConfigPath  = "evm"
	LogFile     = "vertification_debug_log.txt"
)

Variables

View Source
var (
	IS_DEBUG = true
)

Functions

func BackgroundLoop

func BackgroundLoop() string

func BlsPublicKey

func BlsPublicKey(privKey string) (interface{}, error)

func BlsSign

func BlsSign(privKey, msg string) (interface{}, error)

func BlsTest

func BlsTest() string

func Emit

func Emit(jsonText string) string

func GetAppPath

func GetAppPath() string

func GetJson

func GetJson() string

func GetNetInfos

func GetNetInfos() string

func GetTime

func GetTime() int64

func GetWebSocketConnect

func GetWebSocketConnect() string

func ReadTouchedFile

func ReadTouchedFile() string

func RunLoop

func RunLoop() string

func Test

func Test() string

func TouchFile

func TouchFile() string

Types

type AccountReward

type AccountReward struct {
	Account string
	Number  *uint256.Int
	Value   *uint256.Int
}

type AccountRewards

type AccountRewards []*AccountReward

func (AccountRewards) Len

func (r AccountRewards) Len() int

func (AccountRewards) Less

func (r AccountRewards) Less(i, j int) bool

func (AccountRewards) Swap

func (r AccountRewards) Swap(i, j int)

type AggSign

type AggSign struct {
	Number    uint64            `json:"number"`
	StateRoot commTyp.Hash      `json:"stateRoot"`
	Sign      commTyp.Signature `json:"sign"`
	PublicKey commTyp.PublicKey `json:"publicKey"`
	Address   commTyp.Address   `json:"address"`
}

type EmitRequest

type EmitRequest struct {
	Typ string      `json:"type"`
	Val interface{} `json:"val"`
}

type EmitResponse

type EmitResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

type EvmEngine

type EvmEngine struct {
	Account     string      `json:"account"`
	AppBasePath string      `json:"app_base_path"`
	EngineState string      `json:"state"`
	BlockChan   chan string `json:"-"`
	PrivKey     string      `json:"priv_key"`
	ServerUri   string      `json:"server_uri"`
	LogLevel    string      `json:"log_level"`
	// contains filtered or unexported fields
}
var EE *EvmEngine = &EvmEngine{}

func (*EvmEngine) BlsPublicKey

func (e *EvmEngine) BlsPublicKey(req interface{}) (interface{}, error)

func (*EvmEngine) BlsSign

func (e *EvmEngine) BlsSign(req interface{}) (interface{}, error)

func (*EvmEngine) Decrypt

func (e *EvmEngine) Decrypt(req *EmitRequest) (interface{}, error)

func (*EvmEngine) Encrypt

func (e *EvmEngine) Encrypt(req *EmitRequest) (interface{}, error)

func (*EvmEngine) List

func (e *EvmEngine) List() (interface{}, error)

func (*EvmEngine) ReloadFile

func (e *EvmEngine) ReloadFile() error

func (*EvmEngine) SaveFile

func (e *EvmEngine) SaveFile() error

func (*EvmEngine) Setting

func (e *EvmEngine) Setting(req *EmitRequest) error
{
	"type":"setting",
	"val":{
		"app_base_path":"/sd/0/evm/",
		"account":"abcdef1234"
	}
}

func (*EvmEngine) Start

func (e *EvmEngine) Start() error

func (*EvmEngine) State

func (e *EvmEngine) State() string

func (*EvmEngine) Stop

func (e *EvmEngine) Stop() error

type InnerError

type InnerError struct {
	Code int
	Msg  string
}

func (InnerError) Error

func (i InnerError) Error() string

type JSONRPCRequest

type JSONRPCRequest struct {
	JsonRpc string                 `json:"jsonrpc"`
	Method  string                 `json:"method"`
	ID      int                    `json:"id"`
	Params  []json.RawMessage      `json:"params"`
	Error   map[string]interface{} `json:"error"`
}

type Setting

type Setting struct {
	Height      int
	AppBasePath string
	Account     string

	PrivKey string
}

type WebSocketService

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

func NewWebSocketService

func NewWebSocketService(addr, acc string) (*WebSocketService, error)

func (*WebSocketService) Chans

func (ws *WebSocketService) Chans(pubk string) (<-chan []byte, chan<- []byte, error)

Jump to

Keyboard shortcuts

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