Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: merge develop to evm #458

Merged
merged 9 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ distribution
node_modules
LICENSE
CODE_OF_CONDUCT.md
scripts

packages/p2p/source/hapi-nes
52 changes: 52 additions & 0 deletions .github/workflows/deps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
jobs:
source:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
run_install: false
version: latest
- name: Get pnpm store directory
id: pnpm-cache
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
shell: bash
- name: Cache pnpm modules
uses: actions/cache@v3
with:
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
restore-keys: ${{ runner.os }}-pnpm-
- name: Cache lerna
uses: actions/cache@v3
with:
key: ${{ runner.os }}-lerna
path: ./.cache
restore-keys: ${{ runner.os }}-lerna-
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm run build
- name: Check dependencies
run: pnpm run deps:check
strategy:
matrix:
node-version:
- 20.x
name: Dependencies
on:
pull_request:
types:
- ready_for_review
- synchronize
- opened
push:
branches:
- main
- develop
Binary file added banner.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed banner.png
Binary file not shown.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"useWorkspaces": true,
"version": "0.0.1-alpha.7"
"version": "0.0.1-alpha.8"
}
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
"clean:all": "pnpm run clean && pnpm run clean:node_modules && rm -r .cache",
"clean:node_modules": "del packages/*/node_modules && del node_modules",
"deps": "cross-env-shell ./scripts/deps/update.sh",
"deps:missing": "node ./scripts/deps/missing.js",
"deps:check": "node ./scripts/deps/check.js",
"deps:types": "./node_modules/typesync/bin/typesync",
"deps:unused": "node ./scripts/deps/unused.js",
"docker": "node ./scripts/docker/generate-docker.js",
"format": "pnpm run lint && pnpm run prettier",
"lint": "eslint packages/*/source --ext .ts --ignore-pattern *.test.ts --fix",
Expand Down
2 changes: 1 addition & 1 deletion packages/api-common/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mainsail - API Common

