20
20
* [ Authors] ( #authors )
21
21
* [ License] ( #license )
22
22
23
- ## Installation and Usage
24
- The build system supports both maven and gradle, so to build the driver run:
25
- ``` bash
26
- ./gradlew install
23
+ ## Installation
24
+
25
+ The build system supports both maven and gradle -
26
+
27
+ #####Maven users
28
+ - In your ` pom.xml ` add java-driver as dependency
29
+
30
+ ```
31
+ <dependency>
32
+ <groupId>com.bigchaindb</groupId>
33
+ <artifactId>bigchaindb-driver</artifactId>
34
+ <version>1.0</version>
35
+ </dependency>
36
+ ```
37
+ then
38
+
39
+ ```
40
+ mvn clean install
41
+ ```
42
+ #####Gradle users
43
+ - In your ` build.gradle ` add java-driver as compiling dependency
44
+
27
45
```
28
- or use maven
29
- ``` bash
30
- mvn clean install
46
+ dependencies {
47
+ compile 'com.bigchaindb.bigchaindb-driver:1.0'
48
+ }
49
+
31
50
```
51
+ then
32
52
33
- ## Set up your configuration
53
+ ```
54
+ ./gradlew install
55
+ ```
56
+ ## Usage
57
+ ### Set up your configuration
34
58
- If you don't have app-id and app-key, you can register one at [ https://testnet.bigchaindb.com/ ] ( https://testnet.bigchaindb.com/ )
35
59
36
60
``` java
@@ -40,7 +64,7 @@ BigchainDbConfigBuilder
40
64
.addToken(" app_key" , < your- app- key> ). setup();
41
65
```
42
66
43
- ## Example: Prepare keys, assets and metadata
67
+ ### Example: Prepare keys, assets and metadata
44
68
``` java
45
69
// prepare your keys
46
70
net.i2p.crypto.eddsa. KeyPairGenerator edDsaKpg = new net.i2p.crypto.eddsa. KeyPairGenerator ();
@@ -58,7 +82,7 @@ MetaData metaData = new MetaData();
58
82
metaData. setMetaData(" what" , " My first BigchainDB transaction" );
59
83
```
60
84
61
- ## Example: Create a Transaction
85
+ ### Example: Create a Transaction
62
86
``` java
63
87
// Set up your transaction
64
88
Transaction transaction = BigchainDbTransactionBuilder
@@ -69,7 +93,7 @@ Transaction transaction = BigchainDbTransactionBuilder
69
93
.buildOnly((EdDSAPublicKey ) keyPair. getPublic());
70
94
```
71
95
72
- ## Example: Create and Sign Transaction
96
+ ### Example: Create and Sign Transaction
73
97
``` java
74
98
// Set up your transaction
75
99
Transaction transaction = BigchainDbTransactionBuilder
@@ -81,7 +105,7 @@ Transaction transaction = BigchainDbTransactionBuilder
81
105
82
106
```
83
107
84
- ## Example: Create, Sign and Send a Transaction
108
+ ### Example: Create, Sign and Send a Transaction
85
109
``` java
86
110
// Set up your transaction
87
111
Transaction transaction = BigchainDbTransactionBuilder
@@ -94,7 +118,7 @@ Transaction transaction = BigchainDbTransactionBuilder
94
118
95
119
```
96
120
97
- ## Example: Setup Config with Websocket Listener
121
+ ### Example: Setup Config with Websocket Listener
98
122
``` java
99
123
public class MyCustomMonitor implements MessageHandler {
100
124
@Override
0 commit comments