Git Product home page Git Product logo

gitbitex-new's Introduction

GitBitEX is an open source cryptocurrency exchange.

微信图片_20220417184255

Features

  • All in memory matching engine
  • Support distributed deployment (standby mode:only one matching engine is running at the same time)
  • Support 100000 orders per second (Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz 3.79 GHz 32.0 GB RAM 1T SSD)
  • Support the replay of matching engine commands and ensure that each result is completely consistent

Architecture

gitbitex-architecture

Quick Start

Prerequisites

127.0.0.1       mongo1
127.0.0.1       mongo2
127.0.0.1       mongo3

Run

git clone https://github.com/gitbitex/gitbitex-new.git
cd gitbitex-new
docker compose up -d
mvn clean package -Dmaven.test.skip=true
cd target
java -jar gitbitex-0.0.1-SNAPSHOT.jar
#visit http://127.0.0.1/

FAQ

How do i add new product (currency pair)?

curl -X PUT -H "Content-Type:application/json" http://127.0.0.1/api/admin/products -d '{"baseCurrency":"BTC","quoteCurrency":"USDT"}'

Does the project include blockchain wallets?

No, you need to implement it yourself, and then connect to gitbiex. For example, after users recharge/withdraw, send DepositCommand/WithdrawalCommand to the matching engine

Can I use this project for production?

Probably not. Some customers I know use this project in production, but they all have professional technicians. If you want to use it in production, you need professional technicians to help you. Like me .

How can I monitor the performance of the matching engine?

Some prometheus metrics for measuring performance have been built into the project. You can visit http://127.0.0.1:7002/actuator/prometheus see.You can use Prometheus and grafana to monitor. The metrics are as follows:

  • gbe_matching_engine_command_processed_total : The number of commands processed by the matching engine. The greater the value change, the faster the processing.
  • gbe_matching_engine_modified_object_created_total : This value represents the number of objects that have modified,Wait to save to database.
  • gbe_matching_engine_modified_object_saved_total : The number of modified objects that have been saved. If the difference between this value and gbe_matching_engine_modified_object_created_total is too large, it means that saving to disk is too slow.
  • gbe_matching_engine_snapshot_taker_modified_objects_queue_size : Objects that have not been written to the snapshot. This value reflects the performance of the snapshot thread.

Where is the API document?

http://127.0.0.1/swagger-ui/index.html#/

Web code

https://github.com/gitbitex/gitbitex-web

Contact Me

gitbitex-new's People

Contributors

cloud-market avatar dependabot[bot] avatar greensheng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gitbitex-new's Issues

Liquidity Flow Process

I'm running the docker, match engine flow working fine.
My query was are you using any Liquidity Provider API to stream the Liquidity process functionalities or not ?
If you used the Liquidity provider means, what are steps to follow it in the source code process and if any sql setup need or not for the liquidity flow.
And kindly let me know, this code setup can be suitable for Liquidity streaming or not ?

How to setup the project?

The project is great, and I was able to deploy it using guide in readme. But now setup is required, to make all the functions work, and have no idea where to find references. Are they avaliable anywhere?

I don't know how to connect wallets (that's why deposit doesn't work, right?), and don't know where I can get APi references(like, there is api code generation, but does it even work?).

Please, tell me at least it works, can't check demo website for some reasons.

Exception in thread "redisson-3-16" java.lang.NullPointerException

I receive the following error on match:

2022-04-24 07:16:06.308  INFO 1 --- [       Accountant-58] com.gitbitex.account.AccountManager      : hold 989962d0-543a-4d4e-bf76-105c6334637f BTC 0.00100000
Exception in thread "redisson-3-16" java.lang.NullPointerException
at com.gitbitex.feed.FeedMessageListener.orderDoneMessage(FeedMessageListener.java:136)
at com.gitbitex.feed.FeedMessageListener.lambda$run$5(FeedMessageListener.java:81)
at org.redisson.PubSubMessageListener.onMessage(PubSubMessageListener.java:79)
at org.redisson.client.RedisPubSubConnection.onMessage(RedisPubSubConnection.java:78)
at org.redisson.client.handler.CommandPubSubDecoder.lambda$enqueueMessage$0(CommandPubSubDecoder.java:179)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:832)

The engineListeners, where and how are they used?

Was trying to understand the code ( I am not much experienced in concurrency). in Bootstrap.java how are the engineListeners being used? we are creating a placeholder for them, but we are not assigning anything to those variables, example
private final ModifiedObjectWriter modifiedObjectWriter;
private final EngineSnapshotTaker engineSnapshotTaker;
private final OrderBookSnapshotTaker orderBookSnapshotTaker;
private final List engineListeners;
Top three classes are clearly not being used, engineListener is being use but it appears to be an empty List. Please guide.

want to know mysql version

Is it possible to use mariaDB in this application. If possible which version would be need.

Let me know is it possible to use mysql 8 in this application.

kafka wrapper error

Hi, I am executing all the steps to launch the project and I find this error in the kafka container

