-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Started the Hotmoka nodes based on Mokamint
- Loading branch information
Showing
20 changed files
with
424 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>io-hotmoka-node-mokamint-api</artifactId> | ||
<packaging>jar</packaging> | ||
<name>io-hotmoka-node-mokamint-api</name> | ||
<version>${hotmoka.version}</version> | ||
<description>This module defines the API of Hotmoka nodes running over the Mokamint engine. They can be used to build an actual blockchain network based on proof of space.</description> | ||
|
||
<parent> | ||
<groupId>io.hotmoka</groupId> | ||
<artifactId>hotmoka</artifactId> | ||
<version>parent</version> | ||
</parent> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.hotmoka</groupId> | ||
<artifactId>io-hotmoka-node-local-api</artifactId> | ||
<version>${hotmoka.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.hotmoka</groupId> | ||
<artifactId>io-hotmoka-node-api</artifactId> | ||
<version>${hotmoka.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.hotmoka.annotations</groupId> | ||
<artifactId>io-hotmoka-annotations</artifactId> | ||
<version>${io.hotmoka.annotations.version}</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<profiles> | ||
<profile> | ||
<id>release</id> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.sonatype.plugins</groupId> | ||
<artifactId>nexus-staging-maven-plugin</artifactId> | ||
<configuration> | ||
<skipNexusStagingDeployMojo>false</skipNexusStagingDeployMojo> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
</profiles> | ||
|
||
</project> |
27 changes: 27 additions & 0 deletions
27
io-hotmoka-node-mokamint-api/src/main/java/io/hotmoka/node/mokamint/api/MokamintNode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
Copyright 2024 Fausto Spoto | ||
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. | ||
*/ | ||
|
||
package io.hotmoka.node.mokamint.api; | ||
|
||
import io.hotmoka.annotations.ThreadSafe; | ||
import io.hotmoka.node.local.api.LocalNode; | ||
|
||
/** | ||
* A node of a blockchain that relies on the Mokamint engine. | ||
*/ | ||
@ThreadSafe | ||
public interface MokamintNode extends LocalNode<MokamintNodeConfig> { | ||
} |
27 changes: 27 additions & 0 deletions
27
...moka-node-mokamint-api/src/main/java/io/hotmoka/node/mokamint/api/MokamintNodeConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
Copyright 2024 Fausto Spoto | ||
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. | ||
*/ | ||
|
||
package io.hotmoka.node.mokamint.api; | ||
|
||
import io.hotmoka.annotations.Immutable; | ||
import io.hotmoka.node.local.api.LocalNodeConfig; | ||
|
||
/** | ||
* The configuration of a Mokamint node. | ||
*/ | ||
@Immutable | ||
public interface MokamintNodeConfig extends LocalNodeConfig<MokamintNodeConfig, MokamintNodeConfigBuilder> { | ||
} |
25 changes: 25 additions & 0 deletions
25
...de-mokamint-api/src/main/java/io/hotmoka/node/mokamint/api/MokamintNodeConfigBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
Copyright 2024 Fausto Spoto | ||
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. | ||
*/ | ||
|
||
package io.hotmoka.node.mokamint.api; | ||
|
||
import io.hotmoka.node.local.api.LocalNodeConfigBuilder; | ||
|
||
/** | ||
* The builder of a configuration of a Mokamint node. | ||
*/ | ||
public interface MokamintNodeConfigBuilder extends LocalNodeConfigBuilder<MokamintNodeConfig, MokamintNodeConfigBuilder> { | ||
} |
27 changes: 27 additions & 0 deletions
27
io-hotmoka-node-mokamint-api/src/main/java/module-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
Copyright 2024 Fausto Spoto | ||
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. | ||
*/ | ||
|
||
/** | ||
* This module defines the API of Hotmoka nodes running over the Mokamint engine. | ||
* They can be used to build an actual blockchain network based on proof of space. | ||
*/ | ||
module io.hotmoka.node.mokamint.api { | ||
exports io.hotmoka.node.mokamint.api; | ||
|
||
requires io.hotmoka.annotations; | ||
requires io.hotmoka.node.api; | ||
requires io.hotmoka.node.local.api; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>io-hotmoka-node-mokamint</artifactId> | ||
<packaging>jar</packaging> | ||
<name>io-hotmoka-node-mokamint</name> | ||
<version>${hotmoka.version}</version> | ||
<description>This module implements Hotmoka nodes based on the Mokamint proof of space engine.</description> | ||
|
||
<parent> | ||
<groupId>io.hotmoka</groupId> | ||
<artifactId>hotmoka</artifactId> | ||
<version>parent</version> | ||
</parent> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.hotmoka</groupId> | ||
<artifactId>io-hotmoka-node-mokamint-api</artifactId> | ||
<version>${hotmoka.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.hotmoka</groupId> | ||
<artifactId>io-hotmoka-node-local</artifactId> | ||
<version>${hotmoka.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.hotmoka</groupId> | ||
<artifactId>io-takamaka-code-constants</artifactId> | ||
<version>${io.takamaka.code.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.hotmoka.annotations</groupId> | ||
<artifactId>io-hotmoka-annotations</artifactId> | ||
<version>${io.hotmoka.annotations.version}</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<profiles> | ||
<profile> | ||
<id>release</id> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.sonatype.plugins</groupId> | ||
<artifactId>nexus-staging-maven-plugin</artifactId> | ||
<configuration> | ||
<skipNexusStagingDeployMojo>false</skipNexusStagingDeployMojo> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
</profiles> | ||
|
||
</project> |
57 changes: 57 additions & 0 deletions
57
io-hotmoka-node-mokamint/src/main/java/io/hotmoka/node/mokamint/MokamintNodes.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
Copyright 2024 Fausto Spoto | ||
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. | ||
*/ | ||
|
||
package io.hotmoka.node.mokamint; | ||
|
||
import io.hotmoka.node.api.NodeException; | ||
import io.hotmoka.node.mokamint.api.MokamintNode; | ||
import io.hotmoka.node.mokamint.api.MokamintNodeConfig; | ||
|
||
/** | ||
* Providers of blockchain nodes that rely on the Mokamint proof of space engine. | ||
*/ | ||
public abstract class MokamintNodes { | ||
|
||
private MokamintNodes() {} | ||
|
||
/** | ||
* Creates and starts a node with a brand new store, of a blockchain based on Mokamint. | ||
* It spawns the Mokamint engine with an application for handling its transactions. | ||
* | ||
* @param config the configuration of the blockchain | ||
* @return the Mokamint node | ||
* @throws InterruptedException if the current thread is interrupted before completing the operation | ||
* @throws NodeException if the operation cannot be completed correctly | ||
*/ | ||
public static MokamintNode init(MokamintNodeConfig config) throws NodeException, InterruptedException { | ||
return null; //new TendermintNodeImpl(config, true); | ||
} | ||
|
||
/** | ||
* Starts a Mokamint node that uses an already existing store. The consensus | ||
* parameters are recovered from the manifest in the store, hence the store must | ||
* be that of an already initialized blockchain. It spawns the Mokamint engine | ||
* and connects it to an application for handling its transactions. | ||
* | ||
* @param config the configuration of the blockchain | ||
* @return the Mokamint node | ||
* @throws InterruptedException if the current thread is interrupted before completing the operation | ||
* @throws NodeException if the operation cannot be completed correctly | ||
*/ | ||
public static MokamintNode resume(MokamintNodeConfig config) throws NodeException, InterruptedException { | ||
return null; //new TendermintNodeImpl(config, false); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
Copyright 2024 Fausto Spoto | ||
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. | ||
*/ | ||
|
||
/** | ||
* This module implements Hotmoka nodes running over the Mokamint engine. | ||
* They can be used to build an actual blockchain network based on proof of space. | ||
*/ | ||
module io.hotmoka.node.mokamint { | ||
exports io.hotmoka.node.mokamint; | ||
//exports io.hotmoka.node.mokamint.internal.beans to com.google.gson; | ||
|
||
requires transitive io.hotmoka.node.mokamint.api; | ||
requires transitive io.hotmoka.node.api; | ||
requires io.hotmoka.annotations; | ||
requires java.logging; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.