Skip to content

Commit 2474596

Browse files
authored
Merge pull request #380 from ainblockchain/release/0.7.1
Release/0.7.1 to master branch
2 parents 90072d7 + d48c2bd commit 2474596

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+5856
-3344
lines changed

README.md

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ NOTE: Tracker Server must be started first before starting any blockchain node i
1313

1414
#### Local
1515

16-
- Clone this repository and install npm packages
16+
- Clone this repository and install yarn packages
17+
- Highly recommend to use node version >= 12
1718
```
1819
git clone https://github.com/ainblockchain/ain-blockchain.git
1920
cd ain-blockchain/tracker-server/
@@ -38,7 +39,7 @@ sh deploy_blockchain_gcp.sh {dev|spring|summer} <YOUR_GCP_USER_NAME> <NUMBER_OF_
3839
```
3940
sh setup_blockchain_ubuntu.sh
4041
```
41-
- Copy files to a sharable folder & install npm packages
42+
- Copy files to a sharable folder & install yarn packages
4243
```
4344
source setup_tracker_gcp.sh
4445
```
@@ -84,17 +85,18 @@ Operates a single peer node instance of the AIN blockchain. A single blockchain
8485

8586
#### Local
8687

87-
- Clone this repository and install npm packages
88+
- Clone this repository and install yarn packages
89+
- Highly recommend to use node version >= 12
8890
```
8991
git clone https://github.com/ainblockchain/ain-blockchain.git
9092
cd ain-blockchain/
9193
yarn install
9294
```
9395
- Run blockchain nodes
9496
```
95-
MIN_NUM_VALIDATORS=3 ACCOUNT_INDEX=0 DEBUG=false STAKE=250 CONSOLE_LOG=true ENABLE_DEV_CLIENT_API=true node client/index.js
96-
MIN_NUM_VALIDATORS=3 ACCOUNT_INDEX=1 DEBUG=false STAKE=250 CONSOLE_LOG=true ENABLE_DEV_CLIENT_API=true node client/index.js
97-
MIN_NUM_VALIDATORS=3 ACCOUNT_INDEX=2 DEBUG=false STAKE=250 CONSOLE_LOG=true ENABLE_DEV_CLIENT_API=true node client/index.js
97+
MIN_NUM_VALIDATORS=3 ACCOUNT_INDEX=0 DEBUG=false STAKE=250 CONSOLE_LOG=true ENABLE_DEV_CLIENT_API=true ENABLE_GAS_FEE_WORKAROUND=true node client/index.js
98+
MIN_NUM_VALIDATORS=3 ACCOUNT_INDEX=1 DEBUG=false STAKE=250 CONSOLE_LOG=true ENABLE_DEV_CLIENT_API=true ENABLE_GAS_FEE_WORKAROUND=true node client/index.js
99+
MIN_NUM_VALIDATORS=3 ACCOUNT_INDEX=2 DEBUG=false STAKE=250 CONSOLE_LOG=true ENABLE_DEV_CLIENT_API=true ENABLE_GAS_FEE_WORKAROUND=true node client/index.js
98100
```
99101
You can override default port numbering system by setting `PORT` and `P2P_PORT` environment variables.
100102
Before starting node jobs, remove existing blockchain files and logs if necessary:
@@ -105,17 +107,7 @@ The default minimum size of the validator whitelist is 3. Change MIN_NUM_VALIDAT
105107
the genesis-configs/base/genesis.json to change this value. You may also need to modify the GENESIS_WHITELIST and GENESIS_VALIDATORS accordingly.
106108
The genesis configs directory used is `genesis-configs/base` by default and it can be altered using `GENESIS_CONFIGS_DIR` env variable. For example, afan shard cluster can use the following command line:
107109
```
108-
GENESIS_CONFIGS_DIR=genesis-configs/afan-shard MIN_NUM_VALIDATORS=1 ACCOUNT_INDEX=0 DEBUG=false STAKE=250 CONSOLE_LOG=true ENABLE_DEV_CLIENT_API=true node client/index.js
109-
```
110-
111-
### How to run tests
112-
113-
Please check your node version before running the below tests. Tests has passed node version 10.15.*
114-
115-
```
116-
npm run test_unit
117-
npm run test_smoke
118-
npm run test_integration
110+
GENESIS_CONFIGS_DIR=genesis-configs/afan-shard MIN_NUM_VALIDATORS=1 ACCOUNT_INDEX=0 DEBUG=false STAKE=250 CONSOLE_LOG=true ENABLE_DEV_CLIENT_API=true ENABLE_GAS_FEE_WORKAROUND=true node client/index.js
119111
```
120112

121113
#### On Google Coud Platform (GCP)
@@ -130,7 +122,7 @@ sh deploy_blockchain_gcp.sh {dev|spring|summer} <YOUR_GCP_USER_NAME> <NUMBER_OF_
130122
```
131123
sh setup_blockchain_ubuntu.sh
132124
```
133-
- Copy files to a sharable folder & install npm packages
125+
- Copy files to a sharable folder & install yarn packages
134126
```
135127
source setup_node_gcp.sh
136128
```
@@ -172,10 +164,29 @@ cat logger/logs/8080/<log_file>
172164

173165
### How to run tests
174166

167+
Please check your node version before running the below tests. Tests has passed node version 12.*
168+
169+
How to run unit test and integration test all around.
175170
```
176-
npm run test_unit
177-
npm run test_smoke
178-
npm run test_integration
171+
yarn run test_unit
172+
yarn run test_integration
173+
```
174+
175+
Some individual tests already definded in the package.json.
176+
```
177+
yarn run test_chain_util
178+
yarn run test_state_util
179+
yarn run test_block_pool
180+
yarn run test_db
181+
yarn run test_node
182+
yarn run test_blockchain
183+
yarn run test_dapp
184+
yarn run test_sharding
185+
```
186+
187+
The load test is also supported.
188+
```
189+
yarn run loadtest
179190
```
180191

181192
### Client API for development and debugging
@@ -291,6 +302,13 @@ and can be stopped all at once using `stop_servers.sh` like:
291302
sh stop_servers.sh
292303
```
293304