![banner](https://raw.githubusercontent.com/ArkEcosystem/mainsail/main/banner.png)
![banner](https://raw.githubusercontent.com/ArkEcosystem/mainsail/main/banner.jpeg)

## Documentation

Expand Down
2 changes: 1 addition & 1 deletion packages/api-common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mainsail/api-common",
"version": "0.0.1-alpha.7",
"version": "0.0.1-alpha.8",
"description": "Common API building blocks for the Mainsail blockchain",
"license": "GPL-3.0-only",
"contributors": [],
Expand Down
2 changes: 1 addition & 1 deletion packages/api-database/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mainsail - API Database

![banner](https://raw.githubusercontent.com/ArkEcosystem/mainsail/main/banner.png)
![banner](https://raw.githubusercontent.com/ArkEcosystem/mainsail/main/banner.jpeg)

## Documentation

Expand Down
4 changes: 1 addition & 3 deletions packages/api-database/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mainsail/api-database",
"version": "0.0.1-alpha.7",
"version": "0.0.1-alpha.8",
"description": "API database for the Mainsail blockchain",
"license": "GPL-3.0-only",
"contributors": [],
Expand All @@ -24,10 +24,8 @@
"@mainsail/container": "workspace:*",
"@mainsail/contracts": "workspace:*",
"@mainsail/kernel": "workspace:*",
"@mainsail/utils": "workspace:*",
"dayjs": "1.11.10",
"pg": "8.11.3",
"reflect-metadata": "0.2.0",
"typeorm": "0.3.17"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/api-development/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mainsail - API Development

![banner](https://raw.githubusercontent.com/ArkEcosystem/mainsail/main/banner.png)
![banner](https://raw.githubusercontent.com/ArkEcosystem/mainsail/main/banner.jpeg)

## Documentation

Expand Down
7 changes: 1 addition & 6 deletions packages/api-development/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mainsail/api-development",
"version": "0.0.1-alpha.7",
"version": "0.0.1-alpha.8",
"description": "Development API for the Mainsail blockchain",
"license": "GPL-3.0-only",
"contributors": [],
Expand All @@ -22,20 +22,15 @@
"dependencies": {
"@hapi/boom": "10.0.1",
"@hapi/hapi": "21.3.2",
"@hapi/hoek": "11.0.4",
"@mainsail/api-common": "workspace:*",
"@mainsail/container": "workspace:*",
"@mainsail/contracts": "workspace:*",
"@mainsail/kernel": "workspace:*",
"@mainsail/transactions": "workspace:*",
"@mainsail/utils": "workspace:*",
"joi": "17.11.0",
"nanomatch": "1.2.13",
"rate-limiter-flexible": "3.0.6",
"semver": "7.5.4"
},
"devDependencies": {
"@types/ip": "1.1.3",
"@types/semver": "7.5.6",
"uvu": "^0.5.6"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/api-http/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mainsail - API Http

![banner](https://raw.githubusercontent.com/ArkEcosystem/mainsail/main/banner.png)
![banner](https://raw.githubusercontent.com/ArkEcosystem/mainsail/main/banner.jpeg)

## Documentation

Expand Down
7 changes: 2 additions & 5 deletions packages/api-http/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mainsail/api-http",
"version": "0.0.1-alpha.7",
"version": "0.0.1-alpha.8",
"description": "HTTP/S API for the Mainsail blockchain",
"license": "GPL-3.0-only",
"contributors": [],
Expand All @@ -24,17 +24,14 @@
"dependencies": {
"@hapi/boom": "10.0.1",
"@hapi/hapi": "21.3.2",
"@hapi/hoek": "11.0.4",
"@mainsail/api-common": "workspace:*",
"@mainsail/api-database": "workspace:*",
"@mainsail/container": "workspace:*",
"@mainsail/contracts": "workspace:*",
"@mainsail/kernel": "workspace:*",
"@mainsail/utils": "workspace:*",
"dayjs": "1.11.10",
"joi": "17.11.0",
"nanomatch": "1.2.13",
"rate-limiter-flexible": "3.0.6"
"joi": "17.11.0"
},
"devDependencies": {
"@types/ip": "1.1.3",
Expand Down
2 changes: 0 additions & 2 deletions packages/api-http/test/helpers/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ export const request = async <T = Record<string, any>>(
}

const response = await got(`http://localhost:4003/api/${path}${transform}`);
// console.log(response);

const { statusCode, headers, body } = response;
return { statusCode, headers, data: JSON.parse(body) as T };
};
2 changes: 1 addition & 1 deletion packages/api-sync/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mainsail - API Sync

![banner](https://raw.githubusercontent.com/ArkEcosystem/mainsail/main/banner.png)
![banner](https://raw.githubusercontent.com/ArkEcosystem/mainsail/main/banner.jpeg)

## Documentation

Expand Down
2 changes: 1 addition & 1 deletion packages/api-sync/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mainsail/api-sync",
"version": "0.0.1-alpha.7",
"version": "0.0.1-alpha.8",
"description": "API database sync for the Mainsail blockchain",
"license": "GPL-3.0-only",
"contributors": [],
Expand Down
2 changes: 1 addition & 1 deletion packages/api-transaction-pool/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mainsail - API Transaction pool

![banner](https://raw.githubusercontent.com/ArkEcosystem/mainsail/main/banner.png)
![banner](https://raw.githubusercontent.com/ArkEcosystem/mainsail/main/banner.jpeg)

## Documentation

Expand Down
12 changes: 2 additions & 10 deletions packages/api-transaction-pool/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mainsail/api-transaction-pool",
"version": "0.0.1-alpha.7",
"version": "0.0.1-alpha.8",
"description": "Transaction Pool API for the Mainsail blockchain",
"license": "GPL-3.0-only",
"contributors": [],
Expand All @@ -22,23 +22,15 @@
"dependencies": {
"@hapi/boom": "10.0.1",
"@hapi/hapi": "21.3.2",
"@hapi/hoek": "11.0.4",
"@mainsail/api-common": "workspace:*",
"@mainsail/api-database": "workspace:*",
"@mainsail/container": "workspace:*",
"@mainsail/contracts": "workspace:*",
"@mainsail/kernel": "workspace:*",
"@mainsail/transactions": "workspace:*",
"@mainsail/utils": "workspace:*",
"dayjs": "1.11.10",
"joi": "17.11.0",
"nanomatch": "1.2.13",
"rate-limiter-flexible": "3.0.6"
"joi": "17.11.0"
},
"devDependencies": {
"@types/ip": "1.1.3",
"@types/semver": "7.5.6",
"got": "11.8.6",
"uvu": "^0.5.6"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/api/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mainsail - API

![banner](https://raw.githubusercontent.com/ArkEcosystem/mainsail/main/banner.png)
![banner](https://raw.githubusercontent.com/ArkEcosystem/mainsail/main/banner.jpeg)

## Documentation

Expand Down
20 changes: 10 additions & 10 deletions packages/api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mainsail/api",
"version": "0.0.1-alpha.7",
"version": "0.0.1-alpha.8",
"description": "API for the Mainsail blockchain",
"license": "GPL-3.0-only",
"contributors": [],
Expand Down Expand Up @@ -29,31 +29,31 @@
"@mainsail/api-database": "workspace:*",
"@mainsail/api-http": "workspace:*",
"@mainsail/cli": "workspace:*",
"@mainsail/configuration-generator": "workspace:*",
"@mainsail/container": "workspace:*",
"@mainsail/contracts": "workspace:*",
"@mainsail/kernel": "workspace:*",
"@mainsail/logger-pino": "workspace:*",
"@mainsail/test-framework": "workspace:*",
"@mainsail/utils": "workspace:*",
"boxen": "4.2.0",
"cross-env": "7.0.3",
"dayjs": "1.11.10",
"envfile": "7.0.0",
"execa": "5.1.1",
"fs-extra": "11.2.0",
"joi": "17.11.0",
"kleur": "4.1.5",
"prompts": "2.4.2",
"tmp": "0.2.1",
"uvu": "^0.5.6"
"kleur": "4.1.5"
},
"devDependencies": {
"@mainsail/test-framework": "workspace:*",
"@types/boxen": "3.0.1",
"@types/execa": "2.0.0",
"@types/fs-extra": "11.0.4",
"@types/prompts": "2.4.9",
"@types/tmp": "0.2.6"
"@types/tmp": "0.2.6",
"cross-env": "7.0.3",
"env-paths": "2.2.1",
"execa": "5.1.1",
"prompts": "2.4.2",
"tmp": "0.2.1",
"uvu": "^0.5.6"
},
"peerDependencies": {
"pm2": "^5.3.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/bootstrap/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mainsail - Bootstrap

![banner](https://raw.githubusercontent.com/ArkEcosystem/mainsail/main/banner.png)
![banner](https://raw.githubusercontent.com/ArkEcosystem/mainsail/main/banner.jpeg)

## Documentation

Expand Down
2 changes: 1 addition & 1 deletion packages/bootstrap/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mainsail/bootstrap",
"version": "0.0.1-alpha.7",
"version": "0.0.1-alpha.8",
"description": "Bootstrap manager for the Mainsail blockchain",
"license": "GPL-3.0-only",
"contributors": [],
Expand Down
14 changes: 13 additions & 1 deletion packages/bootstrap/source/bootstrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export class Bootstrapper {
}

await this.#setGenesisCommit();
await this.#checkStoredGenesisCommit();
await this.#storeGenesisCommit();

await this.#restoreStateSnapshot();
Expand Down Expand Up @@ -99,6 +100,17 @@ export class Bootstrapper {

this.#store.setGenesisCommit(genesisBlock);
}
async #checkStoredGenesisCommit(): Promise<void> {
const genesisBlock = await this.databaseService.getBlock(0);

if (!genesisBlock) {
return;
}

if (this.#store.getGenesisCommit().block.data.id !== genesisBlock.data.id) {
throw new Error("Block from crypto.json doesn't match stored genesis block");
}
}

async #storeGenesisCommit(): Promise<void> {
if (!(await this.databaseService.getLastBlock())) {
Expand Down Expand Up @@ -160,7 +172,7 @@ export class Bootstrapper {
const commitState = this.commitStateFactory(commit);
const result = await this.blockProcessor.process(commitState);
if (result === false) {
throw new Error(`Cannot process block`);
throw new Error(`Block is not processed.`);
}
await this.blockProcessor.commit(commitState);
} catch (error) {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mainsail - CLI

![banner](https://raw.githubusercontent.com/ArkEcosystem/mainsail/main/banner.png)
![banner](https://raw.githubusercontent.com/ArkEcosystem/mainsail/main/banner.jpeg)

## Documentation

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mainsail/cli",
"version": "0.0.1-alpha.7",
"version": "0.0.1-alpha.8",
"description": "CLI utilities for the Mainsail blockchain",
"license": "GPL-3.0-only",
"contributors": [],
Expand Down
2 changes: 1 addition & 1 deletion packages/configuration-generator/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mainsail - Configuration generator

![banner](https://raw.githubusercontent.com/ArkEcosystem/mainsail/main/banner.png)
![banner](https://raw.githubusercontent.com/ArkEcosystem/mainsail/main/banner.jpeg)

## Documentation

Expand Down
Loading
Loading