java.lang.Object
convex.api.Convex
convex.api.ConvexDirect
- All Implemented Interfaces:
AutoCloseable
Convex API instance that directly interacts with a Peer instance
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ConvexDirect
(Address address, AKeyPair keyPair, Peer initial) -
Method Summary
Modifier and TypeMethodDescription<T extends ACell>
CompletableFuture<T> Attempts to acquire a complete persistent data structure for the given hash from the connected peer.void
close()
Disconnects the client from the network, releasing any connection resources.static ConvexDirect
Gets the remote address for this Convex client instanceboolean
Checks if this Convex client instance has an open connection.Submits a Message to the connected peer, returning a Future for any ResultmessageRaw
(Blob message) Submits raw message data to the Convex network, returning a Future for any ResultSubmits a query to the Convex network, returning a Future once the query has been successfully queued.void
requestChallenge
(SignedData<ACell> data) Request a challenge.Submits a status request to the Convex network peer, returning a Future once the request has been successfully queued.toString()
transact
(SignedData<ATransaction> signedTransaction) Submits a signed transaction to the Convex network, returning a Future once the transaction has been successfully queued.Methods inherited from class convex.api.Convex
acquire, acquireState, clearSequence, connect, connect, connect, connect, connect, createAccount, createAccountSync, finalize, getAccountKey, getAccountKey, getAddress, getBalance, getBalance, getKeyPair, getLocalServer, getNextID, getSequence, getSequence, getTimeout, isAutoSequence, isPreCompile, lookupSequence, maybeUpdateSequence, preCompile, prepareTransaction, prepareTransaction, query, query, querySync, querySync, querySync, querySync, requestStatusSync, requestStatusSync, resolve, setAddress, setAddress, setAutoSequence, setKeyPair, setNextSequence, setPreCompile, setTimeout, signData, transact, transact, transact, transactSync, transactSync, transactSync, transactSync, transactSync, transfer, transferSync
-
Field Details
-
peer
-
-
Constructor Details
-
ConvexDirect
-
-
Method Details
-
create
-
isConnected
public boolean isConnected()Description copied from class:Convex
Checks if this Convex client instance has an open connection.- Specified by:
isConnected
in classConvex
- Returns:
- true if connected, false otherwise
-
transact
Description copied from class:Convex
Submits a signed transaction to the Convex network, returning a Future once the transaction has been successfully queued. Updates cached sequence number on best effort basis. -
messageRaw
Description copied from class:Convex
Submits raw message data to the Convex network, returning a Future for any Result- Specified by:
messageRaw
in classConvex
- Parameters:
message
- Raw message data- Returns:
- A Future for the result of the query
-
message
Description copied from class:Convex
Submits a Message to the connected peer, returning a Future for any Result -
acquire
Description copied from class:Convex
Attempts to acquire a complete persistent data structure for the given hash from the connected peer. Uses the store provided as a destination. -
requestStatus
Description copied from class:Convex
Submits a status request to the Convex network peer, returning a Future once the request has been successfully queued.- Specified by:
requestStatus
in classConvex
- Returns:
- A Future for the result of the requestStatus
-
requestChallenge
Description copied from class:Convex
Request a challenge. This is request is made by any peer that needs to find out if another peer can be trusted.- Specified by:
requestChallenge
in classConvex
- Parameters:
data
- Signed data to send to the peer for the challenge.- Returns:
- A Future for the result of the requestChallenge
-
query
Description copied from class:Convex
Submits a query to the Convex network, returning a Future once the query has been successfully queued. -
close
public void close()Description copied from class:Convex
Disconnects the client from the network, releasing any connection resources.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in classConvex
-
toString
-
getHostAddress
Description copied from class:Convex
Gets the remote address for this Convex client instance- Specified by:
getHostAddress
in classConvex
- Returns:
- Socket address
-
reconnect
- Specified by:
reconnect
in classConvex
- Throws:
IOException
TimeoutException
InterruptedException
-