305+
## Versions
306+
307+
Please check the latest versions below:
308+
- API_VERSION: [Release](https://github.com/ainblockchain/ain-blockchain/releases)
309+
- DATA_PROTOCOL_VERSION: [README.md](./p2p/README.md)
310+
- CONSENSUS_PROTOCOL_VERSION: [README.md](./consensus/README.md)
311+
294312
## Contribution
295313

296314
Please read the [CONTRIBUTING.md](./CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.

blockchain/block.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ class Block {
311311
}
312312
resList.push(res);
313313
}
314-
const { gasAmountTotal, gasCostTotal } = ChainUtil.getGasAmountCostTotalFromTxList(genesisTxs, resList);
314+
const { gasAmountTotal, gasCostTotal } = ChainUtil.getServiceGasCostTotalFromTxList(genesisTxs, resList);
315315
return {
316316
stateProofHash: tempGenesisDb.getStateProof('/')[ProofProperties.PROOF_HASH],
317317
gasAmountTotal,

client/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,9 @@ function createSingleSetTxBody(input, opType) {
476476
if (input.timestamp !== undefined) {
477477
txBody.timestamp = input.timestamp;
478478
}
479-
txBody.gas_price = input.gas_price !== undefined ? input.gas_price : 1;
479+
if (input.gas_price !== undefined) {
480+
txBody.gas_price = input.gas_price;
481+
}
480482
return txBody;
481483
}
482484

@@ -496,14 +498,15 @@ function createMultiSetTxBody(input) {
496498
if (input.timestamp !== undefined) {
497499
txBody.timestamp = input.timestamp;
498500
}
499-
txBody.gas_price = input.gas_price !== undefined ? input.gas_price : 1;
501+
if (input.gas_price !== undefined) {
502+
txBody.gas_price = input.gas_price;
503+
}
500504
return txBody;
501505
}
502506

503507
function createBatchTxBody(input) {
504508
const txList = [];
505509
for (const tx of input.tx_list) {
506-
tx.gas_price = tx.gas_price !== undefined ? tx.gas_price : 1;
507510
txList.push(tx);
508511
}
509512
return { tx_body_list: txList };

client/protocol_versions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,8 @@
2525
},
2626
"0.7.0": {
2727
"min": "0.7.0"
28+
},
29+
"0.7.1": {
30+
"min": "0.7.0"
2831
}
2932
}

0 commit comments

Comments
 (0)