-
Notifications
You must be signed in to change notification settings - Fork 58
node: Api server [WIP] #492
base: main
Are you sure you want to change the base?
Conversation
This reverts commit f8b4022.
| height, | ||
| prev: prev.0, | ||
| timestamp_ms, | ||
| txroot: txroot.0, |
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.
maybe use the Hash type that we already have?
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.
It is hard question about newtypes. API users should not be aware of what newtypes we use inside the application. But using them will make code a little easier because they are used internally by the application.
node/src/api/network.rs
Outdated
| .or(submit(bc)) | ||
| } | ||
|
|
||
| fn status(bc: BlockchainRef) -> impl Filter<Extract = impl warp::Reply, Error = warp::Rejection> + Clone { |
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.
Would it be more readable if those routes were declared as local variables instead of functions? Then we wouldn't need those long return type definitions all over the place.
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.
Updated by e498280
| ) -> ResponseResult<responses::NewReceiver> { | ||
| let mut wallet_ref = wallet.write().await; | ||
| let update_wallet = |wallet: &mut Wallet| { | ||
| let requests::NewReceiver { flv, qty, exp } = req; // TODO: expiration time? |
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.
Hmm.. I'm starting to think that the expiration time is the storage policy of the node. How about we remove this parameter from the request entirely for now?
Server api implementation for
node.A part of #468.
Schema of api: https://github.com/stellar/slingshot/blob/main/node/api.md