An enterprise-grade Java-based, Apache 2.0 licensed Ethereum client https://wiki.hyperledger.org/display/besu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
besu/plugin-api/build.gradle

82 lines
2.3 KiB

/*
* Copyright 2019 ConsenSys AG.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
import java.security.MessageDigest
apply plugin: 'java-library'
jar {
archiveBaseName = 'plugin-api'
manifest {
attributes(
'Specification-Title': archiveBaseName,
'Specification-Version': project.version,
'Implementation-Title': archiveBaseName,
'Implementation-Version': calculateVersion()
)
}
}
dependencies {
api 'org.apache.tuweni:bytes'
api 'org.apache.tuweni:units'
}
configurations { testArtifacts }
class FileStateChecker extends DefaultTask {
@Input
Set<File> files
@Input
String knownHash
@TaskAction
def CheckState() {
def digestor = MessageDigest.getInstance("SHA-256")
this.files.toSorted(Comparator.comparing({it.canonicalPath})).each {
digestor.update(it.readBytes())
}
def currentHash = digestor.digest().encodeBase64().toString()
if (this.knownHash != currentHash) {
throw new GradleException("""For the Plugin APIs the checksum of the project did not match what was expected.
If this is a deliberate change where you have thought through backwards compatibility,
then update "Expected" for "Calculated" in the appropriate build.gradle as the knownHash for this task.
Expected : ${this.knownHash}
Calculated : ${currentHash}
""")
}
}
}
tasks.register('checkAPIChanges', FileStateChecker) {
description = "Checks that the API for the Plugin-API project does not change without deliberate thought"
files = sourceSets.main.allJava.files
PermissioningService Besu Plugin (#2218) * Permissioning: Add plugin extension point Added plugin extension point to allow developers to write their own implementation of `NodePermissioningProvider::isPermitted` This will allow developers to implement their own interpretations of things like on-chain permissioning. Signed-off-by: Antony Denyer <git@antonydenyer.co.uk> * refactor: rename NodePermissioningProvider::isPermitted Interface will be used for other pemissioning needs Signed-off-by: Antony Denyer <git@antonydenyer.co.uk> * Permissioning: added hook for NodeMessagePermissioning All message sent to a peer will call into isMessagePermitted if providers have been registered through the plugin api Signed-off-by: Antony Denyer <git@antonydenyer.co.uk> * AcceptanceTests: test node nodePermissioningProvider 4 node cluster with permissioning blocking a direct between two nodes and permissioning blocking transaction messages for a single node Signed-off-by: Antony Denyer <git@antonydenyer.co.uk> * fix: unit tests for NodePermissioningControllerFactory Signed-off-by: Antony Denyer <git@antonydenyer.co.uk> * fix: fat finger typo Signed-off-by: Antony Denyer <git@antonydenyer.co.uk> * fix: reduce likely hood of flakey test Signed-off-by: Antony Denyer <git@antonydenyer.co.uk> * fix: remove comment Signed-off-by: Antony Denyer <git@antonydenyer.co.uk> * fix: typos Signed-off-by: Antony Denyer <git@antonydenyer.co.uk> * fix: remove jitpack references Signed-off-by: Antony Denyer <git@antonydenyer.co.uk> * fix: tidy up EthPeerTest args Signed-off-by: Antony Denyer <git@antonydenyer.co.uk> * fix: update plugin hash check Signed-off-by: Antony Denyer <git@antonydenyer.co.uk> * fix: improve test reliability Signed-off-by: Antony Denyer <git@antonydenyer.co.uk> * refactor: move test-plugins out from besu/main into acceptance-tests Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
4 years ago
knownHash = 'Zgu1UsdzijNYhkIN4ryqMlAU292gWh6661GWdf5bi14='
}
check.dependsOn('checkAPIChanges')
publishing {
publications {
mavenJava(MavenPublication) {
groupId 'org.hyperledger.besu'
pom {
name = 'Besu Plugins Library'
description = 'Core Plugins Libraries for Besu'
}
}
}
}