Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccountType ¶
type AccountType uint8
const ( EthAccountType AccountType = iota NeoAccountType )
type EthereumValues ¶
type IAccount ¶
type IAccount interface {
GetAccountType() AccountType
BlockchainName() string
Permission() common.UrlPermission
EcdsaPrivateKey() *ecdsa.PrivateKey // follows Eth standard
PrivateKeyBytes() []byte
PrivateKeyString() string
PublicKeyBytes() []byte
EcdsaPublicKeyBytes() []byte // follows Eth standard
PublicKeyString() string
AddressBytes() []byte
AddressString() string
Sign(hash []byte) (sig []byte, err error)
Verify(hash, signature, publicKey []byte) bool
// true if the transaction was accepted by the blockchain
IsTxAccepted(txId string) bool
// For client side
GetUserName() (string, error)
RegisterUserName(string) error
// For Storage Provider side
// Checks if the storage provider is registered on the blockchain
IsSpRegistered() bool
RegisterSP(*RegistrationInfo) (txId string, err error)
UnregisterSP() error
GetUploadTxInfo(txId string) (info *UploadTxInfo, err error)
GetEarnings() (int64, error)
// Utilities
// amount is in blockchain base (Wei/Gas)
PrettyCurrency(amount int64) string
// in blockchain base
HundredthOfCent() int64
}
type RegistrationInfo ¶
type RegistrationInfo struct {
CountryA3 string
PledgedGigaBytes float64
Ethereum EthereumValues
Neo NeoValues
Version int
}
type UploadTxInfo ¶
type UploadTxInfo struct {
TxId string
UserName string
PublicKey []byte
FileContainerType uint8
Signature []byte
SPs [][]byte
}
Info needed by the SP when it received an upload request
func (*UploadTxInfo) ToJsonString ¶
func (u *UploadTxInfo) ToJsonString() string
Click to show internal directories.
Click to hide internal directories.