From 12c8928dea61ebf8a07ff0f37dcbde7aacd96661 Mon Sep 17 00:00:00 2001 From: Thomas Jay Rush Date: Sat, 31 Aug 2024 21:04:46 -0400 Subject: [PATCH] Final cleaning before release --- CHANGES.md | 35 +++++++++++++++++++ src/apps/chifra/internal/chunks/handle_pin.go | 1 + src/apps/chifra/internal/chunks/validate.go | 1 + src/apps/chifra/internal/explore/validate.go | 2 +- src/apps/chifra/pkg/file/lock_windows.go | 2 +- src/apps/chifra/pkg/names/regular.go | 2 +- src/dev_tools/sdkFuzzer/monitors.go | 2 +- 7 files changed, 41 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index a775706c45..81a32bf51e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,41 @@ This file details changes made to TrueBlocks over time. All version prior to version 3.0.0 are now no longer supported. +## v4.0.0 - Kicking Ass (2024/09/01) + +- Bumped version to 4.0.0 +- Improved auto code generation to include sorting on appropriate types (x, y, z) +- Addition of Names capability to any routes that need to load names databases (most) +- Better ability to generate auto-generated code outside of core or the SDK (for example Browse) +- Better checking of certain validations such as Enums being found in validate code for a route +- Data models + - Removes TimestampCount type for more general Count type which is now used in other places + - Much easier to use caching code. Interface now requires an implementation of `CacheLocation` (no longer needs `CacheId` nor `CacheName`) +- Add ForEveryFileInFolder to walk package - super useful +- Adds Scrape endpoint to the SDK - enabling trueBlocks-node functionality +- Various updates to examples and tests +- Changes to better support builds on other operating sytems. Mostly path related. Not an endorsement of a Windows (or any other operating systems) versions. +- TimestampCount field removed from chifra when and replaced with more generic Count type which is now used elsehwere. +- Moved name type enums (Custom, Regular, etc) to types package removing it from names package. This was done to better support Browse. This is a breaking change. +- Types +- chifra scrape now returns Message type +- Monitor type now supports binary caching +- Removes simponly attribute from auto code gen field attributes +- Adds rangeDates field to ChunkAddress, ChunkStats, ChunkBloom, ChunkIndex, ChunkRecord +- Remove rangeEnd from ChunkStats (in favor of rangeDates) breaking +- Adds sorts option for auto-gen fields.csv file to create sorting code for a given type to names, functions, abis +- Adds name, path, fileSize, lastModDate, isKnown, nFunctions, nEvents, hasConstructor, hasFallback to Abi type +- Adds isStaged, isEmpty, and name to Monitor type +- Removes staged and removed from MonitorClean type - breaking +- Adds chifra monitors --count and chifra monitors --staged. Changes hotkey to 'd' from 'c' for chifra monitors --commands option. +- ADDS fileSize, hasConstructor, hasFallback, isEmpty, isKnown, lastModDate, nEvents, nFunctions, name, path to Abi type mostly for use in apps such as Browse +- Adds hidden option chifra explore --dalle <address> +- Adds chifra abis --list and chifra abis --count +- chifra daemon --api deprecated, no replacement, chifra daemon --scrape deprecated, use chifra scrape instead chifra daemon --monitor deprecated, use chifra monitors --watch instead. +- chifra chunks mode --count now properly returns a Count type (breaking) +- Implements sorts in the sdk for Abis, Names, Chunks, etc. +- monitorClean now has staged and removed fields + ## v3.1.2-release - Streaming SDK - Huntingdon (2024/07/18) **Summary** diff --git a/src/apps/chifra/internal/chunks/handle_pin.go b/src/apps/chifra/internal/chunks/handle_pin.go index bfb46d7fbe..7418209fc0 100644 --- a/src/apps/chifra/internal/chunks/handle_pin.go +++ b/src/apps/chifra/internal/chunks/handle_pin.go @@ -172,6 +172,7 @@ func matches(local, remote *types.ChunkRecord) (bool, bool) { } func (opts *ChunksOptions) matchReport(matches bool, localHash, remoteHash base.IpfsHash) { + _ = remoteHash // linter if !opts.Remote || !config.IpfsRunning() { return // if we're not pinning in two places, don't report on matches } diff --git a/src/apps/chifra/internal/chunks/validate.go b/src/apps/chifra/internal/chunks/validate.go index c7031b7bdb..a8194652c8 100644 --- a/src/apps/chifra/internal/chunks/validate.go +++ b/src/apps/chifra/internal/chunks/validate.go @@ -81,6 +81,7 @@ func (opts *ChunksOptions) validateChunks() error { } if opts.Count { + // TODO: Shouldn't this use validate.Enums? if !strings.Contains("manifest|index|blooms|pins|stats", opts.Mode) { return validate.Usage("The {0} option is only available in {1}.", "--count", "these modes: manifest|index|blooms|pins|stats") } diff --git a/src/apps/chifra/internal/explore/validate.go b/src/apps/chifra/internal/explore/validate.go index bef438e2f1..9f68961a4e 100644 --- a/src/apps/chifra/internal/explore/validate.go +++ b/src/apps/chifra/internal/explore/validate.go @@ -143,7 +143,7 @@ func (t ExploreType) String() string { } func (opts *ExploreOptions) idToBlockHash(chain, arg string, isBlockHash func(arg string) bool) (base.Hash, error) { - _ = chain // delint + _ = chain // linter if isBlockHash(arg) { return opts.Conn.GetBlockHashByHash(arg) } diff --git a/src/apps/chifra/pkg/file/lock_windows.go b/src/apps/chifra/pkg/file/lock_windows.go index 3a95a711c1..9edfefd844 100644 --- a/src/apps/chifra/pkg/file/lock_windows.go +++ b/src/apps/chifra/pkg/file/lock_windows.go @@ -14,6 +14,6 @@ func Lock(file *os.File) error { } func Unlock(file *os.File) error { - // TODO: DOn't we need this? + // TODO: Don't we need this? return nil } diff --git a/src/apps/chifra/pkg/names/regular.go b/src/apps/chifra/pkg/names/regular.go index 3d379ab0e8..27a13a5f43 100644 --- a/src/apps/chifra/pkg/names/regular.go +++ b/src/apps/chifra/pkg/names/regular.go @@ -68,7 +68,7 @@ func loadRegularMap(chain string, terms []string, parts types.Parts, ret *map[ba // loadKnownBadresses loads the known bad addresses from the cache func loadKnownBadresses(unused string, terms []string, parts types.Parts, ret *map[base.Address]types.Name) error { - _ = unused + _ = unused // linter knownBadAddresses := []types.Name{ { Address: base.PrefundSender, diff --git a/src/dev_tools/sdkFuzzer/monitors.go b/src/dev_tools/sdkFuzzer/monitors.go index 2803ee4ce3..06b719d84a 100644 --- a/src/dev_tools/sdkFuzzer/monitors.go +++ b/src/dev_tools/sdkFuzzer/monitors.go @@ -39,12 +39,12 @@ func DoMonitors() { // sleep is not fuzzed // Fuzz Loop // EXISTING_CODE + _ = staged _ = delete _ = undelete _ = remove _ = watch _ = globs - _ = staged opts = sdk.MonitorsOptions{ Addrs: []string{fuzzAddresses[0]}, }