Documentation ¶
Index ¶
- Constants
- Variables
- type Config
- type Context
- func (c *Context) GetAddressFromPath() (common.Address, error)
- func (c *Context) GetAmountFromForm() (*big.Int, error)
- func (c *Context) GetBlockNumberFromPath() (uint64, error)
- func (c *Context) GetConfirmationSignatureFromForm() (types.Signature, error)
- func (c *Context) GetExitedFromForm() (bool, error)
- func (c *Context) GetOwnerAddressFromForm() (common.Address, error)
- func (c *Context) GetTxFromForm() (*types.Tx, error)
- func (c *Context) GetTxInPositionFromPath() (types.Position, error)
- func (c *Context) GetTxOutPositionFromPath() (types.Position, error)
- func (c *Context) GetTxPositionFromPath() (types.Position, error)
- func (c *Context) JSONError(err error) error
- func (c *Context) JSONSuccess(result interface{}) error
- type DB
- type DBConfig
- type Error
- type HandlerFunc
- type HeartbeatConfig
- type Heartbeater
- type OperatorConfig
- type Plasma
- func (p *Plasma) Add(method, path string, h HandlerFunc, m ...echo.MiddlewareFunc)
- func (p *Plasma) Finalize()
- func (p *Plasma) GET(path string, h HandlerFunc, m ...echo.MiddlewareFunc)
- func (p *Plasma) GetAddressUTXOsHandler(c *Context) error
- func (p *Plasma) GetBlockHandler(c *Context) error
- func (p *Plasma) GetTxHandler(c *Context) error
- func (p *Plasma) GetTxProofHandler(c *Context) error
- func (p *Plasma) Logger() echo.Logger
- func (p *Plasma) POST(path string, h HandlerFunc, m ...echo.MiddlewareFunc)
- func (p *Plasma) PUT(path string, h HandlerFunc, m ...echo.MiddlewareFunc)
- func (p *Plasma) PingHandler(c *Context) error
- func (p *Plasma) PostBlockHandler(c *Context) error
- func (p *Plasma) PostDepositHandler(c *Context) error
- func (p *Plasma) PostTxHandler(c *Context) error
- func (p *Plasma) PutTxInHandler(c *Context) error
- func (p *Plasma) PutTxOutHandler(c *Context) error
- func (p *Plasma) Shutdown(ctx context.Context) error
- func (p *Plasma) Start() error
- type Response
Constants ¶
View Source
const ( PathParamErrorCode = 20001 FormParamErrorCode = 20002 )
View Source
const ( ResponseStateSuccess = "success" ResponseStateError = "error" )
Variables ¶
View Source
var ( ErrUnexpected = NewError(10000, "unexpected error") ErrBlockchainNotSynchronized = NewError(10001, "blockchain is not synchronized") ErrMempoolFull = NewError(11001, core.ErrMempoolFull.Error()) ErrBlockNotFound = NewError(11002, core.ErrBlockNotFound.Error()) ErrEmptyBlock = NewError(11003, core.ErrEmptyBlock.Error()) ErrTxNotFound = NewError(11004, core.ErrTxNotFound.Error()) ErrInvalidTxSignature = NewError(11005, core.ErrInvalidTxSignature.Error()) ErrInvalidTxConfirmationSignature = NewError(11006, core.ErrInvalidTxConfirmationSignature.Error()) ErrInvalidTxBalance = NewError(11007, core.ErrInvalidTxBalance.Error()) ErrTxInNotFound = NewError(11008, core.ErrTxInNotFound.Error()) ErrInvalidTxIn = NewError(11009, core.ErrInvalidTxIn.Error()) ErrNullTxInConfirmation = NewError(11010, core.ErrNullTxInConfirmation.Error()) ErrTxOutNotFound = NewError(11011, core.ErrTxOutNotFound.Error()) ErrTxOutAlreadySpent = NewError(11012, core.ErrTxOutAlreadySpent.Error()) ErrTxOutAlreadyExited = NewError(11013, core.ErrTxOutAlreadyExited.Error()) )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Port int `json:"port"` DB DBConfig `json:"db"` Operator OperatorConfig `json:"operator"` RootChain core.RootChainConfig `json:"rootchain"` Heartbeat HeartbeatConfig `json:"heartbeat"` }
type Context ¶
func NewContext ¶
func (*Context) GetAmountFromForm ¶ added in v0.3.0
func (*Context) GetBlockNumberFromPath ¶
func (*Context) GetConfirmationSignatureFromForm ¶
func (*Context) GetExitedFromForm ¶ added in v0.4.0
func (*Context) GetOwnerAddressFromForm ¶ added in v0.3.0
func (*Context) GetTxInPositionFromPath ¶
func (*Context) GetTxOutPositionFromPath ¶ added in v0.4.0
func (*Context) GetTxPositionFromPath ¶
func (*Context) JSONSuccess ¶
type Error ¶
type HandlerFunc ¶
type HeartbeatConfig ¶ added in v0.3.0
type Heartbeater ¶ added in v0.3.0
type Heartbeater struct {
// contains filtered or unexported fields
}
func NewHeartbeater ¶ added in v0.3.0
func NewHeartbeater(beatFunc func() error) (*Heartbeater, error)
func (*Heartbeater) Beat ¶ added in v0.3.0
func (h *Heartbeater) Beat() (bool, error)
func (*Heartbeater) Stop ¶ added in v0.3.0
func (h *Heartbeater) Stop()
type OperatorConfig ¶
type OperatorConfig struct {
PrivateKeyStr string `json:"privkey"`
}
func (OperatorConfig) PrivateKey ¶
func (conf OperatorConfig) PrivateKey() (*ecdsa.PrivateKey, error)
type Plasma ¶
type Plasma struct {
// contains filtered or unexported fields
}
func (*Plasma) Add ¶
func (p *Plasma) Add(method, path string, h HandlerFunc, m ...echo.MiddlewareFunc)
func (*Plasma) GET ¶
func (p *Plasma) GET(path string, h HandlerFunc, m ...echo.MiddlewareFunc)
func (*Plasma) GetAddressUTXOsHandler ¶
func (*Plasma) GetBlockHandler ¶
func (*Plasma) GetTxHandler ¶
func (*Plasma) GetTxProofHandler ¶
func (*Plasma) POST ¶
func (p *Plasma) POST(path string, h HandlerFunc, m ...echo.MiddlewareFunc)
func (*Plasma) PUT ¶
func (p *Plasma) PUT(path string, h HandlerFunc, m ...echo.MiddlewareFunc)
func (*Plasma) PingHandler ¶
func (*Plasma) PostBlockHandler ¶
TODO: can be executed by only the operator
func (*Plasma) PostDepositHandler ¶ added in v0.3.0
TODO: can be executed by only the operator
func (*Plasma) PostTxHandler ¶
func (*Plasma) PutTxInHandler ¶
func (*Plasma) PutTxOutHandler ¶ added in v0.4.0
TODO: can be executed by only the operator
type Response ¶
type Response struct { State string `json:"state"` Result interface{} `json:"result"` }
func NewErrorResponse ¶
func NewSuccessResponse ¶
func NewSuccessResponse(result interface{}) *Response
Click to show internal directories.
Click to hide internal directories.