Skip to content

Commit

Permalink
rename package and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
rkamysz committed Jul 27, 2023
1 parent 4b929fd commit bcfe968
Show file tree
Hide file tree
Showing 78 changed files with 172 additions and 189 deletions.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ This package encapsulates the core mechanism, however, complete functionality re

## Dependencies

- [@alien-worlds/api-core](https://github.com/Alien-Worlds/api-core)
- [@alien-worlds/block-reader](https://github.com/Alien-Worlds/block-reader)
- [@alien-worlds/broadcast](https://github.com/Alien-Worlds/broadcast)
- [@alien-worlds/workers](https://github.com/Alien-Worlds/workers)
- [@alien-worlds/aw-core](https://github.com/Alien-Worlds/api-core)
- [@alien-worlds/aw-broadcast](https://github.com/Alien-Worlds/broadcast)
- [@alien-worlds/aw-workers](https://github.com/Alien-Worlds/workers)
- [async](https://github.com/caolan/async)
- [commander](https://github.com/tj/commander.js)

Expand Down Expand Up @@ -42,7 +41,7 @@ This package encapsulates the core mechanism, however, complete functionality re
To add History Tools to your project, use the following command with your favorite package manager:

```bash
yarn add @alien-worlds/api-history-tools
yarn add @alien-worlds/aw-history

```

Expand All @@ -56,7 +55,7 @@ The API process, currently under development, is intended to provide easy access

### Broadcasting

The broadcasting process creates a server for communication between processes, leveraging the @alien-worlds/broadcast module. Processes inform each other about their state, enabling efficient work coordination. The server facilitates the dispatch of messages defining tasks and states, improving performance when processing a high volume of blockchain data.
The broadcasting process creates a server for communication between processes, leveraging the @alien-worlds/aw-broadcast module. Processes inform each other about their state, enabling efficient work coordination. The server facilitates the dispatch of messages defining tasks and states, improving performance when processing a high volume of blockchain data.

### Bootstrap

Expand Down Expand Up @@ -194,7 +193,7 @@ The Config tools are used for generating configuration objects based on values s
## Tutorials
For tutorials on creating and using the history tools for your specific needs, see the tutorials in the [History Tools Starter Kit](https://github.com/Alien-Worlds/history-tools-starter-kit) repository. If you want to create history tools with `mongodb` and `eosjs` tools, you should go to the mentioned repository.
For tutorials on creating and using the history tools for your specific needs, see the tutorials in the [History Tools Starter Kit](https://github.com/Alien-Worlds/aw-history-starter-kit) repository. If you want to create history tools with `mongodb` and `eosjs` tools, you should go to the mentioned repository.
If you want to extend the capabilities of the history tools or take advantage of other third-party resources, please refer to the following tutorial.
Expand Down
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@alien-worlds/api-history-tools",
"version": "0.0.154",
"name": "@alien-worlds/aw-history",
"version": "0.0.0",
"description": "",
"packageManager": "[email protected]",
"main": "build/index.js",
Expand Down Expand Up @@ -34,10 +34,9 @@
"typescript": "^4.8.2"
},
"dependencies": {
"@alien-worlds/api-core": "^0.0.158",
"@alien-worlds/block-reader": "^0.0.18",
"@alien-worlds/broadcast": "^0.0.13",
"@alien-worlds/workers": "^0.0.7",
"@alien-worlds/aw-broadcast": "^0.0.2",
"@alien-worlds/aw-core": "^0.0.2",
"@alien-worlds/aw-workers": "^0.0.2",
"async": "^3.2.4",
"commander": "^10.0.1",
"crypto": "^1.0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/api/api.dependencies.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Container, Result, Route, UnknownObject } from '@alien-worlds/api-core';
import { Container, Result, Route, UnknownObject } from '@alien-worlds/aw-core';
import { DatabaseConfigBuilder, Dependencies } from '../common';
import { Api } from './api';
import { ApiConfig } from './api.types';
Expand Down
2 changes: 1 addition & 1 deletion src/api/api.types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UnknownObject } from '@alien-worlds/api-core';
import { UnknownObject } from '@alien-worlds/aw-core';

export type ApiCommandOptions = {
port: number;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { inject, injectable, Result } from '@alien-worlds/api-core';
import { inject, injectable, Result } from '@alien-worlds/aw-core';
import { ListActionsInput } from './models/list-actions.input';
import { ListActionsOutput } from './models/list-actions.output';
import { ListActionsUseCase } from './use-cases/list-actions.use-case';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ListActionsQueryParams } from '../actions.types';
import { Request, parseToBigInt } from '@alien-worlds/api-core';
import { Request, parseToBigInt } from '@alien-worlds/aw-core';
/**
* @class
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ContractAction, Result } from '@alien-worlds/api-core';
import { ContractAction, Result } from '@alien-worlds/aw-core';

export class ListActionsOutput {
public static create(result: Result<ContractAction[]>): ListActionsOutput {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { injectable, Repository, ContractAction } from '@alien-worlds/api-core';
import { injectable, Repository, ContractAction } from '@alien-worlds/aw-core';

/**
* @abstract
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
injectable,
Result,
UseCase,
} from '@alien-worlds/api-core';
} from '@alien-worlds/aw-core';
import { ContractActionRepository } from '../repositories/contract-action.repository';

/*imports*/
Expand Down
2 changes: 1 addition & 1 deletion src/api/endpoints/actions/routes/list-actions.route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GetRoute, RouteHandler } from '@alien-worlds/api-core';
import { GetRoute, RouteHandler } from '@alien-worlds/aw-core';
import { ListActionsInput } from '../domain/models/list-actions.input';
import { ListActionsOutput } from '../domain/models/list-actions.output';

Expand Down
2 changes: 1 addition & 1 deletion src/api/start-api.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'reflect-metadata';

import { ConfigVars, Route } from '@alien-worlds/api-core';
import { ConfigVars, Route } from '@alien-worlds/aw-core';
import { apiCommand } from './api.command';
import { ApiCommandOptions } from './api.types';
import { buildApiConfig } from '../config';
Expand Down
9 changes: 6 additions & 3 deletions src/bootstrap/__tests__/bootstrap.utils.unit.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import { Result } from '@alien-worlds/api-core';
import { Result } from '@alien-worlds/aw-core';
import {
createDefaultModeBlockRange,
createReplayModeBlockRange,
createTestModeBlockRange,
} from '../bootstrap.utils';
import { Mode } from '../../common';
import { EndBlockOutOfRangeError, StartBlockHigherThanEndBlockError, UndefinedStartBlockError } from '../bootstrap.errors';

import {
EndBlockOutOfRangeError,
StartBlockHigherThanEndBlockError,
UndefinedStartBlockError,
} from '../bootstrap.errors';

describe('createDefaultModeBlockRange', () => {
const originalLog = console.log;
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/__tests__/start-bootstrap.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { NoAbisError } from '../bootstrap.errors';
import { InternalBroadcastMessageName } from '../../broadcast/internal-broadcast.enums';
import { ReaderBroadcastMessage } from '../../broadcast/messages';
import { Mode } from '../../common';
import { BroadcastTcpClient } from '@alien-worlds/broadcast';
import { BroadcastTcpClient } from '@alien-worlds/aw-broadcast';

jest.mock('@alien-worlds/history-tools-common', () => ({
Abis: {
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/bootstrap.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { UnknownObject } from '@alien-worlds/api-core';
import { UnknownObject } from '@alien-worlds/aw-core';
import { AbisServiceConfig } from '../common';
import { BlockRangeScanConfig } from '../common/block-range-scanner';
import { FeaturedConfig } from '../common/featured';
import { BroadcastConfig } from '@alien-worlds/broadcast';
import { BroadcastConfig } from '@alien-worlds/aw-broadcast';

export type BlockchainConfig = {
endpoint: string;
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/bootstrap.dependencies.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BlockchainService, Result } from '@alien-worlds/api-core';
import { BlockchainService, Result } from '@alien-worlds/aw-core';
import { Dependencies } from '../common/dependencies';
import { FeaturedContracts, FeaturedContractDataCriteria } from '../common/featured';
import { BroadcastClient } from '@alien-worlds/broadcast';
import { BroadcastClient } from '@alien-worlds/aw-broadcast';
import { Abis, BlockRangeScanner, BlockState, DatabaseConfigBuilder } from '../common';
import { BootstrapConfig } from './bootstrap.config';

Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/bootstrap.utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BlockchainService, log, parseToBigInt } from '@alien-worlds/api-core';
import { BlockchainService, log, parseToBigInt } from '@alien-worlds/aw-core';
import { BlockRangeData } from './bootstrap.types';
import {
StartBlockHigherThanEndBlockError,
Expand Down
14 changes: 4 additions & 10 deletions src/bootstrap/start-bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import {
InternalBroadcastChannel,
InternalBroadcastMessageName,
} from '../broadcast/internal-broadcast.enums';
import { ConfigVars, log } from '@alien-worlds/api-core';
import { BroadcastMessage } from '@alien-worlds/broadcast';
import { ConfigVars, log } from '@alien-worlds/aw-core';
import { BroadcastMessage } from '@alien-worlds/aw-broadcast';
import { buildBootstrapConfig } from '../config';
import { bootstrapCommand } from './bootstrap.command';
import { BootstrapConfig } from './bootstrap.config';
Expand Down Expand Up @@ -56,14 +56,8 @@ export const bootstrap = async (
throw initResult.failure.error;
}

const {
abis,
broadcastClient,
blockState,
blockchain,
featuredContracts,
scanner,
} = dependencies;
const { abis, broadcastClient, blockState, blockchain, featuredContracts, scanner } =
dependencies;
let blockRange: ReaderBroadcastMessageData;

// fetch latest abis to make sure that the blockchain data will be correctly deserialized
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BroadcastTcpMessageType } from '@alien-worlds/broadcast';
import { BroadcastTcpMessageType } from '@alien-worlds/aw-broadcast';
import { InternalBroadcastMessage } from '../internal-broadcast.message';

describe('InternalBroadcastMessage', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/broadcast/internal-broadcast.message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
BroadcastTcpMessage,
BroadcastTcpMessageContent,
BroadcastTcpMessageType,
} from '@alien-worlds/broadcast';
} from '@alien-worlds/aw-broadcast';

/**
* Represents an internal broadcast message.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
InternalBroadcastChannel,
InternalBroadcastMessageName,
} from '../../internal-broadcast.enums';
import { BroadcastMessage } from '@alien-worlds/broadcast';
import { BroadcastMessage } from '@alien-worlds/aw-broadcast';

describe('ProcessorBroadcastMessage', () => {
describe('ready', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
ReaderBroadcastMessage,
ReaderBroadcastMessageData,
} from '../reader-broadcast.message';
import { BroadcastMessage } from '@alien-worlds/broadcast';
import { BroadcastMessage } from '@alien-worlds/aw-broadcast';
import {
InternalBroadcastChannel,
InternalBroadcastMessageName,
Expand Down
2 changes: 1 addition & 1 deletion src/broadcast/messages/filter-broadcast.message.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BroadcastMessage } from '@alien-worlds/broadcast';
import { BroadcastMessage } from '@alien-worlds/aw-broadcast';
import {
InternalBroadcastChannel,
InternalBroadcastMessageName,
Expand Down
2 changes: 1 addition & 1 deletion src/broadcast/messages/processor-broadcast.message.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BroadcastMessage } from '@alien-worlds/broadcast';
import { BroadcastMessage } from '@alien-worlds/aw-broadcast';
import {
InternalBroadcastChannel,
InternalBroadcastMessageName,
Expand Down
2 changes: 1 addition & 1 deletion src/broadcast/messages/reader-broadcast.message.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BroadcastMessage } from '@alien-worlds/broadcast';
import { BroadcastMessage } from '@alien-worlds/aw-broadcast';
import {
InternalBroadcastChannel,
InternalBroadcastMessageName,
Expand Down
4 changes: 2 additions & 2 deletions src/broadcast/start-broadcast.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ConfigVars } from '@alien-worlds/api-core';
import { BroadcastTcpServer, buildBroadcastConfig } from '@alien-worlds/broadcast';
import { ConfigVars } from '@alien-worlds/aw-core';
import { BroadcastTcpServer, buildBroadcastConfig } from '@alien-worlds/aw-broadcast';

export const startBroadcast = async () => {
const vars = new ConfigVars();
Expand Down
2 changes: 1 addition & 1 deletion src/common/abis/__tests__/abi.repository-impl.unit.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AbisRepositoryImpl } from '../abis.repository-impl';
import { Result, CountParams, ContractEncodedAbi } from '@alien-worlds/api-core';
import { Result, CountParams, ContractEncodedAbi } from '@alien-worlds/aw-core';
import { AbisCache } from '../abis.cache';

jest.mock('../abis.cache');
Expand Down
5 changes: 2 additions & 3 deletions src/common/abis/__tests__/abis.unit.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Abis } from '../abis';
import { AbisRepositoryImpl } from '../abis.repository-impl';
import { Failure, Result, AbiService } from '@alien-worlds/api-core';
import { AbisServiceNotSetError } from '../abis.errors';
import { AbiNotFoundError } from '@alien-worlds/block-reader';
import { Failure, Result, AbiService } from '@alien-worlds/aw-core';
import { AbiNotFoundError, AbisServiceNotSetError } from '../abis.errors';

// Mock dependencies
jest.mock('../abis.repository-impl');
Expand Down
2 changes: 1 addition & 1 deletion src/common/abis/abis.cache.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { ContractEncodedAbi } from '@alien-worlds/api-core';
import { ContractEncodedAbi } from '@alien-worlds/aw-core';

/**
* A function that filters ABI entries based on the block number being greater than or equal to the start block.
Expand Down
6 changes: 6 additions & 0 deletions src/common/abis/abis.errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ export class AbisServiceNotSetError extends Error {
);
}
}

export class AbiNotFoundError extends Error {
constructor() {
super(`ABI data not found`);
}
}
2 changes: 1 addition & 1 deletion src/common/abis/abis.repository-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
RepositoryImpl,
Result,
Where,
} from '@alien-worlds/api-core';
} from '@alien-worlds/aw-core';
import { AbisCache } from './abis.cache';
import { AbisRepository } from './abis.repository';

Expand Down
2 changes: 1 addition & 1 deletion src/common/abis/abis.repository.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ContractEncodedAbi, Result } from '@alien-worlds/api-core';
import { ContractEncodedAbi, Result } from '@alien-worlds/aw-core';

/**
* This class manages ContractEncodedAbi entities, providing CRUD operations and additional functionalities such as caching.
Expand Down
11 changes: 8 additions & 3 deletions src/common/abis/abis.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { AbiService, ContractEncodedAbi, Failure, Result, log } from '@alien-worlds/api-core';
import { AbisServiceNotSetError } from './abis.errors';
import {
AbiService,
ContractEncodedAbi,
Failure,
Result,
log,
} from '@alien-worlds/aw-core';
import { AbiNotFoundError, AbisServiceNotSetError } from './abis.errors';
import { AbisRepository } from './abis.repository';
import { AbiNotFoundError } from '@alien-worlds/block-reader';

/**
* Represents a collection of ABIs (Application Binary Interfaces) for smart contracts.
Expand Down
2 changes: 1 addition & 1 deletion src/common/abis/abis.types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UnknownObject } from '@alien-worlds/api-core';
import { UnknownObject } from '@alien-worlds/aw-core';

export type AbisServiceConfig = {
url: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BlockRangeScan } from './block-range-scan';
import { BlockRangeScanSource } from './block-range-scan.source';
import { Mapper } from '@alien-worlds/api-core';
import { Mapper } from '@alien-worlds/aw-core';

export type ScanRequest = {
error?: Error;
Expand Down
2 changes: 1 addition & 1 deletion src/common/block-range-scanner/block-range-scan.source.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-unsafe-return */

import { DataSource } from '@alien-worlds/api-core';
import { DataSource } from '@alien-worlds/aw-core';

export abstract class BlockRangeScanSource<T = unknown> extends DataSource {
public abstract startNextScan(scanKey: string): Promise<T>;
Expand Down
2 changes: 1 addition & 1 deletion src/common/block-range-scanner/block-range-scan.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import crypto from 'crypto';
import { parseToBigInt, removeUndefinedProperties } from '@alien-worlds/api-core';
import { parseToBigInt, removeUndefinedProperties } from '@alien-worlds/aw-core';
import { serialize } from 'v8';

export class BlockRangeScanParent {
Expand Down
4 changes: 2 additions & 2 deletions src/common/block-state/__tests__/block-state.unit.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { RepositoryImpl, Failure, Result } from '@alien-worlds/api-core';
import { RepositoryImpl, Failure, Result } from '@alien-worlds/aw-core';
import { BlockState } from '../block-state';

jest.mock('@alien-worlds/api-core');
jest.mock('@alien-worlds/aw-core');
jest.mock('./block-state.types');

describe('BlockState', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/common/block-state/block-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
QueryBuilders,
RepositoryImpl,
Result,
} from '@alien-worlds/api-core';
} from '@alien-worlds/aw-core';
import { BlockStateModel } from './block-state.types';

/**
Expand Down
2 changes: 1 addition & 1 deletion src/common/common.types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ConfigVars, UnknownObject } from '@alien-worlds/api-core';
import { ConfigVars, UnknownObject } from '@alien-worlds/aw-core';

export type DatabaseConfigBuilder = (
vars: ConfigVars,
Expand Down
2 changes: 1 addition & 1 deletion src/common/dependencies.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Result } from '@alien-worlds/api-core';
import { Result } from '@alien-worlds/aw-core';

/**
* An abstract class representing a Process dependencies.
Expand Down
2 changes: 1 addition & 1 deletion src/common/featured/featured-contract.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parseToBigInt } from '@alien-worlds/api-core';
import { parseToBigInt } from '@alien-worlds/aw-core';

/**
* Class representing a FeaturedContract
Expand Down
Loading

0 comments on commit bcfe968

Please sign in to comment.