diff --git a/Cargo.lock b/Cargo.lock index d7a7bc87f..e4be8184c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3929,7 +3929,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7fa7e55043acb85fca6b3c01485a2eeb6b69c5d21002e273c79e465f43b7ac1" [[package]] -name = "tau-cli" +name = "tau" version = "0.3.0" dependencies = [ "async-channel", diff --git a/doc/src/SUMMARY.md b/doc/src/SUMMARY.md index d67098296..9f8da54c5 100644 --- a/doc/src/SUMMARY.md +++ b/doc/src/SUMMARY.md @@ -17,3 +17,5 @@ - [Anonymous voting](zkas/examples/voting.md) - [Miscellaneous tools](misc/misc.md) - [vanityaddr](misc/vanityaddr.md) + - [ircd](misc/ircd.md) + - [tau](misc/tau.md) diff --git a/doc/src/misc/ircd.md b/doc/src/misc/ircd.md new file mode 100644 index 000000000..b7c2ae253 --- /dev/null +++ b/doc/src/misc/ircd.md @@ -0,0 +1,93 @@ +# p2p IRC + +This is a local daemon which can be attached to with any IRC frontend. +It uses the darkfi p2p engine to synchronize chats between hosts. + + +## Install + +```shell +% git clone https://github.com/darkrenaissance/darkfi +% cd darkfi +% make BINS=ircd +% make install BINS=ircd PREFIX=/home/XX/.local +``` + +## Usage (Local Deployment) + +### Seed Node + +First you must run a seed node. The seed node is a static host which nodes can +connect to when they first connect to the network. The `seed_session` simply +connects to a seed node and runs `protocol_seed`, which requests a list of +addresses from the seed node and disconnects straight after receiving them. + + in config file: + + ## P2P accept address + inbound="127.0.0.1:11001" + +Note that the above config doesn't specify an external address since the +seed node shouldn't be advertised in the list of connectable nodes. The seed +node does not participate as a normal node in the p2p network. It simply allows +new nodes to discover other nodes in the network during the bootstrapping phase. + +### Inbound Node + +This is a node accepting inbound connections on the network but which is not +making any outbound connections. + +The external address is important and must be correct. + + in config file: + + ## P2P accept address + inbound="127.0.0.1:11002" + + ## P2P external address + external_addr="127.0.0.1:11002" + + ## Seed nodes to connect to + seeds=["127.0.0.1:11001"] + +### Outbound Node + +This is a node which has 8 outbound connection slots and no inbound connections. +This means the node has 8 slots which will actively search for unique nodes to +connect to in the p2p network. + + in config file: + + ## Connection slots + outbound_connections=5 + + ## Seed nodes to connect to + seeds=["127.0.0.1:11001"] + +### Attaching the IRC Frontend + +Assuming you have run the above 3 commands to create a small model testnet, +and both inbound and outbound nodes above are connected, you can test them +out using weechat. + +To create separate weechat instances, use the `--dir` command: + + weechat --dir /tmp/a/ + weechat --dir /tmp/b/ + +Then in both clients, you must set the option to connect to temporary servers: + + /set irc.look.temporary_servers on + +Finally you can attach to the local IRCd instances: + + /connect localhost/6667 + /connect localhost/6668 + +And send messages to yourself. + +### Running a Fullnode + +See the script `script/run_node.sh` for an example of how to deploy a full node which +does seed session synchronization, and accepts both inbound and outbound +connections. diff --git a/doc/src/misc/tau.md b/doc/src/misc/tau.md new file mode 100644 index 000000000..dd0130f08 --- /dev/null +++ b/doc/src/misc/tau.md @@ -0,0 +1,96 @@ +# Tau + +Tasks management app using peer-to-peer network and raft consensus. +multiple users can collaborate by working on the same tasks, and all users will have synced task list. + + +## Install + +```shell +% git clone https://github.com/darkrenaissance/darkfi +% cd darkfi +% make BINS="taud tau" +% make install "BINS=taud tau" PREFIX=/home/XX/.local +``` + +## Usage (Local Deployment) + +### Seed Node + +First you must run a seed node. The seed node is a static host which nodes can +connect to when they first connect to the network. The `seed_session` simply +connects to a seed node and runs `protocol_seed`, which requests a list of +addresses from the seed node and disconnects straight after receiving them. + + in config file: + + ## P2P accept address + inbound="127.0.0.1:11001" + +Note that the above config doesn't specify an external address since the +seed node shouldn't be advertised in the list of connectable nodes. The seed +node does not participate as a normal node in the p2p network. It simply allows +new nodes to discover other nodes in the network during the bootstrapping phase. + +### Inbound Node + +This is a node accepting inbound connections on the network but which is not +making any outbound connections. + +The external address is important and must be correct. + + in config file: + + ## P2P accept address + inbound="127.0.0.1:11002" + + ## P2P external address + external_addr="127.0.0.1:11002" + + ## Seed nodes to connect to + seeds=["127.0.0.1:11001"] + +### Outbound Node + +This is a node which has 8 outbound connection slots and no inbound connections. +This means the node has 8 slots which will actively search for unique nodes to +connect to in the p2p network. + + in config file: + + ## Connection slots + outbound_connections=5 + + ## Seed nodes to connect to + seeds=["127.0.0.1:11001"] + +## Usage (CLI) + +```shell +% tau --help +``` + + tau 0.3.0 + Tau cli + + USAGE: + tau [OPTIONS] [SUBCOMMAND] + + OPTIONS: + -h, --help Print help information + --listen Rpc address [default: 127.0.0.1:8875] + -v Increase verbosity + -V, --version Print version information + + SUBCOMMANDS: + add Add a new task + get Get task by ID + get-comment Get task's comments + get-state Get task state + help Print this message or the help of the given subcommand(s) + list List open tasks + set-comment Set comment for a task + set-state Set task state + update Update/Edit an existing task by ID + + diff --git a/doc/test-irc.txt b/doc/test-irc.txt deleted file mode 100644 index 196599cc3..000000000 --- a/doc/test-irc.txt +++ /dev/null @@ -1,34 +0,0 @@ -In a random terminal run the seed node: - - cargo run --bin ircd -- --accept 127.0.0.1:9999 --log /tmp/seed.log --irc 127.0.0.1:6699 - -In two other terminals run first the server: - - cargo run --bin ircd -- --accept 127.0.0.1:10005 --seeds 127.0.0.1:9999 --log /tmp/server.log --irc 127.0.0.1:6688 - -And a client node: - - cargo run --bin ircd -- --slots 1 --seeds 127.0.0.1:9999 --log /tmp/client.log --irc 127.0.0.1:6667 - -Then you now need to open two weechat instances. - -First just run weechat and make sure temporary connections option is set: - - /set irc.look.temporary_servers on - -To run a second weechat instance, use the --dir option - - weechat --dir /tmp/ - -And also set temporary servers for this instance as well: - - /set irc.look.temporary_servers on - -Now connect to both nodes (in each weechat instance) using: - - /connect localhost - - /connect localhost/6688 - -Now you can message between them both. -