Skip to content

Commit

Permalink
move database to server yml
Browse files Browse the repository at this point in the history
  • Loading branch information
fengtality committed Feb 3, 2023
1 parent 95df4f8 commit 2b0050e
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 48 deletions.
4 changes: 2 additions & 2 deletions src/chains/avalanche/avalanche.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export class Avalanche extends EthereumBase implements Ethereumish {
config.network.tokenListType,
config.manualGasPrice,
config.gasLimitTransaction,
ConfigManagerV2.getInstance().get('database.nonceDbPath'),
ConfigManagerV2.getInstance().get('database.transactionDbPath')
ConfigManagerV2.getInstance().get('server.nonceDbPath'),
ConfigManagerV2.getInstance().get('server.transactionDbPath')
);
this._chain = config.network.name;
this._nativeTokenSymbol = config.nativeCurrencySymbol;
Expand Down
4 changes: 2 additions & 2 deletions src/chains/binance-smart-chain/binance-smart-chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ export class BinanceSmartChain extends EthereumBase implements Ethereumish {
config.network.tokenListType,
config.manualGasPrice,
config.gasLimitTransaction,
ConfigManagerV2.getInstance().get('database.nonceDbPath'),
ConfigManagerV2.getInstance().get('database.transactionDbPath')
ConfigManagerV2.getInstance().get('server.nonceDbPath'),
ConfigManagerV2.getInstance().get('server.transactionDbPath')
);
this._chain = config.network.name;
this._nativeTokenSymbol = config.nativeCurrencySymbol;
Expand Down
4 changes: 2 additions & 2 deletions src/chains/cronos/cronos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ export class Cronos extends EthereumBase implements Ethereumish {
config.network.tokenListType,
config.manualGasPrice,
config.gasLimitTransaction,
ConfigManagerV2.getInstance().get('database.nonceDbPath'),
ConfigManagerV2.getInstance().get('database.transactionDbPath')
ConfigManagerV2.getInstance().get('server.nonceDbPath'),
ConfigManagerV2.getInstance().get('server.transactionDbPath')
);
this._chain = config.network.name;
this._nativeTokenSymbol = config.nativeCurrencySymbol;
Expand Down
4 changes: 2 additions & 2 deletions src/chains/ethereum/ethereum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export class Ethereum extends EthereumBase implements Ethereumish {
config.network.tokenListType,
config.manualGasPrice,
config.gasLimitTransaction,
ConfigManagerV2.getInstance().get('database.nonceDbPath'),
ConfigManagerV2.getInstance().get('database.transactionDbPath')
ConfigManagerV2.getInstance().get('server.nonceDbPath'),
ConfigManagerV2.getInstance().get('server.transactionDbPath')
);
this._chain = network;
this._nativeTokenSymbol = config.nativeCurrencySymbol;
Expand Down
4 changes: 2 additions & 2 deletions src/chains/harmony/harmony.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export class Harmony extends EthereumBase implements Ethereumish {
config.network.tokenListType,
config.manualGasPrice,
config.gasLimitTransaction,
ConfigManagerV2.getInstance().get('database.nonceDbPath'),
ConfigManagerV2.getInstance().get('database.transactionDbPath')
ConfigManagerV2.getInstance().get('server.nonceDbPath'),
ConfigManagerV2.getInstance().get('server.transactionDbPath')
);
this._chain = network;
this._nativeTokenSymbol = config.nativeCurrencySymbol;
Expand Down
2 changes: 1 addition & 1 deletion src/chains/near/near.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class Near extends NearBase {
config.network.tokenListType,
config.manualGasPrice,
config.gasLimitTransaction,
ConfigManagerV2.getInstance().get('database.transactionDbPath')
ConfigManagerV2.getInstance().get('server.transactionDbPath')
);
this._chain = config.network.name;
this._nativeTokenSymbol = config.nativeCurrencySymbol;
Expand Down
4 changes: 2 additions & 2 deletions src/chains/polygon/polygon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export class Polygon extends EthereumBase implements Ethereumish {
config.network.tokenListType,
config.manualGasPrice,
config.gasLimitTransaction,
ConfigManagerV2.getInstance().get('database.nonceDbPath'),
ConfigManagerV2.getInstance().get('database.transactionDbPath')
ConfigManagerV2.getInstance().get('server.nonceDbPath'),
ConfigManagerV2.getInstance().get('server.transactionDbPath')
);
this._chain = config.network.name;
this._nativeTokenSymbol = config.nativeCurrencySymbol;
Expand Down
10 changes: 0 additions & 10 deletions src/services/schema/database-schema.json

