Skip to content

Commit

Permalink
Merge branch 'release/0.1.0' into production
Browse files Browse the repository at this point in the history
  • Loading branch information
straumat committed Jan 4, 2024
2 parents b3acce5 + 11c0655 commit bcad9ed
Show file tree
Hide file tree
Showing 260 changed files with 5,078 additions and 1,801 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
- name: Retrieving request status
id: requestByRequestId
run: |
sleep 60
sleep 90
status=$(curl -H "Content-Type: application/json" \
-d '{ "query": "{ requestByRequestId(requestId: \"${{ steps.addProofRequest.outputs.requestId }}\") { status }}" }' \
http://localhost:9090/graphql | jq -r '.data.requestByRequestId.status')
Expand Down Expand Up @@ -143,7 +143,7 @@ jobs:
# ================================================================================================================
# Using CodeQL.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: java

Expand All @@ -152,12 +152,12 @@ jobs:
mvn package -DskipTests
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3

# ================================================================================================================
# Using Qodana.
- name: Qodana Scan
uses: JetBrains/qodana-action@v2023.2.9
uses: JetBrains/qodana-action@v2023.3.0
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}

Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,7 @@ output-*

# Used to download royllo tade and run it.
/util/test/common-test/tade/
util/test/common-test/tade
util/test/common-test/src/main/resources/tapd/admin-testnet.macaroon
util/test/common-test/src/main/resources/tapd/admin-mainnet.macaroon
util/test/common-test/src/main/resources/tapd/admin-mainnet.macaroon
util/test/common-test/adamCoin-request.json
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ further defined and clarified by project maintainers.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at contact@cassandre.tech. All
reported by contacting the project team at contact@royllo.org. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Expand Down
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Google" for Taproot Assets, providing you with a web interface and an API to sea

The Key features for users include:

- Search for Taproot assets and proofs using our user-friendly web interface.
- Search for Taproot assets information using our user-friendly web interface.
- Add your proofs to our database to let the world discover and learn about your assets.
- Add universe servers to let us discover new data automatically (Work in progress).
- Build new applications, services, and tools effortlessly using our GraphQL API
- Add your universe server to let us discover new assets automatically.
- Build new applications, services, and tools effortlessly using our GraphQL API.

