Skip to content

Jant1L/tonic-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tonic-based-grpc-payment

this is a very simple grpc-payments

inspired by: https://github.com/letsgetrusty/grpc_example

run server:

cargo run --bin payments-server

run client:

cargo run --bin payments-client

and then input the corresponding information as prompted

This will output:

Response=Response { metadata: MetadataMap { headers: 
{"content-type": "application/grpc", 
"date": "XXX", 
"grpc-status": "0"} },
message: BtcPaymentResponse { 
    successful: true, 
    message: "Send XXX BTC to XXX." 
}, extensions: Extensions }

and output for server terminal:

We have request: Request { metadata: MetadataMap { headers: 
{"te": "trailers",
"content-type": "application/grpc", 
"user-agent": 
"tonic/0.7.2"} }, 
message: BtcPaymentRequest { 
    from_addr: "XXX", 
    to_addr: "XXX", 
    amount: XXX 
}, extensions: Extensions }

XXX is based on yourself

About

A very simple payments based on tonic

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published