Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for retrieving metadata on current commit/t (i.e. head commit) #359

Closed
aaj3f opened this issue Jan 31, 2023 · 1 comment · Fixed by #379
Closed

Support for retrieving metadata on current commit/t (i.e. head commit) #359

aaj3f opened this issue Jan 31, 2023 · 1 comment · Fixed by #379
Assignees
Milestone

Comments

@aaj3f
Copy link
Contributor

aaj3f commented Jan 31, 2023

Description

There is a need to retrieve metadata on the current head commit, without already knowing the t value of that commit. For example, I have no idea what the current commit is, but I need to know the datetime instant of the most recent commit -- I can't use an endpoint like /commit because I don't have a t value to provide. In Fluree v2, I could directly query _block data that would have been added by the transaction server on each new block commit, e.g.

{
	selectOne: ["_block/number", "_block/instant"],
	from: "_block",
	opts: {
		orderBy: ["DESC", "_block/number"],
	},
}

but so far as I can tell, regardless of connection type and regardless of whether you are querying a ledger that has had all changes committed to it, no such commit metadata exists.

Acceptance Criteria

  • Either by issuing a query directly or via some other endpoint (e.g. ledger-info, commit, etc) it should be possible to ascertain ledger metadata such as the current head commit
  • If possible, it would be nice to also retrieve the desired metadata ABOUT that commit (e.g. datetime instant) without needing to issue a subsequent API call

Implementation Details

@aaj3f aaj3f modified the milestones: 3.0.0-alpha2, 3.0.0-alpha1 Jan 31, 2023
@aaj3f
Copy link
Contributor Author

aaj3f commented Jan 31, 2023

@mpoffald @dpetran I suppose could be related to #333 if there was a decision made to allow, for example, a call to /commit with no specified t value to then return the current commit at the head of the ledger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants