Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prod release #296

Merged
merged 5 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,17 @@ yarn dev

- Prod App: `https://near.org/dataplatform.near/widget/QueryApi.App`


### ENV variables
The React app does not use the replacement files. Instead, we need to provide an `.env` file to make sure we are accessing the right enviornment

By default, the React app will use the `dev` enviornment vars
```
Prod:
NEXT_PUBLIC_HASURA_ENDPOINT=https://near-queryapi.api.pagoda.co
NEXT_PUBLIC_REGISTRY_CONTRACT_ID=queryapi.dataplatform.near
```
```
Dev:
NEXT_PUBLIC_HASURA_ENDPOINT=https://near-queryapi.dev.api.pagoda.co
NEXT_PUBLIC_REGISTRY_CONTRACT_ID=dev-queryapi.dataplatform.near
6 changes: 3 additions & 3 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"lint": "next lint"
},
"dependencies": {
"@graphiql/plugin-code-exporter": "0.3.0",
"@graphiql/plugin-explorer": "0.3.0",
"@graphiql/plugin-code-exporter": "0.3.5",
"@graphiql/plugin-explorer": "0.3.5",
"@monaco-editor/react": "^4.1.3",
"@near-lake/primitives": "0.1.0",
"@next/font": "13.1.6",
Expand All @@ -24,7 +24,7 @@
"buffer": "^6.0.3",
"eslint": "8.34.0",
"eslint-config-next": "13.1.6",
"graphiql": "^2.4.1",
"graphiql": "3.0.6",
"graphql": "^16.6.0",
"near-api-js": "1.1.0",
"near-social-bridge": "^1.4.1",
Expand Down
26 changes: 25 additions & 1 deletion frontend/widgets/src/QueryApi.Dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const Wrapper = styled.div`
const NavBarLogo = styled.a`
padding-top: 0.3125rem;
padding-bottom: 0.3125rem;
margin-right: 1rem;
margin-right: .01rem;
font-size: 1.25rem;
text-decoration: none;
white-space: nowrap;
Expand Down Expand Up @@ -274,6 +274,27 @@ const ButtonLink = styled.a`
}}
`;

const SignUpLink = styled.a`
--blue: RGBA(13, 110, 253, 1);
display: ${({ hidden }) => (hidden ? "none" : "inline-block")};
font-size: 14px;
cursor: pointer;
color: var(--blue);
text-decoration: none;
margin-left: 0.1em;
padding: 0;
white-space: nowrap;

&:hover {
color: var(--blue);
text-decoration: none;
}

&:visited {
color: var(--blue);
text-decoration: none;
}
`;
// TODO fix activeTab
// const previousSelectedTab = Storage.privateGet("queryapi:activeTab");
// if (previousSelectedTab && previousSelectedTab !== state.activeTab) {
Expand Down Expand Up @@ -398,6 +419,9 @@ return (
QueryApi
</NavBarLogo>

<SignUpLink target="_blank" href={`http://bit.ly/near-queryapi-beta`}>
(Sign Up)
</SignUpLink>
<div>
<ButtonLink
href={`/#/${REPL_ACCOUNT_ID}/widget/QueryApi.App/?view=create-new-indexer`}
Expand Down
11 changes: 11 additions & 0 deletions frontend/widgets/src/QueryApi.IndexerStatus.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,17 @@ if (
(prevV2ToggleSelected !== state.v2Toggle)
) {
Storage.privateSet("QueryApiV2Toggle", state.v2Toggle);
State.update({
logs: [],
state: [],
indexer_res: [],
indexer_resCount: 0,
logsCount: 0,
stateCount: 0,
indexer_resPage: 0,
logsPage: 0,
statePage: 0,
})
fetchGraphQL(logsDoc, "QueryLogs", {
offset: state.logsPage * LIMIT,
}).then((result) => {
Expand Down
11 changes: 10 additions & 1 deletion indexer-js-queue-handler/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,18 @@ export const consumer = async (event) => {
const functions = {};

const function_config = jsonBody.indexer_function;
const code = function_config.code;
if (code.indexOf('context.db') >= 0) {
continue
}

const function_name = function_config.account_id + '/' + function_config.function_name;
functions[function_name] = function_config;

const mutations = await indexer.runFunctions(block_height, functions, is_historical, {imperative: true, provision: true});
try {
const mutations = await indexer.runFunctions(block_height, functions, is_historical, {imperative: true, provision: true});
} catch(e) {
console.error(e);
}
}
};