Skip to content

Commit d7abaef

Browse files
committed
Update Java SDK README
1 parent 3b5e55e commit d7abaef

File tree

1 file changed

+67
-22
lines changed

1 file changed

+67
-22
lines changed

convex-java/README.md

Lines changed: 67 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,97 @@
1-
# convex-java
2-
Java client library for Convex
1+
# Convex Java SDK
32

4-
## About
3+
[![Maven Central](https://img.shields.io/maven-central/v/world.convex/convex-java.svg?label=Maven%20Central)](https://search.maven.org/search?q=world.convex)
4+
[![javadoc](https://javadoc.io/badge2/world.convex/convex-java/javadoc.svg)](https://javadoc.io/doc/world.convex/convex-java)
55

6-
Convex is an open, decentralised technology for the Internet of Value. Java is one of the world's leading programming languages, especially in the realm of business and finance.
6+
The official Java SDK for building applications on the [Convex](https://convex.world) network.
77

8-
`convex-java` provides everything Java developers need to access Convex and utilise all of its capabilities from their own applications.
8+
## Installation
99

10-
## Usage
10+
### Maven
1111

12-
You will need a connection to a peer on the Convex Network. Peers are servers which participate in the maintaining consensus on the Convex Network, by executing the CPoS consensus algorithm and validating transactions. It is easiest if you simply use the free public peer available at `https://convex.world`.
12+
```xml
13+
<dependency>
14+
<groupId>world.convex</groupId>
15+
<artifactId>convex-java</artifactId>
16+
<version>0.8.2</version>
17+
</dependency>
18+
```
19+
20+
### Gradle
21+
22+
```groovy
23+
implementation 'world.convex:convex-java:0.8.2'
24+
```
25+
26+
## Quick Start
27+
28+
### Connect to the Network
1329

1430
```java
31+
import convex.java.Convex;
32+
33+
// Connect to the public test network
1534
Convex convex = Convex.connect("https://convex.world");
1635
```
1736

18-
To utilise the network, you will need an account with available funds. On the Test Network, you can obtain one by requesting a new account with free balance (up to 10,000,000 Convex copper coins). This should be enough for most simple testing.
37+
### Create an Account
1938

2039
```java
21-
convex.useNewAccount(10000000);
40+
// Request a new account with test funds (up to 10,000,000 copper coins)
41+
convex.useNewAccount(10_000_000);
42+
43+
// Access your key pair (required for signing transactions)
44+
AKeyPair keyPair = convex.getKeyPair();
2245
```
2346

24-
`convex-java` will automatically generate a new cryptographic key pair to secure your new account. Having a valid key pair for the account is the *only way* to successfully submit transactions for that Account on the Convex Network. If you want to access the key pair, you can use:
47+
### Execute Queries
48+
49+
Queries are read-only operations that don't modify state:
2550

2651
```java
27-
convex.getKeyPair()
52+
// Query the current balance
53+
ACell result = convex.query("*balance*");
2854
```
2955

56+
### Submit Transactions
3057

58+
Transactions modify on-chain state and require a funded account:
3159

60+
```java
61+
// Transfer funds to another account
62+
ACell result = convex.transact("(transfer #42 1000000)");
3263

64+
// Deploy a smart contract
65+
ACell result = convex.transact("(deploy '(do (defn greet [name] (str \"Hello, \" name))))");
66+
```
3367

34-
## Installation and Configuration
68+
## Key Concepts
3569

36-
You can clone this repository and run `mvn install` to get a working local version. This is recommended for developers who wish to use early snapshot versions or contribute to `convex-java` as an open source project.
70+
| Concept | Description |
71+
|---------|-------------|
72+
| **Account** | Self-sovereign identity on Convex, identified by address (e.g., `#42`) |
73+
| **Key Pair** | Ed25519 cryptographic keys for signing transactions |
74+
| **Query** | Read-only operation, free to execute |
75+
| **Transaction** | State-changing operation, consumes juice (gas) |
76+
| **Convex Lisp** | On-chain programming language for smart contracts |
3777

38-
`convex-java` is also available as a Maven dependency.
78+
## Building from Source
3979

80+
```bash
81+
git clone https://github.com/Convex-Dev/convex.git
82+
cd convex
83+
mvn install -pl convex-java -am
4084
```
41-
<dependency>
42-
<groupId>world.convex</groupId>
43-
<artifactId>convex-java</artifactId>
44-
<version>0.0.1</version>
45-
</dependency>
46-
```
85+
86+
## Resources
87+
88+
- [Convex Documentation](https://docs.convex.world)
89+
- [Javadoc API Reference](https://javadoc.io/doc/world.convex/convex-java)
90+
- [GitHub Repository](https://github.com/Convex-Dev/convex)
91+
- [Discord Community](https://discord.com/invite/xfYGq4CT7v)
4792

4893
## License
4994

50-
Copyright 2021-203 The Convex Foundation and Contributors
95+
Copyright 2021-2025 The Convex Foundation and Contributors
5196

52-
Code in convex-java is provided under the Convex Public License
97+
Code in convex-java is provided under the [Convex Public License](../LICENSE.md).

0 commit comments

Comments
 (0)