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

Server only api #37

Closed
wants to merge 52 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
d173ad2
add validation for the 'from' an 'to' params of the 'compute_transfer…
jaensen May 17, 2023
a24e84d
fixed format strings for error messages
jaensen May 17, 2023
5144dfb
fixed format strings for error messages
jaensen May 17, 2023
b19584e
moved the rpc call dispatching to rpc_handler.rs and the function imp…
jaensen May 17, 2023
1ad37fe
added a CallContext for loggin of rpc requests and moved the rpc call…
jaensen May 18, 2023
de6324f
log startup info
jaensen May 18, 2023
2201bf9
dropped the incremental chunked results for simpler code. + log resul…
jaensen May 18, 2023
fd7268c
removed all code that's not directly required for the server use of t…
jaensen May 18, 2023
d7579f4
more logging
jaensen May 18, 2023
6668e27
trial and erroring a memory leak :/
jaensen May 18, 2023
b7992c4
more logging, more dropping
jaensen May 18, 2023
5b10d16
removed trace logging after the pathfinder ran for ~ 8h without issues.
jaensen May 19, 2023
96befac
unfinished: Allow to 'push' graph updates via http.
jaensen May 23, 2023
2aece90
get the test-data from the 'dev' branch
jaensen May 23, 2023
5320349
trying different trust_transfer_limit implementation
jaensen May 23, 2023
0626107
restored 'trust_transfer_limit' logic
jaensen May 24, 2023
cd108e0
fixed build warning
jaensen May 24, 2023
80aed20
refactored the compute_flow function to better show the data flow and…
jaensen May 24, 2023
7b89934
moved 'trust_transfer_limit' from safe to db
jaensen May 25, 2023
ca465fb
re-added fn default() -> CallContext for use in tests
jaensen May 25, 2023
e268db6
add capacity edges from users that hold accepted tokens to orgas
jaensen May 25, 2023
159a951
removed unnecessary field
jaensen May 25, 2023
5950ab8
add flow-edges from users with trusted tokens to the organizations th…
jaensen May 30, 2023
ee593af
OP-159: fix(workflow): add feature/server_only branch trigger, remove…
almereyda Jul 20, 2023
60fa1b1
Merge pull request #42 from CirclesUBI/fix/op-159-server_only
almereyda Jul 20, 2023
4baf76d
Edit compute_edges
Jul 24, 2023
9b1d4e8
update with fixed workflows
JacqueGM Aug 7, 2023
48fce9e
fix format
JacqueGM Aug 7, 2023
b37076d
Merge branch 'dev' of https://github.com/CirclesUBI/pathfinder2 into …
JacqueGM Aug 7, 2023
7f3050a
fix format
JacqueGM Aug 7, 2023
ad3398d
update lint issues
JacqueGM Aug 7, 2023
a6f2198
fix lint
JacqueGM Aug 7, 2023
a9fd2d2
fix map and lint
JacqueGM Aug 7, 2023
0d273ed
update branch
JacqueGM Aug 7, 2023
bbac07b
avoid building for server_only for now
JacqueGM Aug 10, 2023
2f07179
fix lint and add test back
JacqueGM Aug 10, 2023
2c187c0
git test fmt
JacqueGM Aug 10, 2023
9e7d27a
add default trait
JacqueGM Aug 10, 2023
329302d
adding test but with error with call_context
JacqueGM Aug 10, 2023
9b7db63
fix format
JacqueGM Aug 10, 2023
98b3c17
fix call_context error
JacqueGM Aug 10, 2023
cf3b970
remove some test to start
JacqueGM Aug 10, 2023
d3125e9
Exclude edges with equeal source and destination
Aug 24, 2023
4091056
Make compiler happy
Aug 27, 2023
a022f69
Resolve merge conflicts
Aug 27, 2023
c94dbc8
Remove repeated comments
Aug 27, 2023
bc2ac09
Fix imports
Aug 27, 2023
a0d0c57
Merge pull request #43 from CirclesUBI/compute-edges-all
JacqueGM Aug 28, 2023
e8aec86
update build work
JacqueGM Aug 28, 2023
18d2cc3
apply format changes
JacqueGM Aug 28, 2023
d515a68
update clippy failing
JacqueGM Aug 28, 2023
9c53202
fix fmt
JacqueGM Aug 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pub fn start_server(listen_at: &str, queue_size: usize, threads: u64) {
thread::spawn(move || loop {
let socket = rec.lock().unwrap().recv().unwrap();
if let Err(e) = handle_connection(e.deref(), socket) {
println!("Error handling connection: {e}");
println!("Error handling connection: {}", e);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wait what is this? I would have expected the opposite as that is the one recommended by cargo clippy.

}
});
}
Expand All @@ -94,7 +94,7 @@ pub fn start_server(listen_at: &str, queue_size: usize, threads: u64) {
panic!("Internal communication channel disconnected.");
}
},
Err(e) => println!("Error accepting connection: {e}"),
Err(e) => println!("Error accepting connection: {}", e),
}
}
}
Expand All @@ -109,7 +109,7 @@ fn handle_connection(
let response = match load_edges_binary(edges, &request.params["file"].to_string()) {
Ok(len) => jsonrpc_response(request.id, len),
Err(e) => {
jsonrpc_error_response(request.id, -32000, &format!("Error loading edges: {e}"))
jsonrpc_error_response(request.id, -32000, &format!("Error loading edges: {}", e))
}
};
socket.write_all(response.as_bytes())?;
Expand All @@ -118,7 +118,7 @@ fn handle_connection(
let response = match load_edges_csv(edges, &request.params["file"].to_string()) {
Ok(len) => jsonrpc_response(request.id, len),
Err(e) => {
jsonrpc_error_response(request.id, -32000, &format!("Error loading edges: {e}"))
jsonrpc_error_response(request.id, -32000, &format!("Error loading edges: {}", e))
}
};
socket.write_all(response.as_bytes())?;
Expand All @@ -127,7 +127,7 @@ fn handle_connection(
let response = match load_safes_binary(edges, &request.params["file"].to_string()) {
Ok(len) => jsonrpc_response(request.id, len),
Err(e) => {
jsonrpc_error_response(request.id, -32000, &format!("Error loading edges: {e}"))
jsonrpc_error_response(request.id, -32000, &format!("Error loading edges: {}", e))
}
};
socket.write_all(response.as_bytes())?;
Expand Down