event rpc and graph cors policies
This commit is contained in:
parent
d11b01d83b
commit
8d038c5869
@ -441,7 +441,23 @@ class EventsFactory {
|
|||||||
instances = new Map()
|
instances = new Map()
|
||||||
|
|
||||||
constructor(rpcUrl) {
|
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 = () => {
|
getBlockNumber = () => {
|
||||||
|
@ -39,6 +39,7 @@ const defaultOptions = {
|
|||||||
|
|
||||||
const client = new ApolloClient({
|
const client = new ApolloClient({
|
||||||
uri: link,
|
uri: link,
|
||||||
|
credentials: 'same-origin',
|
||||||
cache: new InMemoryCache(),
|
cache: new InMemoryCache(),
|
||||||
defaultOptions
|
defaultOptions
|
||||||
})
|
})
|
||||||
@ -46,6 +47,7 @@ const client = new ApolloClient({
|
|||||||
const registryClient = new ApolloClient({
|
const registryClient = new ApolloClient({
|
||||||
uri: 'https://api.thegraph.com/subgraphs/name/tornadocash/tornado-relayer-registry',
|
uri: 'https://api.thegraph.com/subgraphs/name/tornadocash/tornado-relayer-registry',
|
||||||
cache: new InMemoryCache(),
|
cache: new InMemoryCache(),
|
||||||
|
credentials: 'same-origin',
|
||||||
defaultOptions
|
defaultOptions
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user