-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1349 from EYBlockchain/david/wallet-local
update local wallet deployment
- Loading branch information
Showing
15 changed files
with
79 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Gas Estimate Function | ||
Gas Estimate function provides a simple endpoint to estimate Ethereum mainnet Gas price. It is expected to be used as a | ||
nodejs lambda function. It requires to include an environment variable, `process.env.ETH_GAS_STATION`, which is an Etherscan API Key. | ||
|
||
Once this function is deployed, simply configure `GAS_ESTIMATE_ENDPOINT` with the endpoint URL. If this variable is not defined, the estimation is done differently by estimating the price by the last few blocks median gas price. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
const https = require('https'); | ||
|
||
function getRequest(url) { | ||
return new Promise((resolve, reject) => { | ||
const req = https.get(url, res => { | ||
let rawData = ''; | ||
|
||
res.on('data', chunk => { | ||
rawData += chunk; | ||
}); | ||
|
||
res.on('end', () => { | ||
try { | ||
resolve(JSON.parse(rawData)); | ||
} catch (err) { | ||
reject(new Error(err)); | ||
} | ||
}); | ||
}); | ||
|
||
req.on('error', err => { | ||
reject(new Error(err)); | ||
}); | ||
}); | ||
} | ||
|
||
exports.handler = async () => { | ||
try { | ||
console.log('ETH_GAS_STATION', process.env.ETH_GAS_STATION); | ||
const result = await getRequest( | ||
`https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${process.env.ETH_GAS_STATION}`, | ||
); | ||
console.log('result', result); | ||
return { | ||
statusCode: 200, | ||
body: JSON.stringify(result), | ||
}; | ||
} catch (error) { | ||
console.log('Error is️:', error); | ||
return { | ||
statusCode: 400, | ||
body: error.message, | ||
}; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.*.env |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
SKIP_PREFLIGHT_CHECK=true | ||
|
||
## From Nightfall deployment repository, take ${PROPOSER_HOST} | ||
PROPOSER_API_URL=https:// | ||
|
||
LOCAL_API_URL=http://localhost:8081 | ||
|
||
## From Nightfall deployment repository, take ${API_WS_SEND_ENDPOINT} | ||
PROPOSER_WS_URL=wss:// | ||
|
||
LOCAL_WS_URL=ws://localhost:8082 | ||
|
||
LOCAL_UTIL_API_URL=http://localhost:8087 |