Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterRoute ¶
RegisterRouter register a router on instance of fiber for proxy request to eznode and send response to user it registers a route with prefix which it accepts request and routes it to eznode for example: RegisterRoute(app, e, "/test-eznode", logrus.DebugLevel), it does register `/test-eznode/:chainId` on fiber app instance. request can be sent to desired chain with this route for example: GET `/test-eznode/ethereum` IMPORTANT NOTE: chainId is what you set in your eznode instance
func StartFiber ¶
StartFiber start a fiber app with a port to listen on default routes:
- ANY `/:chainId`: route to connect to eznode with chainId, you request to your specific node with the chainId which you have set in the eznode instance. for example: GET `/ethereum` IMPORTANT NOTE: chainId is what you set in your eznode instance
- POST `/manage/disable-node`: disable a node, accept DisableNodeRequest as body
- POST `/manage/enable-node`: enable a node, accept EnableNodeRequest as body
Types ¶
type DisableNodeRequest ¶
type DisableNodeRequest struct { ChainId string `json:"chain_id"` NodeName string `json:"node_name"` WithTime int `json:"with_time"` }
DisableNodeRequest disable node request body
type EnableNodeRequest ¶
type EnableNodeRequest struct { ChainId string `json:"chain_id"` NodeName string `json:"node_name"` }
EnableNodeRequest enable node request body
Click to show internal directories.
Click to hide internal directories.