Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1810 from LiskHQ/1809-update-lisk-sdk-to-v6-0-0-b…
Browse files Browse the repository at this point in the history
…eta-7

Update Lisk SDK to v6.0.0-beta.7
  • Loading branch information
sameersubudhi authored Aug 21, 2023
2 parents 5a68969 + 10d31bf commit 6eaa5e3
Show file tree
Hide file tree
Showing 57 changed files with 54,557 additions and 53,970 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ The Gateway service provides the following APIs, which all users of Lisk Service

## Installation

The default port for REST API requests and Socket.IO-based communication is `9901`. The API is accessible through the URL `http://localhost:9901` when running locally. The REST API is accessible via HTTP clients such as [Postman](https://www.postman.com/), [cURL](https://curl.haxx.se/) and [HTTPie](https://httpie.org/).
The default port for REST API requests and Socket.IO-based communication is `9901`. The API is accessible through the URL `http://127.0.0.1:9901` when running locally. The REST API is accessible via HTTP clients such as [Postman](https://www.postman.com/), [cURL](https://curl.haxx.se/) and [HTTPie](https://httpie.org/).

WebSocket-based APIs can be used through the [Socket.IO](https://socket.io/) library available for many modern programming languages and frameworks.

Expand Down Expand Up @@ -147,11 +147,11 @@ make down
## Benchmark

Assuming lisk-service is running on the localhost:9901, and you are in the root of this repo, you can run the following:
Assuming lisk-service is running on the `127.0.0.1:9901`, and you are in the root of this repo, you can run the following:

```bash
cd tests
LISK_SERVICE_URL=http://localhost:9901 npm run benchmark
LISK_SERVICE_URL=http://127.0.0.1:9901 npm run benchmark
```

## Further development
Expand Down
8 changes: 4 additions & 4 deletions docs/antora/modules/ROOT/pages/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ The Gateway service provides the following APIs, which all users of Lisk Service
// == Installation

// The default port for REST API requests and Socket.IO-based communication is `9901`.
// The API is accessible through the URL `http://localhost:9901` when running locally.
// The API is accessible through the URL `http://127.0.0.1:9901` when running locally.
// The REST API is accessible via HTTP clients such as {url_postman}[Postman^], {url_curl}[cURL^] and {url_curl}[HTTPie^].

// The WebSocket-based APIs can be accessed with the help of the {url_socket}[Socket.IO^] library that is available for many programming languages and frameworks.
Expand Down Expand Up @@ -300,7 +300,7 @@ For example:
// .Example request: Obtain a list of the block generators in the current round.
// [source,bash]
// ----
// curl -X GET "http://localhost:9901/api/v3/generators" -H "accept: application/json"
// curl -X GET "http://127.0.0.1:9901/api/v3/generators" -H "accept: application/json"
// ----

// .Example response
Expand Down Expand Up @@ -375,7 +375,7 @@ Lisk Testnet::
// jsome.params.colored = true;

// Use local Service node
// const WS_RPC_ENDPOINT = 'ws://localhost:9901/rpc-v3';
// const WS_RPC_ENDPOINT = 'ws://127.0.0.1:9901/rpc-v3';
//Use public Service node
//const WS_RPC_ENDPOINT = "wss://service.lisk.com/rpc-v3";

Expand Down Expand Up @@ -437,7 +437,7 @@ Lisk Testnet::
// jsome.params.colored = true;

// Uses local Service node
// const WS_SUBSCRIBE_ENDPOINT = 'ws://localhost:9901/blockchain';
// const WS_SUBSCRIBE_ENDPOINT = 'ws://127.0.0.1:9901/blockchain';
// Uses public Service node
//const WS_SUBSCRIBE_ENDPOINT = "wss://service.lisk.com/blockchain";

Expand Down
4 changes: 2 additions & 2 deletions docs/antora/modules/ROOT/pages/reference/rpc-api.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
:toc:

== Access paths and compatibility
The RPC WebSocket API can be accessed by the `ws://localhost:9901/rpc-v2`.
The RPC WebSocket API can be accessed by the `ws://127.0.0.1:9901/rpc-v2`.

=== Access paths and compatibility
The WebSocket API can be accessed by the `wss://service.lisk.com/rpc-v2`.
Expand Down Expand Up @@ -31,7 +31,7 @@ const request = async (endpoint, method, params) => new Promise(resolve => {
});
const wsRequest = async () => {
return await request('ws://localhost:9901/rpc', 'get.accounts', { "address": "lskzkfw7ofgp3uusknbetemrey4aeatgf2ntbhcds" });
return await request('ws://127.0.0.1:9901/rpc', 'get.accounts', { "address": "lskzkfw7ofgp3uusknbetemrey4aeatgf2ntbhcds" });
};
wsRequest().then(response => {
Expand Down
2 changes: 1 addition & 1 deletion docs/antora/modules/ROOT/pages/setup/source.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ mysql -uroot
Then run the following command to update the root password:

----
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '';
ALTER USER 'root'@'127.0.0.1' IDENTIFIED WITH mysql_native_password BY '';
----

Now you should be able to login to your MySQL 8 via your MySQL Client.
Expand Down
2 changes: 1 addition & 1 deletion docs/build_from_source.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pm2 start ecosystem.config.js
npm start
```

To check the service status, navigate to the URL <http://localhost:9901/api/status>. If it is running on a remote system, change the host name from `localhost` to the external IP Address of your machine.
To check the service status, navigate to the URL <http://127.0.0.1:9901/api/status>. If it is running on a remote system, change the host IP from `127.0.0.1` to the external IP address of your machine.

### Lisk Service Status

Expand Down
4 changes: 2 additions & 2 deletions docs/config_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ When using the Docker setup, the default values specified in the [`docker/exampl
```bash
# Must be identical for all microservices
# Make sure that all microservices are able to connect with the common Redis
SERVICE_BROKER=redis://localhost:6379/0
SERVICE_BROKER=redis://127.0.0.1:6379/0

# Number of seconds to wait before returning a RequestTimeout error when it takes too long to return a value. To disable use 0.
SERVICE_BROKER_TIMEOUT=10
Expand All @@ -23,7 +23,7 @@ SERVICE_BROKER_TIMEOUT=10
SERVICE_LOG_STDOUT=true # Asynchronous console output (non-blocking, preferred)
SERVICE_LOG_CONSOLE=false # console.log() output, only for debug
SERVICE_LOG_FILE=false # file path ex. ./logs/service.log
SERVICE_LOG_GELF=false # GELF output for remote logging ex. Graylog localhost:12201/udp
SERVICE_LOG_GELF=false # GELF output for remote logging ex. Graylog 127.0.0.1:12201/udp
SERVICE_LOG_LEVEL=info # Default log level
DOCKER_HOST=local # Custom field for logger. This will result in all log messages having the custom field _docker_host set to 'local'.
```
Expand Down
44 changes: 22 additions & 22 deletions ecosystem.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ module.exports = {
autorestart: true,
env: {
// --- Remember to set the properties below
SERVICE_BROKER: 'redis://localhost:6379/0',
SERVICE_GATEWAY_REDIS_VOLATILE: 'redis://localhost:6379/5',
SERVICE_BROKER: 'redis://127.0.0.1:6379/0',
SERVICE_GATEWAY_REDIS_VOLATILE: 'redis://127.0.0.1:6379/5',
ENABLE_HTTP_API: 'http-status,http-version3,http-exports',
ENABLE_WS_API: 'blockchain,rpc-v3',
GATEWAY_DEPENDENCIES: 'indexer,connector',
Expand Down Expand Up @@ -79,7 +79,7 @@ module.exports = {
autorestart: true,
env: {
// --- Remember to set the properties below
SERVICE_BROKER: 'redis://localhost:6379/0',
SERVICE_BROKER: 'redis://127.0.0.1:6379/0',
SERVICE_APP_REGISTRY_MYSQL: 'mysql://lisk:password@127.0.0.1:3306/lisk',
ENABLE_REBUILD_INDEX_AT_INIT: false,
// SERVICE_BROKER_TIMEOUT: 10,
Expand Down Expand Up @@ -111,8 +111,8 @@ module.exports = {
autorestart: true,
env: {
// --- Remember to set the properties below
SERVICE_BROKER: 'redis://localhost:6379/0',
LISK_APP_WS: 'ws://localhost:7887',
SERVICE_BROKER: 'redis://127.0.0.1:6379/0',
LISK_APP_WS: 'ws://127.0.0.1:7887',
GEOIP_JSON: 'https://geoip.lisk.com/json',
// ENABLE_BLOCK_CACHING: true,
// EXPIRY_IN_HOURS: 12,
Expand Down Expand Up @@ -147,10 +147,10 @@ module.exports = {
autorestart: true,
env: {
// --- Remember to set the properties below
SERVICE_BROKER: 'redis://localhost:6379/0',
SERVICE_INDEXER_CACHE_REDIS: 'redis://localhost:6379/1',
SERVICE_INDEXER_REDIS_VOLATILE: 'redis://localhost:6379/2',
SERVICE_MESSAGE_QUEUE_REDIS: 'redis://localhost:6379/3',
SERVICE_BROKER: 'redis://127.0.0.1:6379/0',
SERVICE_INDEXER_CACHE_REDIS: 'redis://127.0.0.1:6379/1',
SERVICE_INDEXER_REDIS_VOLATILE: 'redis://127.0.0.1:6379/2',
SERVICE_MESSAGE_QUEUE_REDIS: 'redis://127.0.0.1:6379/3',
SERVICE_INDEXER_MYSQL: 'mysql://lisk:password@127.0.0.1:3306/lisk',
ENABLE_DATA_RETRIEVAL_MODE: true,
ENABLE_INDEXING_MODE: true,
Expand Down Expand Up @@ -202,8 +202,8 @@ module.exports = {
autorestart: true,
env: {
// --- Remember to set the properties below
SERVICE_BROKER: 'redis://localhost:6379/0',
SERVICE_MESSAGE_QUEUE_REDIS: 'redis://localhost:6379/3',
SERVICE_BROKER: 'redis://127.0.0.1:6379/0',
SERVICE_MESSAGE_QUEUE_REDIS: 'redis://127.0.0.1:6379/3',
// SERVICE_BROKER_TIMEOUT: 10,
// SERVICE_LOG_LEVEL: 'info',
// SERVICE_LOG_CONSOLE: false,
Expand All @@ -229,8 +229,8 @@ module.exports = {
autorestart: true,
env: {
// --- Remember to set the properties below
SERVICE_BROKER: 'redis://localhost:6379/0',
SERVICE_FEE_ESTIMATOR_CACHE: 'redis://localhost:6379/1',
SERVICE_BROKER: 'redis://127.0.0.1:6379/0',
SERVICE_FEE_ESTIMATOR_CACHE: 'redis://127.0.0.1:6379/1',
ENABLE_FEE_ESTIMATOR_QUICK: true,
ENABLE_FEE_ESTIMATOR_FULL: false,
// FEE_EST_COLD_START_BATCH_SIZE: 1,
Expand All @@ -245,7 +245,6 @@ module.exports = {
// SERVICE_LOG_GELF: false,
// SERVICE_LOG_FILE: false,
// DOCKER_HOST: 'local',

},
},
{
Expand All @@ -262,8 +261,8 @@ module.exports = {
autorestart: true,
env: {
// --- Remember to set the properties below
SERVICE_BROKER: 'redis://localhost:6379/0',
SERVICE_STATISTICS_REDIS: 'redis://localhost:6379/1',
SERVICE_BROKER: 'redis://127.0.0.1:6379/0',
SERVICE_STATISTICS_REDIS: 'redis://127.0.0.1:6379/1',
SERVICE_STATISTICS_MYSQL: 'mysql://lisk:password@127.0.0.1:3306/lisk',
TRANSACTION_STATS_HISTORY_LENGTH_DAYS: 366,
// SERVICE_STATISTICS_MYSQL_READ_REPLICA: 'mysql://reader:password@127.0.0.1:3307/lisk',
Expand Down Expand Up @@ -294,10 +293,11 @@ module.exports = {
autorestart: true,
env: {
// --- Remember to set the properties below
SERVICE_BROKER: 'redis://localhost:6379/0',
SERVICE_MARKET_REDIS: 'redis://localhost:6379/2',
SERVICE_BROKER: 'redis://127.0.0.1:6379/0',
SERVICE_MARKET_REDIS: 'redis://127.0.0.1:6379/2',
SERVICE_MARKET_FIAT_CURRENCIES: 'EUR,USD,CHF,GBP,RUB,PLN,JPY,AUD,GBP,INR',
SERVICE_MARKET_TARGET_PAIRS: 'LSK_BTC,LSK_EUR,LSK_USD,LSK_CHF,LSK_PLN,LSK_JPY,LSK_AUD,LSK_GBP,LSK_INR,BTC_EUR,BTC_USD,BTC_CHF',
SERVICE_MARKET_TARGET_PAIRS:
'LSK_BTC,LSK_EUR,LSK_USD,LSK_CHF,LSK_PLN,LSK_JPY,LSK_AUD,LSK_GBP,LSK_INR,BTC_EUR,BTC_USD,BTC_CHF',
// EXCHANGERATESAPI_IO_API_KEY: ''
// SERVICE_BROKER_TIMEOUT: 10,
// SERVICE_LOG_LEVEL: 'info',
Expand Down Expand Up @@ -331,9 +331,9 @@ module.exports = {
max_memory_restart: '300M',
autorestart: true,
env: {
SERVICE_BROKER: 'redis://localhost:6379/0',
SERVICE_EXPORT_REDIS: 'redis://localhost:6379/3',
SERVICE_EXPORT_REDIS_VOLATILE: 'redis://localhost:6379/4',
SERVICE_BROKER: 'redis://127.0.0.1:6379/0',
SERVICE_EXPORT_REDIS: 'redis://127.0.0.1:6379/3',
SERVICE_EXPORT_REDIS_VOLATILE: 'redis://127.0.0.1:6379/4',
// SERVICE_EXPORT_PARTIALS: './data/partials',
// EXPORT_S3_BUCKET_NAME_PARTIALS: 'partials',
// SERVICE_EXPORT_STATIC: './data/static',
Expand Down
34 changes: 17 additions & 17 deletions ecosystem.jenkins.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ module.exports = {
autorestart: true,
env: {
PORT: 9901,
SERVICE_BROKER: 'redis://localhost:6379/0',
SERVICE_GATEWAY_REDIS_VOLATILE: 'redis://localhost:6379/3',
SERVICE_BROKER: 'redis://127.0.0.1:6379/0',
SERVICE_GATEWAY_REDIS_VOLATILE: 'redis://127.0.0.1:6379/3',
ENABLE_HTTP_API: 'http-status,http-version3,http-exports',
ENABLE_WS_API: 'blockchain,rpc-v3',
GATEWAY_DEPENDENCIES: 'indexer,connector',
Expand Down Expand Up @@ -61,7 +61,7 @@ module.exports = {
autorestart: true,
env: {
// --- Remember to set the properties below
SERVICE_BROKER: 'redis://localhost:6379/0',
SERVICE_BROKER: 'redis://127.0.0.1:6379/0',
SERVICE_APP_REGISTRY_MYSQL: 'mysql://lisk:password@127.0.0.1:3306/lisk',
ENABLE_REBUILD_INDEX_AT_INIT: false,
},
Expand All @@ -80,8 +80,8 @@ module.exports = {
autorestart: true,
env: {
// --- Remember to set the properties below
SERVICE_BROKER: 'redis://localhost:6379/0',
LISK_APP_WS: 'ws://localhost:7887',
SERVICE_BROKER: 'redis://127.0.0.1:6379/0',
LISK_APP_WS: 'ws://127.0.0.1:7887',
GEOIP_JSON: 'https://geoip.lisk.com/json',
// USE_LISK_IPC_CLIENT: true,
// LISK_APP_DATA_PATH: '~/.lisk/lisk-core',
Expand All @@ -102,10 +102,10 @@ module.exports = {
autorestart: true,
env: {
// --- Remember to set the properties below
SERVICE_BROKER: 'redis://localhost:6379/0',
SERVICE_INDEXER_CACHE_REDIS: 'redis://localhost:6379/1',
SERVICE_INDEXER_REDIS_VOLATILE: 'redis://localhost:6379/2',
SERVICE_MESSAGE_QUEUE_REDIS: 'redis://localhost:6379/3',
SERVICE_BROKER: 'redis://127.0.0.1:6379/0',
SERVICE_INDEXER_CACHE_REDIS: 'redis://127.0.0.1:6379/1',
SERVICE_INDEXER_REDIS_VOLATILE: 'redis://127.0.0.1:6379/2',
SERVICE_MESSAGE_QUEUE_REDIS: 'redis://127.0.0.1:6379/3',
SERVICE_INDEXER_MYSQL: 'mysql://lisk:password@127.0.0.1:3306/lisk',
ENABLE_DATA_RETRIEVAL_MODE: true,
ENABLE_INDEXING_MODE: true,
Expand All @@ -126,8 +126,8 @@ module.exports = {
autorestart: true,
env: {
// --- Remember to set the properties below
SERVICE_BROKER: 'redis://localhost:6379/0',
SERVICE_MESSAGE_QUEUE_REDIS: 'redis://localhost:6379/3',
SERVICE_BROKER: 'redis://127.0.0.1:6379/0',
SERVICE_MESSAGE_QUEUE_REDIS: 'redis://127.0.0.1:6379/3',
},
},
{
Expand All @@ -144,8 +144,8 @@ module.exports = {
autorestart: true,
env: {
// --- Remember to set the properties below
SERVICE_BROKER: 'redis://localhost:6379/0',
SERVICE_FEE_ESTIMATOR_CACHE: 'redis://localhost:6379/1',
SERVICE_BROKER: 'redis://127.0.0.1:6379/0',
SERVICE_FEE_ESTIMATOR_CACHE: 'redis://127.0.0.1:6379/1',
ENABLE_FEE_ESTIMATOR_QUICK: true,
ENABLE_FEE_ESTIMATOR_FULL: false,
},
Expand All @@ -164,8 +164,8 @@ module.exports = {
autorestart: true,
env: {
// --- Remember to set the properties below
SERVICE_BROKER: 'redis://localhost:6379/0',
SERVICE_STATISTICS_REDIS: 'redis://localhost:6379/1',
SERVICE_BROKER: 'redis://127.0.0.1:6379/0',
SERVICE_STATISTICS_REDIS: 'redis://127.0.0.1:6379/1',
SERVICE_STATISTICS_MYSQL: 'mysql://lisk:password@127.0.0.1:3306/lisk',
TRANSACTION_STATS_HISTORY_LENGTH_DAYS: 366,
},
Expand All @@ -183,8 +183,8 @@ module.exports = {
max_memory_restart: '300M',
autorestart: true,
env: {
SERVICE_BROKER: 'redis://localhost:6379/0',
SERVICE_MARKET_REDIS: 'redis://localhost:6379/2',
SERVICE_BROKER: 'redis://127.0.0.1:6379/0',
SERVICE_MARKET_REDIS: 'redis://127.0.0.1:6379/2',
SERVICE_MARKET_FIAT_CURRENCIES: 'EUR,USD,CHF,GBP,RUB',
SERVICE_MARKET_TARGET_PAIRS: 'LSK_BTC,LSK_EUR,LSK_USD,LSK_CHF,BTC_EUR,BTC_USD,BTC_CHF',
// EXCHANGERATESAPI_IO_API_KEY: ''
Expand Down
17 changes: 12 additions & 5 deletions framework/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Lisk Service Framework is made for quick development of Micoservice-based applications with minimal requirements.

It has the following features built-in:

- Microservice framework based on Moleculer
- Logger with GELF support
- HTTP library with LRU cache
Expand All @@ -13,6 +14,7 @@ All modules can be easily replaced by other libraries when needed.
## Installation

Set the target URL to the desired tarball distribution permalink.

```
npm install https://github.com/LiskHQ/lisk-service/raw/2fbc65f49ae5c5aaa3689667051dbd4082b8c25a/framework/dist/lisk-service-framework-1.4.10.tgz
```
Expand All @@ -39,7 +41,7 @@ const logger = Logger('test-microservice');
// Initialize Microservice framework
const app = Microservice({
name: 'test',
transporter: 'redis://localhost:6379',
transporter: 'redis://127.0.0.1:6379',
logger: Logger('test-moleculer'),
});

Expand All @@ -48,14 +50,19 @@ app.addMethod({
name: 'hello',
description: 'Hello method',
controller: async () => ({
data: { message: 'Hello World!' }
data: { message: 'Hello World!' },
}),
});

// Run the application
app.run().then(() => {
logger.info(`Service started`);
}).catch((err) => { logger.fatal(err.stack) });
app
.run()
.then(() => {
logger.info(`Service started`);
})
.catch(err => {
logger.fatal(err.stack);
});
```

Browse the Lisk Service Template repo for more examples.
Expand Down
2 changes: 1 addition & 1 deletion framework/bin/moleculer_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const cliParams = process.argv[3] ? JSON.parse(process.argv[3]) : undefined;
const TIMEOUT = 15 * 1000;

const broker = new ServiceBroker({
transporter: 'redis://localhost:6379',
transporter: 'redis://127.0.0.1:6379',
logLevel: 'info',
requestTimeout: 15 * 1000,
logger: console,
Expand Down
2 changes: 1 addition & 1 deletion framework/bin/moleculer_subscribe.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if (process.argv.length < 0) {
// const TIMEOUT = 15 * 1000;

const broker = new ServiceBroker({
transporter: 'redis://localhost:6379',
transporter: 'redis://127.0.0.1:6379',
logLevel: 'info',
requestTimeout: 15 * 1000,
logger: console,
Expand Down
2 changes: 1 addition & 1 deletion framework/bin/socket_io_rpc_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const colorize = require('json-colorizer');
const { events } = require('../constants/event');

/* Usage:
* node socket_io_rpc_client.js http://localhost:9901/rpc-test get.hello.param '{"path_name1": "user1"}'
* node socket_io_rpc_client.js http://127.0.0.1:9901/rpc-test get.hello.param '{"path_name1": "user1"}'
*/

if (process.argv.length < 4) {
Expand Down
Loading

0 comments on commit 6eaa5e3

Please sign in to comment.