Commit Graph

2704 Commits

Author SHA1 Message Date
aggstam
e82befb679 script/research/streamlet_rust: Modified structures based on doc/src/architecture/blockchain.md 2022-03-12 15:16:47 +02:00
lunar-mining
0756fbefb9 ui: generalize and tidy render functions
we reduce boilerplate by creating a new generic function called draw().
variables are initialized in draw_outbound(), draw_inbound(), and
draw_manual() and are then sent to draw().

dynamic resizing is enabled by returning the total frame length like so:

    let len = draw_outbound(...)
    let len = draw_inbound(..., len)

it would be cleaner to store this value in a struct. however this is non
trivial to implement.

ui::ui() cannot be async and therefore cannot use mutexes due to its use
in the following non-async function from external library tui::Terminal:

    terminal.draw(|f| {
        ui::ui(f, view.clone());
    })?;

however ui::ui() is called within the async function render(), which
means values set inside ui::ui() may be overwritten during async calls.
2022-03-12 11:43:55 +01:00
Dastan-glitch
8e59ba44b6 bin/tau-cli: configuring due and send it as timestamp 2022-03-11 23:19:06 -05:00
ghassmo
66c715d7b7 bin/taud: split the code into separate modules 2022-03-12 00:43:32 +04:00
ghassmo
81def80d17 bin/taud: add generic load/save functions for json dataset 2022-03-12 00:12:54 +04:00
ghassmo
1da5edf4af bin/taud: add find_free_id function 2022-03-11 22:52:19 +04:00
parazyd
f172f62250 cargo +nightly fmt. 2022-03-11 16:57:43 +01:00
parazyd
fa7a6eb0ad doc: Restore .gitignore. 2022-03-11 16:57:27 +01:00
lunar-mining
0a2cd81afe ui: check whether msg is sent or recv and display on the right
this is a quick fix to display info properly and ui.rs still needs a major cleanup and refactor.
2022-03-11 09:40:23 +01:00
lunar-mining
c522218159 poll: bug fix on external_addr parsing
let external_addr = addr.as_str().unwrap()

^ this line was crashing when we receive a Null value for external_addr.
we now set the string value to "Null" if external_addr.is_null()
2022-03-11 08:32:12 +01:00
Dastan-glitch
ea4261007b bin/tau-cli: switch assign and project to vectors 2022-03-10 23:06:12 -05:00
Dastan-glitch
15890f4d65 bin/tau-cli: reading title and desc from user input if not specified in the command 2022-03-10 22:55:51 -05:00
ghassmo
ab52c593e0 bin/taud: Runs the executor when start 2022-03-11 01:07:35 +04:00
Dastan-glitch
3c05ed70fc bin/tau-cli: remove Client struct and imple and adding optional feature on some subcommands 2022-03-10 16:38:13 -05:00
Dastan-glitch
faf1bd67fb bin/tau-cli: implement add function 2022-03-10 11:27:13 -05:00
aggstam
2bb8a921b1 doc/architecture/blockchain.md: fixed typos 2022-03-10 15:08:17 +02:00
lunar-mining
827062ff96 ui: render Outbound, Inbound, and Manual connection data
created seperate functions to render the different data types.  frames
dynamically resize according to the length of the data.  we do this by
keeping track of the previous length and passing it into each new render.

there's a lot of boilerplate rn that needs to be cleaned up, and the
dynamic resizing can probably be further simplified.
2022-03-10 13:54:09 +01:00
lunar-mining
69161945d9 stop passing Config to ui::ui
NodeId is read from config and is initalized into Model.
The values from Model are then copied into View.

We therefore do not need to read this data in the UI, as it already exists in View.
2022-03-10 13:54:09 +01:00
lunar-mining
4dd9bc00d7 poll: initalize node_info HashMap and pass parsed values.
node_info = HashMap<NodeId, NodeInfo>

If we receive an external addr from the rpc data, we set that as the NodeID.
otherwise we display client's rpc port as the NodeID.

