OSDN Git Service

add issue address and license
[bytom/bytom-java-sdk.git] / README.md
index c5dbc1f..903792c 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,11 +1,43 @@
 # Bytom java-sdk
 
 This page will document the API classes and ways to properly use the API.
-Subsequent new releases also maintain backward compatibility with this class approach.
+Subsequent new releases also maintain backward compatibility with this class
+approach. For more information, please see Bytom API reference documentation
+at [Bytom wiki](https://github.com/Bytom/bytom/wiki/API-Reference)
 
-## Basic Usage
+## Installation
+
+There are various ways to install and use this sdk. We'll provide three ways to get it. Note that the bytom-sdk requires JAVA 7 or newer.
+
+### Apache Maven
 
+```xml
+<dependency>
+    <groupId>io.bytom</groupId>
+    <artifactId>bytom-sdk</artifactId>
+    <version>1.0.0</version>
+</dependency>
 ```
+
+### Gradle/Grails
+```xml
+compile 'io.bytom:bytom-sdk:1.0.0'
+```
+
+### Building from source code
+
+To clone, compile, and install in your local maven repository (or copy the artifacts from the target/ directory to wherever you need them):
+
+```shell
+git clone https://github.com/Bytom/bytom-java-sdk.git
+cd java-sdk
+mvn package -Dmaven.test.skip=true
+mvn install
+```
+
+## Basic Usage
+
+```java
 public static Client generateClient() throws BytomException {
     String coreURL = Configuration.getValue("bytom.api.url");
     String accessToken = Configuration.getValue("client.access.token");
@@ -15,8 +47,9 @@ public static Client generateClient() throws BytomException {
     return new Client(coreURL, accessToken);
 }
 
-Client client = TestUtils.generateClient();
+Client client = Client.generateClient();
 ```
+> Note: you can touch a file named ```config.properties``` in resources folder to config ```bytom.api.url``` and ```client.access.token``` by custom.
 
 ## Usage
 
@@ -29,9 +62,9 @@ Client client = TestUtils.generateClient();
     * [`Secondly sign the transaction`](#secondly-sign-the-transaction)
     * [`Finally submit the transaction`](#finally-submit-the-transaction)
 
-> For more details, see ![`API methods`](https://github.com/Bytom/java-sdk/blob/master/doc/index.md#api-methods)
+> For more details, see [API methods](https://github.com/Bytom/java-sdk/blob/master/doc/index.md#api-methods)
 
-## Create a key
+### Create a key
 
 ```java
 String alias = "test";
@@ -41,7 +74,7 @@ Key.Builder builder = new Key.Builder().setAlias(alias).setPassword(password);
 Key key = Key.create(client, builder);
 ```
 
-## Create an account
+### Create an account
 
 ```java
 String alias = "sender-account";
@@ -54,7 +87,7 @@ Account.Builder builder = new Account.Builder().setAlias(alias).setQuorum(quorum
 Account account = Account.create(client, builder);
 ```
 
-## Create an receiver
+### Create an receiver
 
 ```java
 String alias = receiverAccount.alias;
@@ -64,7 +97,7 @@ Account.ReceiverBuilder receiverBuilder = new Account.ReceiverBuilder().setAccou
 Receiver receiver = receiverBuilder.create(client);
 ```
 
-## Create an asset
+### Create an asset
 
 ```java
  String alias = "receiver-asset";
@@ -78,9 +111,11 @@ Asset.Builder builder = new Asset.Builder()
 receiverAsset = builder.create(client);
 ```
 
-## Issue asset
+### Issue asset
+
+For more transaction details, see [transactions](https://github.com/Bytom/java-sdk/blob/master/doc/transactions.md)
 
-### Firstly build the transaction
+#### Firstly build the transaction
 
 ```java
 Transaction.Template controlAddress = new Transaction.Builder()
@@ -98,15 +133,28 @@ Transaction.Template controlAddress = new Transaction.Builder()
         ).build(client);
 ```
 
-### Secondly sign the transaction
+#### Secondly sign the transaction
 
 ```java
 Transaction.Template singer = new Transaction.SignerBuilder().sign(client,
         controlAddress, "123456");
 ```
 
-### Finally submit the transaction
+#### Finally submit the transaction
 
 ```java
 Transaction.SubmitResponse txs = Transaction.submit(client, singer);
 ```
+
+
+### All usage examples
+
+For more details you can see [doc](https://github.com/Bytom/bytom-java-sdk/blob/master/doc/index.md#api-methods). And you can find Test Cases at [Junit Test Cases](https://github.com/Bytom/bytom-java-sdk/tree/master/src/test/java/io/bytom/integration)
+
+## Support and Feedback
+
+If you find a bug, please submit the issue in Github directly by using [Issues](https://github.com/Bytom/bytom-java-sdk/issues)
+
+## License
+
+Bytom JAVA SDK is based on the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt)  protocol.