A live version is available here: [https://explorer.royllo.org/](https://explorer.royllo.org/)

Expand All @@ -23,17 +23,20 @@ A live version is available here: [https://explorer.royllo.org/](https://explore

```mermaid
graph LR
S3Storage(S3 storage) --- BatchServer(Batch server);
BatchServer(Batch server) --- database[(Database)];
database[(Database)] --- APIServers(API servers);
database[(Database)] --- WebServers(Web servers);
contentServer(Content server) --- S3Storage(S3 storage);
```

Royllo has four components:
Royllo has several servers:

- A Postgresql Database Server ([Release 15](https://hub.docker.com/_/postgres)).
- A Batch server ([royllo/explorer-batch](https://hub.docker.com/r/royllo/explorer-batch)).
- An API server ([royllo/explorer-api](https://hub.docker.com/r/royllo/explorer-api)).
- A Web server ([royllo/explorer-web](https://hub.docker.com/r/royllo/explorer-web)).
- Database Server ([Postgresql](https://hub.docker.com/_/postgres)).
- S3 storage Server (For example [Minio](https://hub.docker.com/r/minio/minio)).
- Batch server ([royllo/explorer-batch](https://hub.docker.com/r/royllo/explorer-batch)).
- API server ([royllo/explorer-api](https://hub.docker.com/r/royllo/explorer-api)).
- Web server ([royllo/explorer-web](https://hub.docker.com/r/royllo/explorer-web)).

Royllo also needs to access to three external
services: [Lnd, Tapd](https://github.com/royllo/lnd-taro-with-docker) & [Mempool](https://mempool.space/).
Expand All @@ -43,4 +46,4 @@ Just run : `docker-compose up`

## Contact

Feel free to contact me: [straumat](https://github.com/straumat)
Feel free to contact me: [straumat](https://github.com/straumat)
50 changes: 42 additions & 8 deletions backend/explorer-core/autoconfigure/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
<version>${caffeine.version}</version>
</dependency>

<!-- Reactor -->
<dependency>
Expand Down Expand Up @@ -61,20 +70,35 @@
<artifactId>postgresql</artifactId>
<version>${jdbc.driver.postgresql.version}</version>
</dependency>

<!-- Cloud dependencies -->
<dependency>
<groupId>io.minio</groupId>
<artifactId>minio</artifactId>
<version>${minio.version}</version>
</dependency>
<dependency>
<groupId>com.google.jimfs</groupId>
<artifactId>jimfs</artifactId>
<version>${jimfs.version}</version>
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<version>${jdbc.driver.mysql.version}</version>
<groupId>io.undertow</groupId>
<artifactId>undertow-core</artifactId>
<version>${undertow.version}</version>
</dependency>

<!-- Others -->
<!-- Util dependencies -->
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.16.0</version>
</dependency>
<dependency>
<groupId>com.bucket4j</groupId>
<artifactId>bucket4j-core</artifactId>
<version>8.7.0</version>
</dependency>

<!-- Util dependencies -->
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
Expand All @@ -90,6 +114,11 @@
<artifactId>mapstruct</artifactId>
<version>${mapstruct.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika-core</artifactId>
<version>${tika-core.version}</version>
</dependency>

<!-- Test dependencies -->
<dependency>
Expand All @@ -109,9 +138,14 @@
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>mysql</artifactId>
<artifactId>minio</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>${okhttp.version}</version>
</dependency>
<dependency>
<groupId>org.royllo.test</groupId>
<artifactId>common-test</artifactId>
Expand Down Expand Up @@ -274,7 +308,7 @@
<parent>
<groupId>org.royllo.explorer</groupId>
<artifactId>explorer</artifactId>
<version>0.0.22</version>
<version>0.1.0</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<!-- =========================================================================================================== -->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.royllo.explorer.core.configuration;

import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Configuration;

/**
* Caching configuration.
*/
@Configuration
@EnableCaching
public class CachingConfiguration {

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.royllo.explorer.core.util.parameters.MempoolParameters;
import org.royllo.explorer.core.util.parameters.OutgoingRateLimitsParameters;
import org.royllo.explorer.core.util.parameters.RoylloExplorerParameters;
import org.royllo.explorer.core.util.parameters.S3Parameters;
import org.royllo.explorer.core.util.parameters.TAPDParameters;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;
Expand All @@ -17,6 +18,9 @@
RoylloExplorerParameters.class,
RoylloExplorerParameters.Api.class,
RoylloExplorerParameters.Web.class,
RoylloExplorerParameters.Content.class,
// S3 configuration.
S3Parameters.class,
// Mempool configuration.
MempoolParameters.class,
MempoolParameters.Api.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.royllo.explorer.core.util.enums.AssetType;

import java.math.BigInteger;
import java.time.ZonedDateTime;

import static jakarta.persistence.EnumType.STRING;
import static jakarta.persistence.FetchType.EAGER;
Expand Down Expand Up @@ -71,6 +72,10 @@ public class Asset extends BaseDomain {
@Column(name = "META_DATA_HASH", updatable = false)
private String metaDataHash;

/** Meta data file name. */
@Column(name = "META_DATA_FILE_NAME")
private String metaDataFileName;

/** Asset genesis: The index of the output that carries the unique Taproot commitment in the genesis transaction. */
@Column(name = "OUTPUT_INDEX", updatable = false)
private int outputIndex;
Expand All @@ -84,8 +89,12 @@ public class Asset extends BaseDomain {
@Column(name = "ASSET_TYPE", updatable = false)
private AssetType type;

/** The total amount of the asset stored in this Taproot asset UTXO. */
/** The total amount minted for this asset. */
@Column(name = "AMOUNT")
private BigInteger amount;

/** The date and time when the asset was created. */
@Column(name = "ISSUANCE_DATE")
private ZonedDateTime issuanceDate;

}
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ public class AssetState extends BaseDomain {
@Column(name = "SCRIPT_KEY")
private String scriptKey;

/** Indicates whether the asset has been spent. */
@Column(name = "SPENT")
private boolean spent;

/** If the asset has been leased, this is the owner (application ID) of the lease. */
@Column(name = "LEASE_OWNER")
private String leaseOwner;
Expand All @@ -114,6 +118,10 @@ public class AssetState extends BaseDomain {
@Column(name = "LEASE_EXPIRY")
private long leaseExpiry;

/** Indicates whether this transfer was an asset burn. If true, the number of assets in this output are destroyed and can no longer be spent. */
@Column(name = "BURN")
private boolean burn;

/** The merkle proof for AnchorTx used to prove its inclusion within BlockHeader. */
@Column(name = "TX_MERKLE_PROOF")
private String txMerkleProof;
Expand All @@ -136,4 +144,8 @@ public class AssetState extends BaseDomain {
@Column(name = "CHALLENGE_WITNESS")
private List<String> challengeWitness = new ArrayList<>();

/** Indicates if this asset state is an issuance or a transfer. */
@Column(name = "ISSUANCE")
private boolean issuance;

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Enumerated;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
Expand All @@ -17,7 +18,9 @@
import org.royllo.explorer.core.domain.asset.Asset;
import org.royllo.explorer.core.domain.user.User;
import org.royllo.explorer.core.util.base.BaseDomain;
import org.royllo.explorer.core.util.enums.ProofType;

import static jakarta.persistence.EnumType.STRING;
import static jakarta.persistence.FetchType.EAGER;
import static jakarta.persistence.GenerationType.IDENTITY;

Expand Down Expand Up @@ -54,8 +57,9 @@ public class Proof extends BaseDomain {
@Column(name = "PROOF_ID", updatable = false)
private String proofId;

/** Proof. */
@Column(name = "PROOF", updatable = false)
private String proof;
/** Proof type. */
@Enumerated(STRING)
@Column(name = "PROOF_TYPE", updatable = false)
private ProofType proofType;

}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import jakarta.persistence.Column;
import jakarta.persistence.DiscriminatorValue;
import jakarta.persistence.Entity;
import jakarta.persistence.Enumerated;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
Expand All @@ -12,7 +13,9 @@
import lombok.ToString;
import lombok.experimental.SuperBuilder;
import org.royllo.explorer.core.domain.asset.Asset;
import org.royllo.explorer.core.util.enums.ProofType;

import static jakarta.persistence.EnumType.STRING;
import static jakarta.persistence.FetchType.EAGER;

/**
Expand All @@ -29,9 +32,14 @@
public class AddProofRequest extends Request {

/** Proof that validates the asset information. */
@Column(name = "proof", updatable = false)
@Column(name = "PROOF", updatable = false)
private String proof;

/** Proof type. */
@Enumerated(STRING)
@Column(name = "PROOF_TYPE", updatable = false)
private ProofType proofType;

/** The asset created/updated by this request. */
@ManyToOne(fetch = EAGER)
@JoinColumn(name = "FK_ASSET")
Expand Down
Loading

0 comments on commit bcad9ed

Please sign in to comment.