Documentation ¶
Index ¶
- Constants
- Variables
- func AddFileIPFS(filepath string, useCluster bool) (string, error)
- func Call(address string, method string, id interface{}, params []interface{}) ([]byte, error)
- func GetFileIPFS(ref, outPath string) error
- func Handle(w http.ResponseWriter, r *http.Request)
- func HandleFunc(pattern string, handler func([]interface{}) map[string]interface{})
- func RegistPowService(p *pow.PowService)
- func RegistRpcNode(n Noder)
- func SetDefaultFunc(def func(http.ResponseWriter, *http.Request))
- func StartRPCServer()
- func VerifyAndSendTx(txn *tx.Transaction) ErrCode
- type AmountMap
- type BalanceTxInputInfo
- type BlockHead
- type BlockInfo
- type CoinbaseInfo
- type ConsensusInfo
- type DeployCodeInfo
- type FunctionCodeInfo
- type NodeInfo
- type PayloadInfo
- type ProgramInfo
- type RecordInfo
- type RegisterAssetInfo
- type ServeMux
- type Transactions
- type TxAttributeInfo
- type TxInfo
- type TxoutInfo
- type TxoutputInfo
- type TxoutputMap
- type UTXOTxInputInfo
Constants ¶
View Source
const (
AUXBLOCK_GENERATED_INTERVAL_SECONDS = 60
)
Variables ¶
View Source
var ( DnaRpcInvalidHash = responsePacking("invalid hash") DnaRpcInvalidBlock = responsePacking("invalid block") DnaRpcInvalidTransaction = responsePacking("invalid transaction") DnaRpcInvalidParameter = responsePacking("invalid parameter") DnaRpcUnknownBlock = responsePacking("unknown block") DnaRpcUnknownTransaction = responsePacking("unknown transaction") DnaRpcNil = responsePacking(nil) DnaRpcUnsupported = responsePacking("Unsupported") DnaRpcInternalError = responsePacking("internal error") DnaRpcIOError = responsePacking("internal IO error") DnaRpcAPIError = responsePacking("internal API error") DnaRpcSuccess = responsePacking(true) DnaRpcFailed = responsePacking(false) // error code for wallet DnaRpcWalletAlreadyExists = responsePacking("wallet already exist") DnaRpcWalletNotExists = responsePacking("wallet doesn't exist") DnaRpc = responsePacking )
View Source
var Pow *pow.PowService
View Source
var PreChainHeight uint64
View Source
var PreTime int64
View Source
var PreTransactionCount int
View Source
var Wallet account.Client
Functions ¶
func GetFileIPFS ¶
func Handle ¶
func Handle(w http.ResponseWriter, r *http.Request)
this is the funciton that should be called in order to answer an rpc call should be registered like "http.HandleFunc("/", httpjsonrpc.Handle)"
func HandleFunc ¶
a function to register functions to be called for specific rpc calls
func RegistPowService ¶
func RegistPowService(p *pow.PowService)
func RegistRpcNode ¶
func RegistRpcNode(n Noder)
func SetDefaultFunc ¶
func SetDefaultFunc(def func(http.ResponseWriter, *http.Request))
a function to be called if the request is not a HTTP JSON RPC call
func StartRPCServer ¶
func StartRPCServer()
func VerifyAndSendTx ¶
func VerifyAndSendTx(txn *tx.Transaction) ErrCode
Types ¶
type BalanceTxInputInfo ¶
type BlockInfo ¶
type BlockInfo struct { Hash string BlockData *BlockHead Transactions []*Transactions Confirminations uint32 MinerInfo string }
type CoinbaseInfo ¶
type CoinbaseInfo struct {
CoinbaseData string
}
type ConsensusInfo ¶
type ConsensusInfo struct { }
type DeployCodeInfo ¶
type FunctionCodeInfo ¶
type NodeInfo ¶
type NodeInfo struct { State uint // node status Port uint16 // The nodes's port ID uint64 // The nodes's id Time int64 Version uint32 // The network protocol the node used Services uint64 // The services the node supplied Relay bool // The relay capability of the node (merge into capbility flag) Height uint64 // The node latest block height TxnCnt uint64 // The transactions be transmit by this node RxTxnCnt uint64 // The transaction received by this node }
type PayloadInfo ¶
type PayloadInfo interface{}
func TransPayloadToHex ¶
func TransPayloadToHex(p Payload) PayloadInfo
type ProgramInfo ¶
type RecordInfo ¶
type RegisterAssetInfo ¶
type Transactions ¶
type Transactions struct { TxType TransactionType PayloadVersion byte Payload PayloadInfo Attributes []TxAttributeInfo UTXOInputs []UTXOTxInputInfo BalanceInputs []BalanceTxInputInfo Outputs []TxoutputInfo LockTime uint32 Programs []ProgramInfo AssetOutputs []TxoutputMap AssetInputAmount []AmountMap AssetOutputAmount []AmountMap Timestamp uint32 `json:",omitempty"` Confirminations uint32 `json:",omitempty"` TxSize uint32 `json:",omitempty"` Hash string }
func TransArryByteToHexString ¶
func TransArryByteToHexString(ptx *tx.Transaction) *Transactions
type TxAttributeInfo ¶
type TxAttributeInfo struct { Usage TransactionAttributeUsage Data string }
type TxInfo ¶
type TxInfo struct { Hash string Hex string Tx *Transactions }
type TxoutputInfo ¶
type TxoutputMap ¶
type TxoutputMap struct { Key Uint256 Txout []TxoutputInfo }
Click to show internal directories.
Click to hide internal directories.