Documentation
¶
Index ¶
- Constants
- Variables
- func HashSector(sector Sector) crypto.Hash
- func NewReader(r io.ReaderAt) io.Reader
- func NewStore(blobsPath string) *storeImpl
- func NewWriter(w io.WriterAt) io.Writer
- func PathifyName(n string) string
- func ReadBlobAt(r io.ReaderAt, b []byte, off int64) (int, error)
- func SealHash(name string, ts time.Time, merkleRoot crypto.Hash, reservedRoot crypto.Hash) crypto.Hash
- func SignSeal(signer crypto.Signer, name string, ts time.Time, merkleRoot crypto.Hash, ...) (crypto.Signature, error)
- func VerifySectorProof(sector Sector, sectorID uint8, merkleRoot crypto.Hash, proof MerkleProof) bool
- func WriteBlobAt(w io.WriterAt, b []byte, off int64) (int, error)
- func WriteSector(w io.WriterAt, id uint8, sector Sector) error
- type Blob
- type MerkleBase
- type MerkleProof
- type MerkleTree
- type Pool
- type PoolGetter
- type Readable
- type Reader
- type Sector
- type SectorReader
- type Store
- type Transaction
- type Writer
Constants ¶
View Source
const ( HeaderLen = 1 + 1 + 63 + 8 + 32 + 65 SectorLen = 65536 SectorCount = 256 Size = SectorLen * SectorCount CurrentVersion = 1 )
View Source
const ( MerkleTreeHeight = 8 MerkleProofLen = 8 * 32 SubsectorSize = 4096 SubsectorCountBlob = Size / SubsectorSize SubsectorCountSector = SectorLen / SubsectorSize SubsectorProofLevel = 8 )
Variables ¶
View Source
var ( EmptyBlobMerkleRoot = crypto.Hash{0x7d, 0x1e, 0x84, 0xe6, 0x2d, 0x7e, 0xc9, 0xf6, 0xbc, 0x3f, 0x88, 0x66, 0x75, 0x73, 0x3d, 0xa0, 0x6d, 0xaf, 0x02, 0x77, 0xad, 0x8f, 0xfc, 0xf7, 0xc5, 0x39, 0x93, 0x8c, 0xa5, 0xee, 0x9c, 0xf2} EmptyBlobBaseHash = crypto.Hash{0x53, 0x2a, 0x12, 0xf0, 0x9f, 0xeb, 0xf8, 0x52, 0x14, 0x19, 0x95, 0x99, 0x73, 0xad, 0x53, 0x46, 0x94, 0x4c, 0x2b, 0x22, 0xbf, 0x76, 0x4d, 0x0e, 0x1a, 0x34, 0x25, 0x5b, 0x65, 0x64, 0xfe, 0x4b} ZeroMerkleBase MerkleBase )
View Source
var ( ErrTransactionClosed = errors.New("transaction already closed") ErrTransactionRemoved = errors.New("transaction removed") )
View Source
var ErrNotFound = errors.New("not found")
View Source
var (
ErrWriteBeyondBlobBounds = errors.New("write beyond blob bounds")
)
Functions ¶
func HashSector ¶
func PathifyName ¶
func VerifySectorProof ¶
Types ¶
type MerkleBase ¶
func (MerkleBase) DiffWith ¶
func (m MerkleBase) DiffWith(other MerkleBase) []uint8
type MerkleProof ¶
type MerkleProof [MerkleProofLen]byte
func MakeSectorProof ¶
func MakeSectorProof(tree MerkleTree, sectorID uint8) MerkleProof
type MerkleTree ¶
func MakeTreeFromBase ¶
func MakeTreeFromBase(base MerkleBase) MerkleTree
func NewMerkleTreeFromReader ¶
func (MerkleTree) Height ¶
func (t MerkleTree) Height() int
func (MerkleTree) ProtocolBase ¶
func (t MerkleTree) ProtocolBase() MerkleBase
func (MerkleTree) Root ¶
func (t MerkleTree) Root() crypto.Hash
func (MerkleTree) String ¶
func (t MerkleTree) String() string
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
func NewPool ¶
func NewPool(getter PoolGetter) *Pool
type PoolGetter ¶
type SectorReader ¶
type Transaction ¶
Click to show internal directories.
Click to hide internal directories.