Note: this is a temporary solution until we add a 'name' param to the
config. This commit indicates a number of TODOs.
2022-03-10 13:54:09 +01:00
aggstam
c75a1abcd5 doc/architecture/blockchain.md: Added appendix with structures details. 2022-03-10 14:40:47 +02:00
mohab
d21b026972 [doc/architecture] replaced leaky beacon with leaky non-resettable beacon discussed in praos section 5.2 2022-03-10 13:24:51 +02:00
ghassmo
1496842f75 bin/taud: clean up add function 2022-03-10 01:58:19 +04:00
ghassmo
fba1b48951 bin/taud: implement add function 2022-03-09 23:02:01 +04:00
mohab
c37d17885d [doc/architecture] updated blockchain.md 2022-03-09 21:01:16 +02:00
ghassmo
72c1d516ad bin/taud: load config file & add cli functions 2022-03-09 21:22:08 +04:00
ghassmo
d66d56f268 rpc/jsonrpc: proper way to convert Url to SocketAddr 2022-03-09 20:11:15 +04:00
ghassmo
f13d58d7d0 bin/ircd: add tmux session to run local nodes 2022-03-09 18:45:13 +04:00
ghassmo
d42f9b9863 bin/taud: make base structs 2022-03-09 18:39:49 +04:00
ghassmo
241375e519 bin/taud: minor changes & clean up 2022-03-09 18:05:17 +04:00
ghassmo
eb6db85d4c bin/ircd: make script directory 2022-03-09 17:49:21 +04:00
ghassmo
77a52ea0fe bin/ircd: run four executor threads 2022-03-09 17:49:21 +04:00
ghassmo
947282debc Makefile: check sql in script/sql 2022-03-09 17:49:21 +04:00
aggstam
eb2342d424 script/research/streamlet_rust: Block signature encoding modified 2022-03-09 15:22:44 +02:00
Dastan-glitch
657f8ec806 formatting 2022-03-09 10:22:46 -05:00
Dastan-glitch
24798b0a81 update Cargo.toml and Cargo.lock 2022-03-09 10:21:07 -05:00
Dastan-glitch
7c3810021f Add tau-cli in bin/ 2022-03-09 10:20:25 -05:00
Dastan-glitch
1a59f443f7 Add taud in bin/ with a simple cmd_add as an example on rpc 2022-03-09 10:20:05 -05:00
lunar-mining
70819883e2 poll: parse json data into Model structs
as the values may be null we cannot parse using this form:

    let foo: Foo = serde_json::from_value(bar)

manual_connect is the exception to this as right now we are just parsing
dummy data which is never null.

otherwise if the data is empty we simply write empty values to NodeInfo.
this will be rendered as Null in ui::ui()
2022-03-09 12:09:18 +01:00
lunar-mining
ab7650e3e0 model: created new data structures to handle p2p data
this change removes the struct called Connection and introduces ManualInfo, OutboundInfo and InboundInfo structs
2022-03-09 08:45:37 +01:00
lunar-mining
a3a8112f2e make DnvConfig a seperate crate and pass to ui 2022-03-09 08:45:37 +01:00
lunar-mining
0fadfe39d1 renamed MapConfig to DnvConfig and pass to render() 2022-03-09 08:45:37 +01:00
lunar-mining
b91955c151 cleaned up old comments and simplified run_rpc() 2022-03-09 08:45:36 +01:00
narodnik
a068ff2da9 add mdbook-katex to doc/README.md 2022-03-08 19:28:16 +01:00
parazyd
28510c2e5b book: Add blockchain.md to summary. 2022-03-08 19:16:17 +01:00
ghassmo
bcd4dcc2ee src/net: use to_string from Display trait for OutboundState and P2pState enums 2022-03-08 21:27:30 +04:00
ghassmo
573b858e67 rpc/jsonrpc: minor change 2022-03-08 21:24:16 +04:00
ghassmo
f41ca32e76 src/net: remove warning msg 2022-03-08 20:08:46 +04:00
ghassmo
860b2cf324 move sql to script dir 2022-03-08 19:55:25 +04:00
mohab
e9f3d2901b [doc/architecture] added missing raw in block 2022-03-08 16:39:51 +02:00
parazyd
d84f4c21b0 book: Move namespace from book to doc. 2022-03-08 10:55:16 +01:00