encodings

package
v0.0.26 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MaxSLALevel int = 8 // this can be anything

Functions

func EncodeParams

func EncodeParams(params SPParams) (res [32]byte, err error)

func EncodeProposeUploadParams

func EncodeProposeUploadParams(params ProposeUploadParams) (res [32]byte, err error)

func FormatData

func FormatData(abi abi.ABI, methodName string, args ArchonSCArgs) (ret []byte, err error)

Types

type ArchonSCArgs

type ArchonSCArgs struct {
	Params               [32]byte
	NodeID               [32]byte
	HardwareProof        [32]byte
	Address              [20]byte
	HashedArchonFilepath [32]byte
	ContainerSignature   [ethcrypto.SignatureLength]byte
	Shardsize            uint64
	SPsToUploadTo        [][20]byte
	Username             [32]byte
	PublicKey            [64]byte
}

type ProposeUploadParams

type ProposeUploadParams struct {
	ServiceDuration     uint32
	MinSLARequirements  int
	UploadPmt           uint64
	Filesize            uint64
	FileContainerType   uint8
	EncryptionType      uint8
	CompressionType     uint8
	ShardContainerType  uint8
	ErasureCodeType     uint8
	AccessControlLevel  uint8
	ContainerSignatureV byte
	CustomField         uint8
}

func DecodeProposeUploadParams

func DecodeProposeUploadParams(params [32]byte) ProposeUploadParams

type SPParams

type SPParams struct {
	Wallet         wallet.EthereumKeyset
	SLALevel       int
	PledgedStorage uint64
	Bandwidth      uint64

	CountryCode gountries.Codes // must contain A2 field
	MinAskPrice uint64          // Wei per MByte

	Stake         uint64
	HardwareProof [32]byte

	NodeID string
}

func DecodeParams

func DecodeParams(params [32]byte) (res *SPParams)

Jump to

Keyboard shortcuts

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