ainblockchain / ain-blockchain

Official Javascript implementation of AI Network Blockchain.
https://www.ainetwork.ai/
MIT License
67 stars 27 forks source link

[BUG] bootstraping dev client API issue (ip whitelist middle location issue) #1081

Closed platfowner closed 2 years ago

platfowner commented 2 years ago

account injection fails with errors:

[createTimerFlagEnabledBandageMap] Registering bandage files:
[createTimerFlagEnabledBandageMap] [0] Registering /Users/seo/git/comcomai/blockchain/ain-blockchain/db/bandage-files/allow_lower_case_app_names_only.js
[createTimerFlagEnabledBandageMap] [1] Registering /Users/seo/git/comcomai/blockchain/ain-blockchain/db/bandage-files/create_app_config_sanitization.js
[createTimerFlagEnabledBandageMap] [2] Registering /Users/seo/git/comcomai/blockchain/ain-blockchain/db/bandage-files/native_service_path_length_check.js
[createTimerFlagEnabledBandageMap] [3] Registering /Users/seo/git/comcomai/blockchain/ain-blockchain/db/bandage-files/update_max_state_tree_size_per_byte.js
[createTimerFlagEnabledBandageMap] [4] Registering /Users/seo/git/comcomai/blockchain/ain-blockchain/db/bandage-files/staking_balance_total_sum.js
[createTimerFlagEnabledBandageMap] [5] Registering /Users/seo/git/comcomai/blockchain/ain-blockchain/db/bandage-files/update_max_state_tree_size_per_byte2.js
[createTimerFlagEnabledBandageMap] [6] Registering /Users/seo/git/comcomai/blockchain/ain-blockchain/db/bandage-files/update_bandwidth_budget_params.js
[createTimerFlagEnabledBandageMap] [7] Skipping for timer flag: disable_tx_receipt_recording
[createTimerFlagEnabledBandageMap] [8] Skipping for timer flag: extend_account_registration_gas_amount
[createTimerFlagEnabledBandageMap] [9] Registering /Users/seo/git/comcomai/blockchain/ain-blockchain/db/bandage-files/add_app_creation_gas_amount.js
Enter keystore path: testnet_prod_keys/keystore_node_9.json
Enter password: 
sendGetBootstrapPubKeyRequest Error: Request failed with status code 403
(node:82927) UnhandledPromiseRejectionWarning: Error: Request failed with status code 403
    at createError (/Users/seo/git/comcomai/blockchain/ain-blockchain/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/Users/seo/git/comcomai/blockchain/ain-blockchain/node_modules/axios/lib/core/settle.js:17:12)
    at IncomingMessage.handleStreamEnd (/Users/seo/git/comcomai/blockchain/ain-blockchain/node_modules/axios/lib/adapters/http.js:269:11)
    at IncomingMessage.emit (events.js:412:35)
    at endReadableNT (internal/streams/readable.js:1334:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:82927) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:82927) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
platfowner commented 2 years ago

This happens on testnet-prod and here are the node params settings: testnet-dev:

  "DEV_CLIENT_API_IP_WHITELIST": "*",
  "ENABLE_DEV_CLIENT_SET_API": false,
  "ENABLE_EXPRESS_RATE_LIMIT": true,
  "ENABLE_JSON_RPC_API": true,

testnet-prod:

  "DEV_CLIENT_API_IP_WHITELIST": [],
  "ENABLE_DEV_CLIENT_SET_API": false,
  "ENABLE_EXPRESS_RATE_LIMIT": true,
  "ENABLE_JSON_RPC_API": true,
platfowner commented 2 years ago

Resolved!