This file was deleted.

14 changes: 9 additions & 5 deletions src/services/schema/server-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,26 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"certificatePath": { "type": "string" },
"logPath": { "type": "string" },
"port": { "type": "integer" },
"ipWhitelist": { "type": "array" },
"unsafeDevModeWithHTTP": { "type": "boolean" },
"GMTOffset": { "type": "number" },
"id": { "type": "string" },
"certificatePath": { "type": "string" },
"logToStdOut": { "type": "boolean" },
"unsafeDevModeWithHTTP": { "type": "boolean" },
"telemetry_enabled": { "type": "boolean" },
"logPath": { "type": "string" },
"logToStdOut": { "type": "boolean" }
"nonceDbPath": { "type": "string" },
"transactionDbPath": { "type": "string" }
},
"additionalProperties": false,
"required": [
"port",
"unsafeDevModeWithHTTP",
"certificatePath",
"telemetry_enabled",
"logPath"
"logPath",
"nonceDbPath",
"transactionDbPath"
]
}
2 changes: 0 additions & 2 deletions src/templates/database.yml

This file was deleted.

20 changes: 8 additions & 12 deletions src/templates/root.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
version: 1
configurations:
$namespace server:
configurationPath: server.yml
schemaPath: server-schema.json

$namespace ethereum:
configurationPath: ethereum.yml
schemaPath: ethereum-schema.json

$namespace harmony:
configurationPath: harmony.yml
schemaPath: harmony-schema.json
Expand All @@ -8,14 +16,6 @@ configurations:
configurationPath: avalanche.yml
schemaPath: ethereum-schema.json

$namespace database:
configurationPath: database.yml
schemaPath: database-schema.json

$namespace ethereum:
configurationPath: ethereum.yml
schemaPath: ethereum-schema.json

$namespace polygon:
configurationPath: polygon.yml
schemaPath: ethereum-schema.json
Expand Down Expand Up @@ -48,10 +48,6 @@ configurations:
configurationPath: traderjoe.yml
schemaPath: traderjoe-schema.json

$namespace server:
configurationPath: server.yml
schemaPath: server-schema.json

$namespace uniswap:
configurationPath: uniswap.yml
schemaPath: uniswap-schema.json
Expand Down
20 changes: 14 additions & 6 deletions src/templates/server.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Path to folder where Hummingbot generates self-signed certificates
certificatePath: /Users/feng1/Code/hummingbot/certs/

# Path to folder where logs will be stored.
logPath: './logs'

# Port to expose the gateway server on
port: 15888

Expand All @@ -7,12 +13,6 @@ ipWhitelist: []
# GMT Offset
GMTOffset: +0800

# Path to folder where Hummingbot generates self-signed certificates
certificatePath: /Users/feng1/Code/hummingbot/certs/

# Path to folder where logs will be stored.
logPath: './logs'

# If true, logs will be stored in logPath and printed to stdout. If false, they
# will only be stored in logPath and not printed to stdout.
logToStdOut: true
Expand All @@ -23,3 +23,11 @@ unsafeDevModeWithHTTP: false
# Collects data about API usage if true
telemetry_enabled: false

# Nonce database
nonceDbPath: 'nonce.level'

# Transaction database
transactionDbPath: 'transaction.level'



0 comments on commit 2b0050e

Please sign in to comment.