kafka 16:27:27.73 Welcome to the Bitnami kafka container
kafka 16:27:27.73 Subscribe to project updates by watching https://github.com/bitnami/containers
kafka 16:27:27.74 Submit issues and feature requests at https://github.com/bitnami/containers/issues
kafka 16:27:27.74
kafka 16:27:27.74 INFO ==> ** Starting Kafka setup **
kafka 16:27:27.78 ERROR ==> KRaft requires KAFKA_CFG_NODE_ID to be set for the quorum controller
/opt/bitnami/scripts/libkafka.sh: line 258: KAFKA_CFG_NODE_ID: unbound variable

Has the same thing happened to anyone else? I was reading and in this bitnami/containers#33271 they give an answer but I don't see those variables in the docker-compose.yaml file to try to change it and see if that solves the problem.

Roadmap, features etc.

It would be awesome to see what is done and what is to come. Some kind of a checkbox feature list in the readme file.

As example, I have seen that there was some work done on fee, base_max_size, base_min_size and order types like GTC, FOK etc. Some might be easy to implement while others aren't. I am not sure if there is a lot of community interest and if you are willing to accept PRs for certain planned features?

Also do you have any benchmark or maybe a diagram like in the old repo? What information is redis storing?

Orders Page Not Updating With Database

Hello, First of all great work ! one small thing I noticed is the orders pages is not dynamic, when I add another market it indeed creates a new page for it but I cannot see the orders of that new market.
Best Regards !

Candles

http://127.0.0.1/api/products/BTC-USDT/candles?granularity=60 is returning candles of interval 1, or 60 seconds? Your granularity parameter is in seconds? I believe this is typically expressed as 1 (for 1 minute) 15 (for 15 minutes) 30, 60,120,240, 1440 (a day). I can resample the candles from one minute but I will have to query the candle maker every 6 hours and store the candles in a separate database.

As such the return of 1000 rows typically won't even cover a whole day and isn't very usefull on candle charts. At 1 hour intervals this will be less than 24 candles, which is not very usefull as "historical" data.

error in running with docker

Hello i have done all of docker instructions and commands. but still project does not available in my localhost. is there any instructions/command which i should to do? something like installing java requirements, jdk and ...?

How to start Kafka?

org.apache.kafka.clients.NetworkClient : [Consumer clientId=consumer-Trade1-3, groupId=Trade1] Connection to node -1 (localhost/127.0.0.1:19092) could not be established. Broker may not be available.

Build Issue - Java Match Engine

I configure the mentioned dependencies as in the README file in my local. After I trying to compile, it throws the error of invalid target.
Kindly let me know, if I was missed any configuarations or dependencies or any other steps to be followed or any other updated source available from your end, let me know. Hereby I attached the error screenshot for your reference.

image

Matching engine

I see that you load all accounts from the database when you run the matching engine, right? Is it broken when you have a lot of users?

this.accountCollection
                .find()
                .into(new ArrayList<>());

Wallet.

Hello! Has anyone sold a wallet on an exchange? Tell me how?

Docker file missing in the project, manual install how to

I need a manual install how to(no Docker), just like the old Gitbitex had. Maybe the Docker file could do it for me but i could not find it available in the project.

Is the architecture exactly the same as the old Gitbitex? If not, could someone post a chart with the updated one?

As a personal project i want to try to translate Gitbitex to another language, Perl. But i need that info to start!

Out of curiosity, what is the reasoning for the change from Go to Java?

setting up project

Hello, I made all steps from README
After docker ps I can see
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0c10591a37ba greensheng/gitbitex "java -XX:ErrorFile=…" 45 seconds ago Up 44 seconds gitbitex
93b3fce13d89 mysql:5.7 "docker-entrypoint.s…" 16 minutes ago Up 16 minutes mysql
5663e375b58f redis "docker-entrypoint.s…" 16 minutes ago Up 16 minutes redis-server
aa1feba79f7d bitnami/kafka:latest "/opt/bitnami/script…" 17 minutes ago Up 17 minutes kafka-server
6f6ab3a5f2ee bitnami/zookeeper:latest "/opt/bitnami/script…" 18 minutes ago Up 18 minutes zookeeper-server

I have everything running, still nothing on https://127.0.0.1/trade/BTC-USDT, looks like app doesn't run. Any suggestions? Thanks a lot!

Also another small question: I found you had a Golang project repo which is abandoned. Is it working? Is there some issues with it or any reasons it should not be used? Thanks!

API incomplete and largely non functional.

I can create a user (only through the admin API interface), but then am unable to sign that user in.

curl --location 'http://192.168.20.223/api/admin/[email protected]&password=password1'

{"id":"2d9e30b1-34f0-493a-b959-d4f8f97fb3e0","createdAt":null,"updatedAt":null,"email":"[email protected]","passwordHash":"f6fcb6c41e0c09a9112544a61b2913d7","passwordSalt":"7c45700c-0fe0-4448-b227-8c886bcd2078","twoStepVerificationType":null,"gotpSecret":null,"nickName":null}

curl --location 'http://192.168.20.223/api/users/accessToken'
--header 'Content-Type: application/json'
--data-raw '{
"SignInRequest": {
"email": "[email protected]",
"password": "password1"
}
}'

{
"message": "401 UNAUTHORIZED "email or password error""
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.