rpc

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2019 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SystemAccountPriKey, _ = crypto.HexToECDSA("289c2857d4598e37fb9647507e47a309d6133539bf21a8b9cb6df88fd5232032")
	SystemAccountPubKey    = common.HexToPubKey("0x047db227d7094ce215c3a0f57e1bcc732551fe351f94249471934567e0f5dc1bf795962b8cccb87a2eb56b29fbe37d614e2f4c3c45b789ae4f1f51f4cb21972ffd")
	Gaslimit               = uint64(2000000)
	SystemAccount          = "ftsystemio"
	Minernonce             = uint64(0)
	MaxTxNumInTxpool       = 40960 + 4096
)

Functions

func AccountIsExist

func AccountIsExist(accountName string) (bool, error)

func ClientCall

func ClientCall(method string, result interface{}, args ...interface{}) error

ClientCall Wrapper rpc call api.

func CreateNewAccountWithName

func CreateNewAccountWithName(fromAccount string, fromPriKey *ecdsa.PrivateKey, newAccountName string) (error, common.PubKey, *ecdsa.PrivateKey)

func DefaultDataDir

func DefaultDataDir() string

defaultDataDir is the default data directory to use for the databases and other persistence requirements.

func DefultURL

func DefultURL() string

DefultURL default rpc url

func DelayGetReceiptByTxHash

func DelayGetReceiptByTxHash(txHash common.Hash, maxTime uint) (*types.RPCReceipt, bool, error)

func GasPrice

func GasPrice() (*big.Int, error)

GasPrice suggest gas price

func GenerateAccountName

func GenerateAccountName(namePrefix string, addStrLen int) string

func GenerateAssetName

func GenerateAssetName(namePrefix string, addStrLen int) string

func GeneratePubKey

func GeneratePubKey() (common.PubKey, *ecdsa.PrivateKey)

func GenerateRandomName

func GenerateRandomName(namePrefix string, addStrLen int) string

func GenerateValidAccountName

func GenerateValidAccountName(namePrefix string, suffixStrLen int) (string, error)

func GenerateValidAccountNameAndKey

func GenerateValidAccountNameAndKey(namePrefix string, suffixStrLen int) (string, common.PubKey, *ecdsa.PrivateKey, error)

func GenerateValidAssetName

func GenerateValidAssetName(namePrefix string, suffixStrLen int) (string, error)

func GetAccountByName

func GetAccountByName(accountName string) accountmanager.Account

func GetAccountInfo

func GetAccountInfo(accountName string) bool

func GetAssetBalanceByID

func GetAssetBalanceByID(accountName string, assetID uint64) (*big.Int, error)

GetAccountBalanceByID get balance by address ,assetID and number.

func GetAssetInfoById

func GetAssetInfoById(assetID uint64) (*asset.AssetObject, error)

func GetAssetInfoByName

func GetAssetInfoByName(assetName string) (*asset.AssetObject, error)

GetAssetInfoByName get assetINfo by accountName

func GetNextAssetIdFrom

func GetNextAssetIdFrom(fromAssetId uint64) uint64

func GetNonce

func GetNonce(accountname common.Name) (uint64, error)

GetNonce get nonce by address and block number.

func GetReceiptByTxHash

func GetReceiptByTxHash(hash common.Hash) (*types.RPCReceipt, error)

func GetTxpoolStatus

func GetTxpoolStatus() (int, int)

func HomeDir

func HomeDir() string

func IncreaseAsset

func IncreaseAsset(fromAccount string, fromPrikey *ecdsa.PrivateKey, assetName string, increasedAmount *big.Int) error

func IsAssetExist

func IsAssetExist(assetName string) (bool, error)

func IsTxpoolFull

func IsTxpoolFull() bool

func IssueAsset

func IssueAsset(fromAccount string, owner string, fromPrikey *ecdsa.PrivateKey, toAccount string, assetName string, symbol string, amount *big.Int, decimals uint64) error

func IssueAssetWithValidAccount

func IssueAssetWithValidAccount(fromAccount string, owner string, toAccount string, assetName string, symbol string, amount *big.Int, decimals uint64) (*ecdsa.PrivateKey, error)

func MustRPCClient

func MustRPCClient() (*rpc.Client, error)

MustRPCClient Wraper rpc's client

func SendRawTx

func SendRawTx(rawTx []byte) (common.Hash, error)

SendRawTx send raw transaction

func SendTxTest

func SendTxTest(gcs []*GenAction) (common.Hash, error)

func SetAssetNewOwner

func SetAssetNewOwner(fromAccount string, assetName string, newOwner string, priKey *ecdsa.PrivateKey) error

func TransferAsset

func TransferAsset(fromAccountName, toAccountName string, assetId uint64, amount int64, prikey *ecdsa.PrivateKey) error

Types

type GenAction

type GenAction struct {
	*types.Action
	PrivateKey *ecdsa.PrivateKey
}

func NewGeAction

func NewGeAction(at types.ActionType, from, to common.Name, nonce uint64, assetid uint64, gaslimit uint64, amount *big.Int, payload []byte, prikey *ecdsa.PrivateKey) *GenAction

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL