Documentation
¶
Index ¶
- Variables
- func AddAggregateIndexFromPiece(t *testing.T, ctx context.Context, idx *indexstore.IndexStore, ...) error
- func AddIndexFromCAR(ctx context.Context, idx *indexstore.IndexStore, pieceCID cid.Cid, ...) error
- func AddPDPv0IndexFromPiece(t *testing.T, ctx context.Context, idx *indexstore.IndexStore, ...) error
- func AssertIPFSCarResponseHeaders(t *testing.T, headers http.Header)
- func AssertNoFailedSectors(t *testing.T, ctx context.Context, db *harmonydb.DB)
- func AssertPieceResponseHeaders(t *testing.T, headers http.Header, pieceCID string, expectedBodyLen int)
- func AttachCurioHarnessCleanup(t *testing.T, harness CurioHarness, shutdownTimeout time.Duration)
- func BootstrapNetwork(t *testing.T, ctx context.Context, opts ...any) (*kit.TestFullNode, *kit.TestMiner, *kit.Ensemble, string)
- func BootstrapNetworkWithNewMiner(t *testing.T, ctx context.Context, minerSize string, opts ...any) (*kit.TestFullNode, *kit.TestMiner, *harmonydb.DB, address.Address)
- func CreateCliContext(dir string, layers []string) (*cli.Context, error)
- func CreateStorageMiner(ctx context.Context, full v1api.FullNode, owner address.Address, ...) (address.Address, error)
- func CreateStorageMinerAndConfig(ctx context.Context, full v1api.FullNode, db *harmonydb.DB, ...) (address.Address, error)
- func DumpDealPipelineDiagnostics(t *testing.T, ctx context.Context, db *harmonydb.DB, mk12UUIDs []string, ...)
- func EncodeCurioConfigForDB(cfg *config.CurioConfig) (string, error)
- func EnvElse(env, els string) string
- func FR32PadFixture(raw []byte, pieceSize abi.PaddedPieceSize) []byte
- func FreeListenAddr(t *testing.T) string
- func FullNodeAPIInfo(ctx context.Context, full v1api.FullNode, listenAddr multiaddr.Multiaddr) (string, error)
- func HTTPGet(t *testing.T, baseURL, path string, headers map[string]string) (int, []byte)
- func HTTPGetWithHeaders(t *testing.T, baseURL, path string, headers map[string]string) (int, []byte, http.Header)
- func HTTPRequestWithHeaders(t *testing.T, method, baseURL, path string, headers map[string]string) (int, []byte, http.Header)
- func InsertCompletedParkedPiece(tx *harmonydb.Tx, pieceCID string, pieceSize abi.PaddedPieceSize, ...) (int64, error)
- func InsertParkedPieceRef(tx *harmonydb.Tx, pieceID int64, dataURL string, headers []byte, longTerm bool) (int64, error)
- func Int64PtrOrNA(ptr *int64) string
- func LoadBaseConfigFromDB(ctx context.Context, db *harmonydb.DB) (*config.CurioConfig, error)
- func LogIPNIStatus(t *testing.T, ctx context.Context, db *harmonydb.DB)
- func NewHashSpaceCluster(t *testing.T, ctx context.Context, db *harmonydb.DB, storageID string) *hashfolder.Cluster
- func NewIndexStore(ctx context.Context, t *testing.T, cfg *config.CurioConfig) *indexstore.IndexStore
- func NullInt64OrNA(v sql.NullInt64) string
- func PipelineProgress(t *testing.T, ctx context.Context, db *harmonydb.DB, mk12UUIDs []string, ...) error
- func PlaceOpenPiece(t *testing.T, ctx context.Context, hs *hashfolder.Cluster, piece PieceFixture)
- func ProcessPieceDealTx(tx *harmonydb.Tx, p ProcessPieceDealParams) error
- func ProviderCollateralBounds(ctx context.Context, full v1api.FullNode, pieceSize abi.PaddedPieceSize) (abi.TokenAmount, error)
- func RedeclareAllLocalStorage(ctx context.Context, t *testing.T, capi api.Curio)
- func RequireNotInOpenPieces(t *testing.T, ctx context.Context, hs *hashfolder.Cluster, piece PieceFixture)
- func SectorSizeFromString(size string) (abi.SectorSize, error)
- func SeedMK12F05PendingDeal(tx *harmonydb.Tx, s MK12F05PendingSeed) error
- func SeedMK20PendingDeal(tx *harmonydb.Tx, s MK20PendingSeed) error
- func SelectFixtureRawBlockCandidate(t *testing.T, fixture PieceFixture) (cid.Cid, []byte)
- func SetBaseConfigWithDefaults(t *testing.T, ctx context.Context, db *harmonydb.DB) (*config.CurioConfig, error)
- func TimePtrOrNA(v *time.Time) string
- func UpdateBaseConfigWithTimestamp(ctx context.Context, db *harmonydb.DB, cfg *config.CurioConfig) error
- func UpsertBaseConfig(ctx context.Context, db *harmonydb.DB, cfg *config.CurioConfig) error
- func WaitForCondition(ctx context.Context, timeout time.Duration, pollInterval time.Duration, ...) error
- func WaitForHTTP(t *testing.T, baseURL string)
- func WaitForTCP(t *testing.T, addr string, timeout time.Duration)
- func WriteParkedPieceFixture(dir string, pieceID int64, data []byte) error
- func WriteUnsealedSectorFixture(dir string, miner abi.ActorID, sector abi.SectorNumber, ...) error
- type CurioHarness
- type CurioHarnessOptions
- type CurioLogLevel
- type MK12F05PendingSeed
- type MK12SignedProposal
- type MK20PendingSeed
- type PieceFixture
- type ProcessPieceDealParams
- type SectorRef
Constants ¶
This section is empty.
Variables ¶
var ErrWaitTimeout = xerrors.New("timeout waiting for condition")
Functions ¶
func AddAggregateIndexFromPiece ¶ added in v1.27.4
func AddAggregateIndexFromPiece(t *testing.T, ctx context.Context, idx *indexstore.IndexStore, aggregate PieceFixture, subPieces []mk20.DataSource) error
AddAggregateIndexFromPiece indexes an aggregate fixture and stores both its payload block index and aggregate child-piece mappings in the test index store.
func AddIndexFromCAR ¶ added in v1.27.4
func AddIndexFromCAR(ctx context.Context, idx *indexstore.IndexStore, pieceCID cid.Cid, carBytes []byte) error
AddIndexFromCAR indexes a CAR fixture into the test index store for the supplied piece CID.
func AddPDPv0IndexFromPiece ¶ added in v1.28.3
func AddPDPv0IndexFromPiece(t *testing.T, ctx context.Context, idx *indexstore.IndexStore, piece PieceFixture) error
AddPDPv0IndexFromPiece indexes a PDPv0 parked piece for retrieval tests.
func AssertIPFSCarResponseHeaders ¶ added in v1.27.4
func AssertNoFailedSectors ¶ added in v1.27.4
func AssertPieceResponseHeaders ¶ added in v1.27.4
func AttachCurioHarnessCleanup ¶ added in v1.27.4
func AttachCurioHarnessCleanup(t *testing.T, harness CurioHarness, shutdownTimeout time.Duration)
func BootstrapNetwork ¶ added in v1.27.4
func BootstrapNetworkWithNewMiner ¶ added in v1.27.4
func CreateStorageMiner ¶ added in v1.27.4
func CreateStorageMinerAndConfig ¶ added in v1.27.4
func DumpDealPipelineDiagnostics ¶ added in v1.27.4
func EncodeCurioConfigForDB ¶ added in v1.27.4
func EncodeCurioConfigForDB(cfg *config.CurioConfig) (string, error)
func FR32PadFixture ¶ added in v1.27.4
func FR32PadFixture(raw []byte, pieceSize abi.PaddedPieceSize) []byte
func FreeListenAddr ¶
func FullNodeAPIInfo ¶ added in v1.27.4
func HTTPGetWithHeaders ¶ added in v1.27.4
func HTTPRequestWithHeaders ¶ added in v1.27.4
func InsertCompletedParkedPiece ¶ added in v1.27.4
func InsertParkedPieceRef ¶ added in v1.27.4
func Int64PtrOrNA ¶ added in v1.27.4
func LoadBaseConfigFromDB ¶ added in v1.27.4
func LogIPNIStatus ¶ added in v1.27.4
LogIPNIStatus writes the current IPNI rows to the test log for debugging retrieval/indexing test failures.
func NewHashSpaceCluster ¶ added in v1.29.1
func NewHashSpaceCluster(t *testing.T, ctx context.Context, db *harmonydb.DB, storageID string) *hashfolder.Cluster
NewHashSpaceCluster joins a single temporary disk to the open-pieces hash space of db. The cluster is closed when the test ends.
func NewIndexStore ¶ added in v1.27.4
func NewIndexStore(ctx context.Context, t *testing.T, cfg *config.CurioConfig) *indexstore.IndexStore
func NullInt64OrNA ¶ added in v1.27.4
func PipelineProgress ¶ added in v1.27.4
func PlaceOpenPiece ¶ added in v1.29.1
func PlaceOpenPiece(t *testing.T, ctx context.Context, hs *hashfolder.Cluster, piece PieceFixture)
PlaceOpenPiece writes the fixture's bytes into open-pieces on the disk its hash maps to, named as /piece/ looks it up.
func ProcessPieceDealTx ¶ added in v1.27.4
func ProcessPieceDealTx(tx *harmonydb.Tx, p ProcessPieceDealParams) error
func ProviderCollateralBounds ¶ added in v1.27.4
func ProviderCollateralBounds(ctx context.Context, full v1api.FullNode, pieceSize abi.PaddedPieceSize) (abi.TokenAmount, error)
func RedeclareAllLocalStorage ¶ added in v1.27.4
func RequireNotInOpenPieces ¶ added in v1.29.1
func RequireNotInOpenPieces(t *testing.T, ctx context.Context, hs *hashfolder.Cluster, piece PieceFixture)
RequireNotInOpenPieces fails if any disk that may hold the piece has it.
func SectorSizeFromString ¶ added in v1.27.4
func SectorSizeFromString(size string) (abi.SectorSize, error)
func SeedMK12F05PendingDeal ¶ added in v1.27.4
func SeedMK12F05PendingDeal(tx *harmonydb.Tx, s MK12F05PendingSeed) error
func SeedMK20PendingDeal ¶ added in v1.27.4
func SeedMK20PendingDeal(tx *harmonydb.Tx, s MK20PendingSeed) error
func SelectFixtureRawBlockCandidate ¶ added in v1.27.4
SelectFixtureRawBlockCandidate returns a deterministic block from the CAR payload, preferring a non-root block when the fixture contains one.
func SetBaseConfigWithDefaults ¶ added in v1.27.4
func TimePtrOrNA ¶ added in v1.27.4
func UpdateBaseConfigWithTimestamp ¶ added in v1.27.4
func UpsertBaseConfig ¶ added in v1.27.4
func WaitForCondition ¶ added in v1.27.4
func WaitForHTTP ¶ added in v1.27.4
func WaitForTCP ¶ added in v1.27.4
WaitForTCP waits until something accepts TCP connections on addr (e.g. "127.0.0.1:4700"). Use after starting an RPC server in a goroutine so clients do not dial before Listen completes.
func WriteParkedPieceFixture ¶ added in v1.27.4
func WriteUnsealedSectorFixture ¶ added in v1.27.4
func WriteUnsealedSectorFixture(dir string, miner abi.ActorID, sector abi.SectorNumber, sectorSize abi.SectorSize, fixture PieceFixture) error
Types ¶
type CurioHarness ¶ added in v1.27.4
type CurioHarness struct {
API api.Curio
Dependencies *deps.Deps
EngineTerminate func()
ClientCloser jsonrpc.ClientCloser
FinishCh <-chan struct{}
}
func StartCurioHarness ¶ added in v1.27.4
func StartCurioHarness( ctx context.Context, t *testing.T, dir string, db *harmonydb.DB, idx *indexstore.IndexStore, full v1api.FullNode, storageRPCSecret string, opts CurioHarnessOptions, ) CurioHarness
func StartCurioHarnessWithCleanup ¶ added in v1.27.4
func StartCurioHarnessWithCleanup( ctx context.Context, t *testing.T, dir string, db *harmonydb.DB, idx *indexstore.IndexStore, full v1api.FullNode, storageRPCSecret string, opts CurioHarnessOptions, ) CurioHarness
type CurioHarnessOptions ¶ added in v1.27.4
type CurioHarnessOptions struct {
Layers []string
LogLevels []CurioLogLevel
}
type CurioLogLevel ¶ added in v1.27.4
type MK12F05PendingSeed ¶ added in v1.27.4
type MK12SignedProposal ¶ added in v1.27.4
type MK12SignedProposal struct {
Proposal market9.DealProposal
SignedProposalCID cid.Cid
ProposalCID cid.Cid
ProposalJSON []byte
SignatureBytes []byte
LabelCBOR []byte
}
func BuildSignedMK12Proposal ¶ added in v1.27.4
func BuildSignedMK12Proposal(ctx context.Context, full v1api.FullNode, clientAddr address.Address, providerAddr address.Address, root cid.Cid, pieceCID cid.Cid, pieceSize abi.PaddedPieceSize, startEpoch abi.ChainEpoch, endEpoch abi.ChainEpoch, providerCollateral abi.TokenAmount) (*MK12SignedProposal, error)
type MK20PendingSeed ¶ added in v1.27.4
type PieceFixture ¶ added in v1.27.4
type PieceFixture struct {
RootCID cid.Cid
CarBytes []byte
PieceCIDV1 cid.Cid
PieceCIDV2 cid.Cid
PieceSize abi.PaddedPieceSize
RawSize int64
}
func CreateAggregateFixtureFromSubpieces ¶ added in v1.27.4
func CreateAggregateFixtureFromSubpieces(t *testing.T, subpieces []PieceFixture) (PieceFixture, []mk20.DataSource)
func CreatePieceFixture ¶ added in v1.27.4
func CreatePieceFixture(t *testing.T, dir string, sourceSize int64) PieceFixture