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

Add dockerfile and export simple api to send/receive messages #92

Merged
merged 1 commit into from
Jun 23, 2019

Conversation

dshulyak
Copy link
Contributor

@dshulyak dshulyak commented Jun 18, 2019

Added dockerfile and set of api methods to send messages and query database

See https://github.com/status-im/status-console-client/blob/9fa939d7559a7bc629a272c09cf3b071cedb37e9/API.md

simple simulation example: status-im/status-scale#29

@dshulyak dshulyak changed the title [WIP] prepare client for testing with status-scale Add dockerfile and export simple api to send/receive messages Jun 19, 2019
@dshulyak dshulyak requested a review from adambabik June 19, 2019 06:17
@dshulyak
Copy link
Contributor Author

@adambabik what was the idea for that api module? i see that some methods are using protocol directly. do you still want to use protocol interface there or we can make it a simple proxy to messenger?

@@ -141,7 +141,8 @@ func (m *Messenger) Join(ctx context.Context, c Contact) error {
}

opts := protocol.DefaultRequestOptions()
if err := m.Request(ctx, c, opts); err != nil {
// NOTE(dshulyak) join ctx shouldn't have an impact on history timeout.
if err := m.Request(context.Background(), c, opts); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should remove sending a request when joining and make it a separate action? It wouldn't be this PR change though.

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 think ideally it should be managed in background, so that we can do multiple attempts without blocking an API

the same when messenger is started

API.md Outdated
Start service with configuration file that enables API:

```
./bin/status-term-client -node-config api.conf -no-ui --keyhex=0x123
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's write the content of api.conf here as well.

@@ -0,0 +1,23 @@
# Build status-go in a Go builder container
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's also add a .dockerignore and ignore .git and other unnecessary dirs.

@adambabik
Copy link
Contributor

@dshulyak we can do whatever we want with the API module at this moment. There is a new one in status-go which will actually be used by status-react. So this API here can just expose Messenger's public methods.

Prepare docker image for tests

Use make build in dockerfile

Add mailservers to transport object

Add readme with example how to use API

Forgot to add a stream for contact

Rewrite correct variable

Apply suggestions
@dshulyak
Copy link
Contributor Author

@adambabik i made suggested changes, please take a look

@dshulyak dshulyak merged commit d46665e into master Jun 23, 2019
@delete-merged-branch delete-merged-branch bot deleted the perf-tools branch June 23, 2019 06:30
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 this pull request may close these issues.

None yet

2 participants