event rpc and graph cors policies

This commit is contained in:
gozzy 2022-11-20 23:00:42 +00:00
parent d11b01d83b
commit 8d038c5869
2 changed files with 19 additions and 1 deletions

View file

@ -441,7 +441,23 @@ class EventsFactory {
instances = new Map()
constructor(rpcUrl) {
this.provider = new Web3(rpcUrl).eth
this.provider = new Web3(
new Web3.providers.HttpProvider(rpcUrl, {
headers: [
{
name: 'Access-Control-Allow-Origin',
value: rpcUrl
},
{
name: 'Access-Control-Allow-Methods',
value: 'POST, GET, OPTIONS'
}
],
withCredentials: false,
// buffer for tor connections
timeout: 30000
})
).eth
}
getBlockNumber = () => {