-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add an example of a simple storage server #86
Conversation
This adds an example that provides a REPL-like experience for running RPCs and quorum calls on different configurations.
Now the example can be run with 4 servers without giving any arguments or running a script.
Gorums doesn't yet have stable releases, so it's probably safest to avoid updating any modules
The github.com/chzyer/readline package appears to be abandoned. Looking at the pprof command in go, I found a suitable alternative from the crypto module.
|
||
## Prerequisites | ||
|
||
Requires Go 1.13 or later and you must have `$GOPATH/bin` in your `$PATH`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don’t want to refer to GOPATH. Suggest we just remove this, unless we actually depend on paths; if we do we could explain that we use GOBIN as a reference for where our go binaries are saved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's still relevant to use GOPATH
here though. That way you can simply run go get github.com/relab/gorums/examples/storage
. And then the storage
binary will be available. I've always thought of GOPATH/bin
as the "default", and GOBIN
as an override.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. Maybe we can just link to the official instructions, to avoid being specific about GOPATH
. They also use this:
$ go get golang.org/x/tour
This will place the tour binary in your workspace's bin directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like they mean GOPATH when they say "workspace"
https://web.archive.org/web/20190806061015/https://golang.org/doc/code.html#Workspaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"the GOPATH environment variable specifies the location of your workspace"
@meling I found two alternatives for implementing a readline-style CLI: The first one has a much larger feature set, but the project seems to be abandoned. It is still, however, used by The second one has the basic features we need, but struggles with arrow keys on windows for some reason. This package is used by the We could also try using the For now option 2 is implemented, and it works on windows except for arrow keys. |
I don't have a strong preference, but it seems like going with the |
Also, how do you feel about using a separate The reason I wanted to have a separate module for the examples, was to try to make them separate from the gorums module, and preventing them from showing up in |
I actually prefer to use multiple modules for these things. But there are problems with VSCode; I find that with multi-root workspaces if you (accidentally) navigate into another module (from the top-level workspace) I get errors in files... Hopefully VSCode gets better at handling multi-root workspaces. |
This PR adds an example storage server with a nice CLI to play with RPCs, quorum calls and configurations.
Currently depends on #81