mirror of
https://github.com/corda/corda.git
synced 2025-02-09 20:31:18 +00:00
Merge pull request #263 from corda/clint-release-M8.2
Release M8.2 changes and changelog
This commit is contained in:
commit
572dfccafd
@ -4,7 +4,7 @@ buildscript {
|
||||
file("publish.properties").withInputStream { props.load(it) }
|
||||
|
||||
// Our version: bump this on release.
|
||||
ext.corda_version = "0.8.1"
|
||||
ext.corda_version = "0.8.2"
|
||||
ext.gradle_plugins_version = props.getProperty("gradlePluginsVersion")
|
||||
|
||||
// Dependency versions. Can run 'gradle dependencyUpdates' to find new versions of things.
|
||||
|
@ -15,6 +15,7 @@ import net.corda.core.node.services.Vault
|
||||
import net.corda.core.transactions.SignedTransaction
|
||||
import rx.Observable
|
||||
import java.io.InputStream
|
||||
import java.io.OutputStream
|
||||
import java.time.Instant
|
||||
|
||||
data class StateMachineInfo(
|
||||
@ -98,6 +99,11 @@ interface CordaRPCOps : RPCOps {
|
||||
*/
|
||||
fun attachmentExists(id: SecureHash): Boolean
|
||||
|
||||
/**
|
||||
* Download an attachment JAR by ID
|
||||
*/
|
||||
fun openAttachment(id: SecureHash): InputStream
|
||||
|
||||
/**
|
||||
* Uploads a jar to the node, returns it's hash.
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@ Milestone releases
|
||||
|
||||
When you clone the corda or cordapp-template repos, they will default to the master branch. The master branch is being continuously developed upon, and its features may not align with the state of Corda as described in the docs. Additionally, the master branch of the CorDapp Template may break in response to changes in the main corda repo.
|
||||
|
||||
When developing on Corda, you should always check out the latest stable release tag instead, by running ``git checkout release-M8.1``.
|
||||
When developing on Corda, you should always check out the latest stable release tag instead, by running ``git checkout release-M8.2``.
|
||||
|
||||
Java issues
|
||||
-----------
|
||||
|
@ -76,7 +76,7 @@ and a basic CorDapp that you can use as the basis for your own CorDapps is avail
|
||||
You can clone both of these repos to your local machine by running the command ``git clone [repo URL]``.
|
||||
|
||||
By default, both repos will be on the ``master`` branch. However, this is an unstable development branch. You should check
|
||||
out the latest milestone release (currently Milestone 8.1) instead by running ``git checkout release-M8.1``.
|
||||
out the latest milestone release (currently Milestone 8.2) instead by running ``git checkout release-M8.2``.
|
||||
|
||||
Opening Corda/CorDapps in IDEA
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
@ -2,7 +2,7 @@ Welcome to the Corda documentation!
|
||||
===================================
|
||||
|
||||
`Corda <https://www.corda.net/>`_ is an open-source distributed ledger platform. The latest *milestone* (i.e. stable)
|
||||
release is M8.1. The codebase is on `GitHub <https://github.com/corda>`_, and our community can be found on
|
||||
release is M8.2. The codebase is on `GitHub <https://github.com/corda>`_, and our community can be found on
|
||||
`Slack <https://slack.corda.net/>`_ and in our `forum <https://discourse.corda.net/>`_.
|
||||
|
||||
If you're new to Corda, you should start by learning about its motivating vision and architecture. A good introduction
|
||||
|
@ -3,6 +3,11 @@ Release notes
|
||||
|
||||
Here are brief summaries of what's changed between each snapshot release.
|
||||
|
||||
Milestone 8.2
|
||||
-------------
|
||||
|
||||
* Added an openAttachment endpoint to the RPC interface to allow downloading of attachments via RPC.
|
||||
|
||||
Milestone 8.1
|
||||
-------------
|
||||
|
||||
|
@ -101,6 +101,7 @@ class CordaRPCOpsImpl(
|
||||
}
|
||||
|
||||
override fun attachmentExists(id: SecureHash) = services.storageService.attachments.openAttachment(id) != null
|
||||
override fun openAttachment(id: SecureHash) = services.storageService.attachments.openAttachment(id)!!.open()
|
||||
override fun uploadAttachment(jar: InputStream) = services.storageService.attachments.importAttachment(jar)
|
||||
override fun currentNodeTime(): Instant = Instant.now(services.clock)
|
||||
override fun uploadFile(dataType: String, name: String?, file: InputStream): String {
|
||||
|
@ -24,15 +24,22 @@ import net.corda.testing.expectEvents
|
||||
import net.corda.testing.node.MockNetwork
|
||||
import net.corda.testing.node.MockNetwork.MockNode
|
||||
import net.corda.testing.sequence
|
||||
import org.apache.commons.io.IOUtils
|
||||
import org.assertj.core.api.Assertions.assertThatExceptionOfType
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import rx.Observable
|
||||
import java.io.ByteArrayOutputStream
|
||||
import java.util.*
|
||||
import kotlin.test.assertEquals
|
||||
import kotlin.test.assertFalse
|
||||
|
||||
class CordaRPCOpsImplTest {
|
||||
|
||||
private companion object {
|
||||
val testJar = "net/corda/node/testing/test.jar"
|
||||
}
|
||||
|
||||
lateinit var network: MockNetwork
|
||||
lateinit var aliceNode: MockNode
|
||||
lateinit var notaryNode: MockNode
|
||||
@ -196,4 +203,24 @@ class CordaRPCOpsImplTest {
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `can upload an attachment`() {
|
||||
val inputJar = Thread.currentThread().contextClassLoader.getResourceAsStream(testJar)
|
||||
val secureHash = rpc.uploadAttachment(inputJar)
|
||||
assert(rpc.attachmentExists(secureHash))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `can download an uploaded attachment`() {
|
||||
val inputJar = Thread.currentThread().contextClassLoader.getResourceAsStream(testJar)
|
||||
val secureHash = rpc.uploadAttachment(inputJar)
|
||||
val bufferFile = ByteArrayOutputStream()
|
||||
val bufferRpc = ByteArrayOutputStream()
|
||||
|
||||
IOUtils.copy(Thread.currentThread().contextClassLoader.getResourceAsStream(testJar), bufferFile)
|
||||
IOUtils.copy(rpc.openAttachment(secureHash), bufferRpc)
|
||||
|
||||
assert(Arrays.equals(bufferFile.toByteArray(), bufferRpc.toByteArray()))
|
||||
}
|
||||
}
|
||||
|
BIN
node/src/test/resources/net/corda/node/testing/test.jar
Normal file
BIN
node/src/test/resources/net/corda/node/testing/test.jar
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user