Skip to content
This repository was archived by the owner on Sep 25, 2023. It is now read-only.

Commit 5e4fdb0

Browse files
authored
Merge pull request #4 from gitsrc/main
IceFireDB - IceFireDB Team
2 parents 220cb36 + b497d24 commit 5e4fdb0

File tree

353 files changed

+72933
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

353 files changed

+72933
-0
lines changed

IceFireDB-IceFireDB/3.1.png

1.73 MB
Loading

IceFireDB-IceFireDB/3.2.png

1.78 MB
Loading

IceFireDB-IceFireDB/3.3.png

1.8 MB
Loading
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# ---> Go
2+
# Compiled Object files, Static and Dynamic libs (Shared Objects)
3+
.idea
4+
.DS_Store
5+
.vscode
6+
bin
7+
build
8+
*.o
9+
*.a
10+
*.so
11+
12+
# Folders
13+
_obj
14+
_test
15+
16+
# Architecture specific extensions/prefixes
17+
*.[568vq]
18+
[568vq].out
19+
20+
*.cgo1.go
21+
*.cgo2.c
22+
_cgo_defun.c
23+
_cgo_gotypes.go
24+
_cgo_export.*
25+
26+
_testmain.go
27+
28+
*.exe
29+
*.test
30+
*.prof
31+
32+
vendor
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# Contributing to [PROJECT'S NAME]
2+
3+
## Create an issue
4+
5+
- If you've encountered a bug, open a [Bug Report](https://github.com/PoCInnovation/$REPOSITORY/issues/new?assignees=&labels=&template=bug_report.md&title=).
6+
- If you want [PROJECT'S NAME] to have a new fonctionality, open a [Feature Request](https://github.com/PoCInnovation/$REPOSITORY/issues/new?assignees=&labels=&template=feature_request.md&title=).
7+
8+
## Resolve an issue
9+
10+
Select an [issue](https://github.com/PoCInnovation/$REPOSITORY/issues) that you want to resolve.
11+
12+
The recommended workflow is to fork this repository and open pull requests from your fork.
13+
14+
### 1. Fork, clone & configure [PROJECT'S NAME] upstream
15+
16+
- Click on the _Fork_ button on GitHub
17+
- Clone the original repository
18+
- Add your repository as a new remote
19+
20+
```sh
21+
# Clone original repository
22+
git clone git@github.com:PoCInnovation/$REPOSITORY.git
23+
24+
# Add your fork as a remove
25+
git remote add <fork_name> https://github.com/$YOUR_GITHUB_USER/$REPOSITORY.git
26+
```
27+
28+
### 2. Create a pull request
29+
30+
```sh
31+
# Create a new branch
32+
git checkout -b my_branch
33+
34+
# Make changes to your branch
35+
# ...
36+
37+
# Commit changes - remember to sign!
38+
git commit -s
39+
40+
# Push your new branch
41+
git push <fork name>
42+
43+
# Create a new pull request from https://github.com/PoCInnovation/$REPOSITORY/pulls
44+
```
45+
46+
### 3. Update your pull request with latest changes
47+
48+
```sh
49+
# Checkout main branch
50+
git checkout main
51+
52+
# Pull origin's change
53+
git pull
54+
55+
# Checkout your branch
56+
git checkout my_branch
57+
58+
# Rebase your branch changes on top of the updated main branch
59+
git rebase main
60+
61+
# Update your pull request with latest changes
62+
git push -f <fork name>
63+
```
64+
65+
## Commits
66+
67+
### DCO
68+
69+
Contributions to this project must be accompanied by a Developer Certificate of
70+
Origin (DCO).
71+
72+
All commit messages must contain the Signed-off-by line with an email address that matches the commit author. When commiting, use the `--signoff` flag:
73+
74+
```sh
75+
git commit -s
76+
```
77+
78+
The Signed-off-by line must match the **author's real name**, otherwise the PR will be rejected.
79+
80+
### Commit messages
81+
82+
Please read first this article : [How to Write a Git Commit Message](https://chris.beams.io/posts/git-commit/).
83+
84+
Then, follow these guidelines:
85+
86+
- **Group Commits:** Each commit should represent a meaningful change. Instead, these commits should be squashed together into a single "Add Feature" commit.
87+
> For instance, a PR should not look like :
88+
> - 1) Add Feature X
89+
> - 2) Fix Typo
90+
> - 3) Changes to features X
91+
> - 5) Bugfix for feature X
92+
> - 6) Fix Linter 7)
93+
> - ...
94+
95+
- Each commit should **work on its own**: it must compile, pass the linter and so on.
96+
> This makes life much easier when using `git log`, `git blame`, `git bisect`, etc...\
97+
> For instance, when doing a `git blame` on a file to figure out why a change was introduced, it's pretty meaningless to see a _Fix linter_ commit message. "Add Feature X" is much more meaningful.
98+
99+
- Use `git rebase -i main` to group commits together and rewrite their commit message
100+
101+
- To add changes to the previous commit, use `git commit --amend -s`. This will change the last commit (amend) instead of creating a new commit.
102+
103+
- Format: Use the imperative mood in the subject line: "If applied, this commit
104+
will _your subject line here_"
105+
106+
- Add the following prefixes to your commit message to help trigger [automated processes](https://www.conventionalcommits.org):
107+
- `docs:` for documentation changes only (e.g., `docs: Fix typo in X`);
108+
- `test:` for changes to tests only (e.g., `test: Check if X does Y`);
109+
- `chore:` general things that should be excluded (e.g., `chore: Clean up X`);
110+
- `ci:` for internal CI specific changes (e.g., `ci: Enable X for tests`);
111+
112+
> Made with :heart: by PoC
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM alpine
2+
3+
WORKDIR /root
4+
5+
COPY bin/redisproxy /root/redisproxy
6+
COPY config/config.yaml /root/config/config.yaml
7+
8+
9+
CMD /root/redisproxy -c /root/config/config.yaml

IceFireDB-IceFireDB/IceFireDB-Decentralization-Pubsub/LICENSE

Whitespace-only changes.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
PROG=bin/Icefiredb-proxy
2+
3+
4+
SRCS=./cmd/proxy
5+
6+
7+
# git commit hash
8+
COMMIT_HASH=$(shell git rev-parse --short HEAD || echo "GitNotFound")
9+
10+
# Compile the date
11+
BUILD_DATE=$(shell date '+%Y-%m-%d %H:%M:%S')
12+
# compile
13+
CFLAGS = -ldflags "-s -w -X \"main.BuildVersion=${COMMIT_HASH}\""
14+
15+
GOPROXY=https://goproxy.cn,direct
16+
17+
all:
18+
if [ ! -d "./bin/" ]; then \
19+
mkdir bin; \
20+
fi
21+
GOPROXY=$(GOPROXY) GOOS=linux GOARCH=amd64 go build $(CFLAGS) -o $(PROG) $(SRCS)
22+
23+
# Compiling the RACE version
24+
race:
25+
if [ ! -d "./bin/" ]; then \
26+
mkdir bin; \
27+
fi
28+
GOPROXY=$(GOPROXY) go build $(CFLAGS) -race -o $(PROG) $(SRCS)
29+
30+
clean:
31+
rm -rf ./bin
32+
33+
run:
34+
GOPROXY=$(GOPROXY) go run --race cmd/proxy/main.go -c config/config.yaml
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# [IceFireDB-Decentralization-Pubsub]
2+
3+
IceFireDB Decentralization Pubsub是一个高性能、高可用性和去中心化订阅系统。
4+
5+
它可以无缝地将使用redis发布和订阅的web2应用程序迁移到去中心化p2p订阅网络中
6+
7+
## How does it work?
8+
9+
### 场景介绍
10+
<img width="1070" alt="image" src="https://user-images.githubusercontent.com/52234994/173174080-95775add-c287-4f43-943b-686b903e67b7.png">
11+
12+
### 系统架构
13+
<img width="1061" alt="image" src="https://user-images.githubusercontent.com/52234994/173174090-7c2f084b-4ccc-4c56-983b-210486f13a60.png">
14+
15+
该应用程序适用于同一网络或不同网络上的多个节点。专用网络上NAT后面的节点可以相互通信。使用Kademlia DHT和IPFs网络发现对等发现和路由。通过支持redis pub-sub协议,构建了一个全局分布式Web3发布-订阅系统。
16+
17+
您可以像使用redis发布订阅功能一样使用它。
18+
19+
## Getting Started
20+
21+
### Configuration
22+
23+
在config目录中,用户存放项目配置文件,文件名:config.yaml,可根据自身需要进行修改
24+
25+
```yaml
26+
# 项目代理配置
27+
proxy:
28+
local_port: 16379
29+
enable_mtls: false
30+
31+
# p2p 配置
32+
p2p:
33+
enable: true
34+
35+
...
36+
```
37+
38+
### Quickstart
39+
40+
https://user-images.githubusercontent.com/52234994/173171008-8c73ce17-4ba7-42ec-8257-025e98d2e647.mp4
41+
42+
直接运行二进制文件,如果需要在后台运行可以添加到systemd系统管理中
43+
```shell
44+
$ make
45+
$ ./bin/Icefiredb-proxy -c ./config/config.yaml
46+
```
47+
48+
### Usage
49+
IceFireDB 订阅系统主要用法为两个命令:SUBSCRIBE 和 PUBLISH,主要实现在[pubsub](./pkg/router/redisNode/ppubsub.go)
50+
51+
可以根据需求,进行二次开发,或者增加其他指令。
52+
53+
SUBSCRIBE
54+
```shell
55+
$ redis-cli
56+
127.0.0.1:16379> SUBSCRIBE name
57+
...
58+
...
59+
```
60+
PUBLISH
61+
```shell
62+
$ redis-cli
63+
127.0.0.1:16379> PUBLISH name hello
64+
...
65+
...
66+
```
67+
68+
## License
69+
Icefiredb代理使用Apache 2.0许可证。请参见 [LICENSE](./LICENSE) directory for details.
70+
71+
## 免责声明
72+
当您使用本软件时,您已同意并声明本软件的作者、维护者和贡献者不对您遇到的任何风险、成本或问题负责。如果发现软件缺陷或BUG,请提交补丁以帮助改进!

IceFireDB-IceFireDB/IceFireDB-Decentralization-Pubsub/blank

Whitespace-only changes.

0 commit comments

Comments
 (0)