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 NewRegTx(rand string, index int, admin, issuer *Account) *transaction.Transaction
- func RegistDbftService(d *dbft.DbftService)
- func RegistRpcNode(n Noder)
- func SetDefaultFunc(def func(http.ResponseWriter, *http.Request))
- func SignTx(admin *Account, tx *transaction.Transaction)
- func StartRPCServer()
- func VerifyAndSendTx(txn *tx.Transaction) ErrCode
- type AmountMap
- type BalanceTxInputInfo
- type BlockHead
- type BlockInfo
- type BookKeepingInfo
- type BookkeeperInfo
- type ConsensusInfo
- type DataFileInfo
- type DeployCodeInfo
- type FunctionCodeInfo
- type IssuerInfo
- type LockAssetInfo
- type NodeInfo
- type PayloadInfo
- type PrivacyPayloadInfo
- 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 (
ASSETPREFIX = "STC"
)
View Source
const (
LocalHost = "127.0.0.1"
)
View Source
const (
RANDBYTELEN = 4
)
Variables ¶
View Source
var ( STCRpcInvalidHash = responsePacking("invalid hash") STCRpcInvalidBlock = responsePacking("invalid block") STCRpcInvalidTransaction = responsePacking("invalid transaction") STCRpcInvalidParameter = responsePacking("invalid parameter") STCRpcUnknownBlock = responsePacking("unknown block") STCRpcUnknownTransaction = responsePacking("unknown transaction") STCRpcNil = responsePacking(nil) STCRpcUnsupported = responsePacking("Unsupported") STCRpcInternalError = responsePacking("internal error") STCRpcIOError = responsePacking("internal IO error") STCRpcAPIError = responsePacking("internal API error") STCRpcSuccess = responsePacking(true) STCRpcFailed = responsePacking(false) // error code for wallet STCRpcWalletAlreadyExists = responsePacking("wallet already exist") STCRpcWalletNotExists = responsePacking("wallet doesn't exist") STCRpc = responsePacking )
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 NewRegTx ¶
func NewRegTx(rand string, index int, admin, issuer *Account) *transaction.Transaction
func RegistDbftService ¶
func RegistDbftService(d *dbft.DbftService)
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 SignTx ¶
func SignTx(admin *Account, tx *transaction.Transaction)
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 }
type BookKeepingInfo ¶
type BookKeepingInfo struct {
Nonce uint64
}
implement PayloadInfo define BookKeepingInfo
type BookkeeperInfo ¶
type BookkeeperInfo struct { PubKey string Action string Issuer IssuerInfo Controller string }
type ConsensusInfo ¶
type ConsensusInfo struct { }
type DataFileInfo ¶
type DataFileInfo struct { IPFSPath string Filename string Note string Issuer IssuerInfo }
type DeployCodeInfo ¶
type FunctionCodeInfo ¶
implement PayloadInfo define DeployCodeInfo
type IssuerInfo ¶
type IssuerInfo struct {
X, Y string
}
type LockAssetInfo ¶
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 PrivacyPayloadInfo ¶
type ProgramInfo ¶
type RecordInfo ¶
type RegisterAssetInfo ¶
type RegisterAssetInfo struct { Asset *asset.Asset Amount string Issuer IssuerInfo Controller string }
implement PayloadInfo define RegisterAssetInfo
type Transactions ¶
type Transactions struct { TxType tx.TransactionType PayloadVersion byte Payload PayloadInfo Attributes []TxAttributeInfo UTXOInputs []UTXOTxInputInfo BalanceInputs []BalanceTxInputInfo Outputs []TxoutputInfo Programs []ProgramInfo AssetOutputs []TxoutputMap AssetInputAmount []AmountMap AssetOutputAmount []AmountMap Hash string }
func TransArryByteToHexString ¶
func TransArryByteToHexString(ptx *tx.Transaction) *Transactions
type TxAttributeInfo ¶
type TxAttributeInfo struct { Usage tx.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 }
type UTXOTxInputInfo ¶
Click to show internal directories.
Click to hide internal directories.