Documentation
¶
Overview ¶
Copyright © 2019 Annchain Authors <EMAIL ADDRESS>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2019 Annchain Authors <EMAIL ADDRESS>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2019 Annchain Authors <EMAIL ADDRESS>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2019 Annchain Authors <EMAIL ADDRESS>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- func Response(c *gin.Context, status int, err error, data interface{})
- type AutoTxClient
- type Consensus
- type Monitor
- type NewAccountRequest
- type NewQueryContractReq
- type NewTxRequest
- type NodeStatus
- type Peer
- type ReceiptResponse
- type RpcController
- func (r *RpcController) AutoTx(c *gin.Context)
- func (r *RpcController) ConStatus(c *gin.Context)
- func (r *RpcController) Confirm(c *gin.Context)
- func (r *RpcController) ContractPayload(c *gin.Context)
- func (r *RpcController) Debug(c *gin.Context)
- func (r *RpcController) DebugCallerCall(setvalue string) error
- func (r *RpcController) DebugCallerCreate() error
- func (r *RpcController) DebugCreateContract() error
- func (r *RpcController) DebugCreateTxAndSendToBuffer(from, to types.Address, value *math.BigInt, data []byte, nonce uint64) error
- func (r *RpcController) DebugQueryContract() ([]byte, error)
- func (r *RpcController) DebugSetContract(n string) error
- func (r *RpcController) Genesis(c *gin.Context)
- func (r *RpcController) Monitor(c *gin.Context)
- func (r *RpcController) NetInfo(c *gin.Context)
- func (r *RpcController) NewAccount(c *gin.Context)
- func (r *RpcController) NewTransaction(c *gin.Context)
- func (rpc *RpcController) Newrouter() *gin.Engine
- func (r *RpcController) OgPeersInfo(c *gin.Context)
- func (r *RpcController) PeersInfo(c *gin.Context)
- func (r *RpcController) Performance(c *gin.Context)
- func (r *RpcController) Query(c *gin.Context)
- func (r *RpcController) QueryBalance(c *gin.Context)
- func (r *RpcController) QueryContract(c *gin.Context)
- func (r *RpcController) QueryNonce(c *gin.Context)
- func (r *RpcController) QueryReceipt(c *gin.Context)
- func (r *RpcController) QueryShare(c *gin.Context)
- func (r *RpcController) Sequencer(c *gin.Context)
- func (r *RpcController) Status(c *gin.Context)
- func (r *RpcController) SyncStatus(c *gin.Context)
- func (r *RpcController) Tps(c *gin.Context)
- func (r *RpcController) Transaction(c *gin.Context)
- func (r *RpcController) Transactions(c *gin.Context)
- func (r *RpcController) Validator(c *gin.Context)
- type RpcServer
- type SequenceRequester
- type SyncStatus
- type Tps
- type TxRequester
Constants ¶
const ShutdownTimeoutSeconds = 5
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AutoTxClient ¶
type AutoTxClient interface {
SetTxIntervalUs(i int)
}
type NewAccountRequest ¶
type NewAccountRequest struct {
Algorithm string `json:"algorithm"`
}
NewAccountRequest for RPC request
type NewQueryContractReq ¶
type NewTxRequest ¶
type NewTxRequest struct {
Nonce string `json:"nonce"`
From string `json:"from"`
To string `json:"to"`
Value string `json:"value"`
Data string `json:"data"`
CryptoType string `json:"crypto_type"`
Signature string `json:"signature"`
Pubkey string `json:"pubkey"`
}
NewTxrequest for RPC request
type NodeStatus ¶
type NodeStatus struct {
NodeInfo *p2p.NodeInfo `json:"node_info"`
PeersInfo []*p2p.PeerInfo `json:"peers_info"`
}
NodeStatus
type ReceiptResponse ¶
type RpcController ¶
type RpcController struct {
P2pServer *p2p.Server
Og *og.Og
TxBuffer *og.TxBuffer
TxCreator *og.TxCreator
SyncerManager *syncer.SyncManager
PerformanceMonitor *performance.PerformanceMonitor
AutoTxCli AutoTxClient
NewRequestChan chan types.TxBaseType
AnnSensus *annsensus.AnnSensus
}
func (*RpcController) AutoTx ¶
func (r *RpcController) AutoTx(c *gin.Context)
func (*RpcController) ConStatus ¶
func (r *RpcController) ConStatus(c *gin.Context)
func (*RpcController) Confirm ¶
func (r *RpcController) Confirm(c *gin.Context)
Confirm checks if tx has already been confirmed.
func (*RpcController) ContractPayload ¶
func (r *RpcController) ContractPayload(c *gin.Context)
func (*RpcController) Debug ¶
func (r *RpcController) Debug(c *gin.Context)
func (*RpcController) DebugCallerCall ¶
func (r *RpcController) DebugCallerCall(setvalue string) error
func (*RpcController) DebugCallerCreate ¶
func (r *RpcController) DebugCallerCreate() error
func (*RpcController) DebugCreateContract ¶
func (r *RpcController) DebugCreateContract() error
func (*RpcController) DebugCreateTxAndSendToBuffer ¶
func (*RpcController) DebugQueryContract ¶
func (r *RpcController) DebugQueryContract() ([]byte, error)
func (*RpcController) DebugSetContract ¶
func (r *RpcController) DebugSetContract(n string) error
func (*RpcController) Genesis ¶
func (r *RpcController) Genesis(c *gin.Context)
func (*RpcController) Monitor ¶
func (r *RpcController) Monitor(c *gin.Context)
func (*RpcController) NetInfo ¶
func (r *RpcController) NetInfo(c *gin.Context)
PeersInfo network information
func (*RpcController) NewAccount ¶
func (r *RpcController) NewAccount(c *gin.Context)
func (*RpcController) NewTransaction ¶
func (r *RpcController) NewTransaction(c *gin.Context)
func (*RpcController) Newrouter ¶
func (rpc *RpcController) Newrouter() *gin.Engine
func (*RpcController) OgPeersInfo ¶
func (r *RpcController) OgPeersInfo(c *gin.Context)
func (*RpcController) PeersInfo ¶
func (r *RpcController) PeersInfo(c *gin.Context)
PeersInfo peers information
func (*RpcController) Performance ¶
func (r *RpcController) Performance(c *gin.Context)
func (*RpcController) QueryBalance ¶
func (r *RpcController) QueryBalance(c *gin.Context)
func (*RpcController) QueryContract ¶
func (r *RpcController) QueryContract(c *gin.Context)
func (*RpcController) QueryNonce ¶
func (r *RpcController) QueryNonce(c *gin.Context)
func (*RpcController) QueryReceipt ¶
func (r *RpcController) QueryReceipt(c *gin.Context)
func (*RpcController) QueryShare ¶
func (r *RpcController) QueryShare(c *gin.Context)
func (*RpcController) Sequencer ¶
func (r *RpcController) Sequencer(c *gin.Context)
func (*RpcController) SyncStatus ¶
func (r *RpcController) SyncStatus(c *gin.Context)
Status node status
func (*RpcController) Tps ¶
func (r *RpcController) Tps(c *gin.Context)
func (*RpcController) Transaction ¶
func (r *RpcController) Transaction(c *gin.Context)
Transaction get transaction
func (*RpcController) Transactions ¶
func (r *RpcController) Transactions(c *gin.Context)
Transactions query Transactions
func (*RpcController) Validator ¶
func (r *RpcController) Validator(c *gin.Context)
type RpcServer ¶
type RpcServer struct {
C *RpcController
// contains filtered or unexported fields
}
func NewRpcServer ¶
type SyncStatus ¶
type SyncStatus struct {
Id string `json:"id"`
SyncMode string `json:"syncMode"`
CatchupSyncerStatus string `json:"catchupSyncerStatus"`
CatchupSyncerEnabled bool `json:"catchupSyncerEnabled"`
IncrementalSyncerEnabled bool `json:"incrementalSyncerEnabled"`
Height uint64 `json:"height"`
LatestHeight uint64 `json:"latestHeight"`
BestPeer string `json:"bestPeer"`
Error string `json:"error"`
Txid uint32 `json:"txid"`
}