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

New RPC method "version". #835

Closed
wants to merge 1 commit into from
Closed

New RPC method "version". #835

wants to merge 1 commit into from

Conversation

rec
Copy link
Contributor

@rec rec commented Jan 28, 2015

@rec rec added Josh labels Jan 28, 2015
@vinniefalco
Copy link
Contributor

How about "best" instead of "recommended" to make the words roughly the same length? Just a thought.

@rec
Copy link
Contributor Author

rec commented Jan 28, 2015

Cool idea, asking on the list...

On Wed, Jan 28, 2015 at 11:46 AM, Vinnie Falco notifications@github.com
wrote:

How about "best" instead of "recommended" to make the words roughly the
same length? Just a thought.


Reply to this email directly or view it on GitHub
#835 (comment).

@@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not keen on having two files named Version.h that are one directory level away from each other.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll rename rpc/Version to rpc/RPCVersion.h. (The other choice is renaming the version handler to VersionHandler, but we already have so many things marked as "Handler"...)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me.

@scottschurr
Copy link
Collaborator

I've read over the document, but I'm still catching up on the actual implementation details. Let me see if I got this right.

  1. This commit adds a new RPC command "version".
  2. The new "version" command returns 3 JSON fields: "first", "recommended", and "last".
  3. For now all three of those fields contain "1.0.0"

As far as I can tell, we're not implementing any other part of the document besides adding the "version" RPC command. And that RPC command returns values, but accepts no settings. Is that correct?

@rec
Copy link
Contributor Author

rec commented Jan 28, 2015

Regarding the #ifdef guard, I have an automatic tool that spits out .h files an ifdef that's guaranteed unique over all src files in rippled, so I'm just never going to look at it or change it, because I know it works.

@rec
Copy link
Contributor Author

rec commented Jan 28, 2015

Scott, you are completely correct on all of these.

The one unresolved question is the version number to give it. I'm proposing 1.0.0 because the program is in release, and this is the very first version we've named.

@rec
Copy link
Contributor Author

rec commented Jan 28, 2015

Pushed a new version with all those changes!

@rec
Copy link
Contributor Author

rec commented Jan 28, 2015

Oh, one quibble - I decided to go with Vinnie's best idea as clearer than recommended.

template <class Object>
void setVersion(Object& parent)
{
auto&& object = addObject (parent, jss::version);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a lot to learn on the auto&& front. The way I read this, object may be an rvalue reference. Under what situation would that be desirable? Might it be better to have a plain auto& and have the compiler bark if addObject returned an rvalue?

@vinniefalco
Copy link
Contributor

@rec Can you adjust the settings of the automated tool to produce guards that more closely match the latest style in the code base?

@scottschurr
Copy link
Collaborator

👍

//------------------------------------------------------------------------------
/*
This file is part of rippled: https://github.com/ripple/rippled
Copyright (c) 2012, 2013 Ripple Labs Inc.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's 2015. The future!

@scottschurr
Copy link
Collaborator

Oh. You'll want to run scons vcxproj.

@rec
Copy link
Contributor Author

rec commented Jan 28, 2015

(I fixed my boilerplate maker and released a little of it as an opensource tool... see other change lists...)

}

template <class Object>
void writeResult (Object& obj)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should check() or writeResult() be static?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not since they are called through an instance of the class in the handler manager.

@josh-ripple
Copy link
Contributor

I guess we're done here. 👍

@josh-ripple josh-ripple added the Passed Passed code review & PR owner thinks it's ready to merge. Perf sign-off may still be required. label Jan 29, 2015
@rec
Copy link
Contributor Author

rec commented Jan 29, 2015

Anyone else with thoughts?

On Thu, Jan 29, 2015 at 4:33 AM, Josh Juran notifications@github.com
wrote:

I guess we're done here. [image: 👍]


Reply to this email directly or view it on GitHub
#835 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Passed Passed code review & PR owner thinks it's ready to merge. Perf sign-off may still be required.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants