Skip to content

Commit ca218eb

Browse files
committed
Added README.md and docs
1 parent a3538e6 commit ca218eb

7 files changed

+490
-0
lines changed

CONTRIBUTING.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Contributing to java-mcashchain
2+
3+
java-mcashchain is an open source project.
4+
5+
It is the work of contributors. We appreciate your help!
6+
7+
Here are instructions to get you started. They are not perfect, so
8+
please let us know if anything feels wrong or incomplete.
9+
10+
## Contribution guidelines
11+
12+
### Pull requests
13+
14+
First of all, java-mcashchain follows [gitflow workflow](
15+
https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow).
16+
Please open pull requests to the **develop** branch. Once approved,
17+
we will close the pull request and merge into master branch.
18+
19+
We are always happy to receive pull requests, and do our best to
20+
review them as fast as possible. Not sure if that typo is worth a pull
21+
request? Do it! We would appreciate it.
22+
23+
If your pull request is not accepted on the first try, don't be
24+
discouraged as it can be a possible oversight. Please explain your code as
25+
detailed as possible to make it easier for us to understand.
26+
27+
### Create issues
28+
29+
Any significant improvement should be documented as [a GitHub
30+
issue](https://github.com/MidasCore/java-mcashchain/issues) before anyone
31+
starts working on it.
32+
33+
When filing an issue, make sure to answer these three questions:
34+
35+
- What did you do?
36+
- What did you expect to see?
37+
- What did you see instead?
38+
39+
### Please check existing issues and docs first!
40+
41+
Please take a moment to check that your bug report or improvement proposal
42+
doesn't already exist. If it does, please add a quick "+1" or "I have this problem too".
43+
This will help prioritize the most common problems and requests.

README.md

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
<h4 align="center">
2+
Java implementation of the <a href="https://mcash.network">Mcashchain</a>
3+
</h4>
4+
5+
<p align="center">
6+
<a href="https://t.me/McashchainDeveloper">
7+
<img src="https://img.shields.io/badge/chat-on%20discord-brightgreen.svg">
8+
</a>
9+
10+
<a href="https://github.com/MidasCore/java-mcashchain/issues">
11+
<img src="https://img.shields.io/github/issues/MidasCore/java-mcashchain.svg">
12+
</a>
13+
14+
<a href="https://github.com/MidasCore/java-mcashchain/pulls">
15+
<img src="https://img.shields.io/github/issues-pr/MidasCore/java-mcashchain.svg">
16+
</a>
17+
18+
<a href="https://github.com/MidasCore/java-mcashchain/graphs/contributors">
19+
<img src="https://img.shields.io/github/contributors/MidasCore/java-mcashchain.svg">
20+
</a>
21+
22+
<a href="LICENSE">
23+
<img src="https://img.shields.io/github/license/MidasCore/java-mcashchain.svg">
24+
</a>
25+
</p>
26+
27+
<p align="center">
28+
<a href="#deploy">Deploy</a> •
29+
<a href="#developer-community">Community</a> •
30+
<a href="http://developers.tron.network">Documentation</a> •
31+
<a href="#contributing">Contributing</a> •
32+
<a href="#projects">Projects</a> •
33+
<a href="#resource">Resource</a>
34+
</p>
35+
36+
## MCashChain?
37+
38+
MCashChain aims to provide a solution for one of our ambitious projects which aims to challenge Ebay’s Model on Blockchain. As we all know, the lengthy block confirmation time and the high gas price have made it a great challenge to auction, bid or make use of the smart contracts. Moreover, the greater adoption of cryptocurrencies require the public blockchain to achieve high throughput at low fees to enable micropayment for E-commerce and high speed for online decentralized gaming experience. We are working towards a blockchain-based
39+
40+
#### Main features:
41+
* Instant transfer with LightningSend™
42+
* Block time 3 seconds
43+
* Zero fees
44+
* 64 Supernodes for 40% p.a average ROI
45+
* Unlimited 4 level staking nodes 30% p.a average ROI
46+
* Monitoring and real time reward settlement on Midas Wallet
47+
* Crosschain swap enable on Unidex
48+
* MCash dApp Studio - 1st IDE for intuitive dapp programming
49+
50+
# Deploy
51+
* [Build](doc/build.md) Build java-mcashchain
52+
* [Run](doc/run.md) Run java-mcashchain
53+
54+
# Community
55+
56+
* [Developer Telegram group](https://t.me/McashchainDeveloper) Please join our Developer Telegram group
57+
* [Global Telegram group](https://t.me/Mcashchain) Please join our Global Telegram group
58+
59+
# Projects
60+
* [Mcashchain Java implementation](https://github.com/MidasCore/java-mcashchain)
61+
* [Wallet Web - Chrome/Brave extension](https://chrome.google.com/webstore/detail/loiopaejobjggipodncmajcmdolegdan)
62+
* [Wallet Android app](https://play.google.com/store/apps/details?id=com.midasprotocol.wallet.android)
63+
* [Wallet IOS app](https://itunes.apple.com/us/app/midas-protocol-crypto-wallet/id1436698193)
64+
65+
# Resource
66+
* [Website](https://mcash.network/)
67+
* [Documentation](https://github.com/MidasCore/mcashchain/wiki)
68+
* [Blog](https://medium.com/mcashchain)
69+
* [Mcashscan](https://mcashscan.io/)
70+
* [White Paper 0.8.3](http://bit.ly/mcashchain-wp-graphic)
71+
* [Mcashchain Quickstart](https://github.com/MidasCore/mcashchain/wiki/getting-started-1)
72+
* [About](https://mcash.network/about)
73+
* [FAQ](https://mcash.network/faq)
74+
75+
# Contributing
76+
Thank you for all of [our contributors](https://github.com/MidasCore/java-mcashchain/graphs/contributors); this project wouldn’t be what it is without you! If you want to help out, please see [CONTRIBUTING.md](CONTRIBUTING.md).
77+
78+
If you'd like to contribute to java-mcashchain, please fork, fix, commit and send a pull request for the maintainers to review and merge into the main code base.
79+
If you wish to submit more complex changes though, please check up with the core devs first on [our telegram channel](https://t.me/McashchainDeveloper) to ensure those changes are
80+
in line with the general philosophy of the project and/or get some early feedback which can make both your efforts much lighter as well as our review and merge procedures quick and simple.
81+
82+
# License
83+
* [LGPL-3.0](https://github.com/MidasCore/java-mcashchain/blob/master/LICENSE)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Deployment of SolidityNode and FullNode on the same host
2+
3+
Create separate directories for fullnode and soliditynode
4+
```
5+
/deploy/fullnode
6+
/deploy/soliditynode
7+
```
8+
9+
Create two folders for fullnode and soliditynode.
10+
11+
Clone our latest master branch of https://github.com/MidasCore/java-mcashchain and extract it to
12+
```
13+
/deploy/java-mcashchain
14+
```
15+
16+
Make sure you have the proper dependencies.
17+
18+
* JDK 1.8 (JDK 1.9+ is not supported yet)
19+
* On Linux Ubuntu system (e.g. Ubuntu 16.04.4 LTS), ensure that the machine has [__Oracle JDK 8__](https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-get-on-ubuntu-16-04), instead of having __Open JDK 8__ in the system. If you are building the source code by using __Open JDK 8__, you will get [__Build Failed__](https://github.com/MidasCore/java-mcashchain/issues/337) result.
20+
* Open **UDP** ports for connection to the network
21+
* **MINIMUM** 2 CPU Cores
22+
23+
## Deployment guide
24+
25+
1. Build the java-mcashchain project
26+
```
27+
cd /deploy/java-mcashchain
28+
./gradlew build
29+
```
30+
31+
2. Copy the FullNode.jar and SolidityNode.jar along with config files into the respective directories.
32+
```
33+
download your needed config file from https://github.com/MidasCore/java-mcashchain/tree/master/src/main/resources.
34+
config.conf is the config for mainnet, and config-testnet.conf is the config for testnet.
35+
please rename the config file to `config.conf` and use this config.conf to start fullnode and soliditynode.
36+
37+
cp build/libs/FullNode.jar ../fullnode
38+
cp build/libs/SolidityNode.jar ../soliditynode
39+
```
40+
41+
3. You can now run your Fullnode using the following command:
42+
```
43+
java -jar FullNode.jar -c config.conf // make sure that you download the latest version of config.conf from https://github.com/MidasCore/java-mcashchain/releases
44+
```
45+
46+
4. Configure the SolidityNode configuration file. You'll need to edit `config.conf` to connect to your local `FullNode`. Change `trustNode` in `node` to local `127.0.0.1:60061`, which is the default rpc port. Set `listen.port` to any number within the range of 1024-65535. Please don't use any ports between 0-1024 since you'll most likely hit conflicts with other system services. Also change `rpc port` to `60062` or something to avoid conflicts. **Please forward the UDP port 18888 for FullNode.**
47+
```
48+
rpc {
49+
port = 60062
50+
}
51+
```
52+
53+
5. You can now run your SolidityNode using the following command:
54+
```
55+
java -jar SolidityNode.jar -c config.conf // make sure that you download the latest version of config.conf from https://github.com/MidasCore/java-mcashchain/releases
56+
```
57+
58+
# Logging and network connection verification
59+
60+
Logs for both nodes are located in `/deploy/\*/logs/mcashchain.log`. Use `tail -f /logs/mcashchain.log/` to follow along with the block syncing.
61+
62+
You should see something similar to this in your logs for block synchronization:
63+
64+
## FullNode
65+
66+
08:00:30.192 INFO [ClientWorker-3] [i.m.c.n.s.AdvService](AdvService.java:126) Ready to broadcast block Num:378817,ID:000000000005c7c1994715cdc94410877391045061f745303fe48f30e49730cf
67+
08:00:30.195 INFO [ClientWorker-0] [net](MessageQueue.java:98) Receive from /138.197.7.138:11399, type: INVENTORY
68+
invType: BLOCK, size: 1, First hash: 000000000005c7c1994715cdc94410877391045061f745303fe48f30e49730cf
69+
70+
71+
## SolidityNode
72+
73+
20:06:10.866 INFO [Thread-14] [app](SolidityNode.java:142) Get last remote solid blockNum: 0, remoteBlockNum: 0, cost: 4
74+
75+
# Stop node gracefully
76+
Create file stop.sh,use kill -15 to close java-mcashchain.jar(or FullNode.jar、SolidityNode.jar).
77+
You need to modify pid=`ps -ef |grep java-mcashchain.jar |grep -v grep |awk '{print $2}'` to find the correct pid.
78+
```
79+
#!/bin/bash
80+
while true; do
81+
pid=`ps -ef |grep java-mcashchain.jar |grep -v grep |awk '{print $2}'`
82+
if [ -n "$pid" ]; then
83+
kill -15 $pid
84+
echo "The java-mcashchain process is exiting, it may take some time, forcing the exit may cause damage to the database, please wait patiently..."
85+
sleep 1
86+
else
87+
echo "java-mcashchain killed successfully!"
88+
break
89+
fi
90+
done
91+
```

docs/build.md

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# How to Build
2+
3+
## Prepare dependencies
4+
5+
* JDK 1.8 (JDK 1.9+ are not supported yet)
6+
* On Linux Ubuntu system (e.g. Ubuntu 18.04 LTS), ensure that the machine has [__Oracle JDK 8__](https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-get-on-ubuntu-16-04), instead of having __Open JDK 8__ in the system. If you are building the source code by using __Open JDK 8__, you will get [__Build Failed__](https://github.com/MidasCore/java-mcashchain/issues/337) result.
7+
* Open **UDP** ports for connection to the network
8+
* **MINIMUM** 2 ENERGY Cores
9+
10+
## Getting the code with git
11+
12+
* Use Git from the Terminal, see the [Setting up Git](https://help.github.com/articles/set-up-git/) and [Fork a Repo](https://help.github.com/articles/fork-a-repo/) articles.
13+
* develop branch: the newest code
14+
* master branch: more stable than develop.
15+
In the shell command, type:
16+
```bash
17+
git clone https://github.com/MidasCore/java-mcashchain.git
18+
git checkout -t origin/master
19+
```
20+
21+
* For Mac, you can also install **[GitHub for Mac](https://mac.github.com/)** then **[fork and clone our repository](https://guides.github.com/activities/forking/)**.
22+
23+
* If you'd rather not use Git, [Download the ZIP](https://github.com/MidasCore/java-mcashchain/archive/develop.zip)
24+
25+
## Including java-mcashchain as dependency
26+
27+
* If you don't want to checkout the code and build the project, you can include it directly as a dependency
28+
29+
**Using gradle:**
30+
31+
```
32+
repositories {
33+
maven { url 'https://jitpack.io' }
34+
}
35+
dependencies {
36+
implementation 'com.github.MidasCore:java-mcashchain:develop-SNAPSHOT'
37+
}
38+
```
39+
40+
**Using maven:**
41+
42+
```xml
43+
...
44+
<repositories>
45+
<repository>
46+
<id>jitpack.io</id>
47+
<url>https://jitpack.io</url>
48+
</repository>
49+
</repositories>
50+
...
51+
<dependency>
52+
<groupId>com.github.MidasCore</groupId>
53+
<artifactId>java-mcashchain</artifactId>
54+
<version>develop-SNAPSHOT</version><!--You can use any of the tag/branch name available-->
55+
</dependency>
56+
```
57+
58+
59+
60+
61+
## Building from source code
62+
63+
* Build in the Terminal
64+
65+
```bash
66+
cd java-mcashchain
67+
./gradlew build
68+
```
69+
70+
71+
* Build in [IntelliJ IDEA](https://www.jetbrains.com/idea/) (community version is enough):
72+
73+
**Please run ./gradlew build once to build the protocol files**
74+
75+
1. Start IntelliJ. Select `File` -> `Open`, then locate to the java-mcashchain folder which you have git cloned to your local drive. Then click `Open` button on the right bottom.
76+
2. Check on `Use auto-import` on the `Import Project from Gradle` dialog. Select JDK 1.8 in the `Gradle JVM` option. Then click `OK`.
77+
3. IntelliJ will open the project and start gradle syncing, which will take several minutes, depending on your network connection and your IntelliJ configuration
78+
4. Enable Annotations, `Preferences` -> Search `annotations` -> check `Enable Annotation Processing`.
79+
5. After the syncing finished, select `Gradle` -> `Tasks` -> `build`, and then double click `build` option.
80+

docs/images/program_configure.png

55.8 KB
Loading

docs/images/set_witness_param.jpeg

223 KB
Loading

0 commit comments

Comments
 (0)