Skip to content

Commit

Permalink
(fix) Use https:// to communicate with api endpoints or you get mixed…
Browse files Browse the repository at this point in the history
…-content failures in the "derive zq2 parameters from chain" code. (#654)

(feat) Add a version to the footer so we know which version of the docs we're viewing.
  • Loading branch information
rrw-zilliqa authored Apr 16, 2024
1 parent b54c726 commit 8287bb5
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 4 deletions.
2 changes: 2 additions & 0 deletions products/developer-portal-zq2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ COPY . /build
RUN pip3 install --no-cache-dir -r /build/requirements.txt

ENV DOC_SOURCE=docs
ARG VERSION
ENV VERSION=$VERSION
WORKDIR /build
RUN mkdocs build

Expand Down
11 changes: 10 additions & 1 deletion products/developer-portal-zq2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ HERE=$(shell pwd)

DOC_SOURCE=$(HERE)/docs
export DOC_SOURCE
VERSION=$(shell cat $(DOC_SOURCE)/../VERSION)
export VERSION

dev:
mkdocs serve
Expand All @@ -37,11 +39,18 @@ assemble:
IMAGE_TAG ?= zq2-docs:latest

build:
docker buildx build . -t $(IMAGE_TAG)
docker buildx build --build-arg VERSION="${VERSION}" . -t $(IMAGE_TAG)

run-image: build
docker run --rm -p 8080:80 "$(IMAGE_TAG)"

STG_TAG=asia-docker.pkg.dev/prj-d-devops-services-4dgwlsse/zilliqa-public/developer-portal-zq2
## This is an ugly hack - it allows me to push directly to the staging repo without going through CI - rrw 2024-04-16
push-staging-image: build
docker tag "${IMAGE_TAG}" "${STG_TAG}"
docker push "${STG_TAG}"
echo Now restart the pod ..

## Build and push the Docker image
image/build-and-push: build
docker push "$(IMAGE_TAG)"
1 change: 1 addition & 0 deletions products/developer-portal-zq2/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.0.1
5 changes: 4 additions & 1 deletion products/developer-portal-zq2/docs/api/ethereum/eth-rpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ title: Supported ETH API calls

# Ethereum API

We support a subset of the [Ethereum JSON-RPC API methods](https://ethereum.org/en/developers/docs/apis/json-rpc/).
We aim to support a useful subset of the available Ethereum Node methods. Useful references include
[Ethereum JSON-RPC API methods](https://ethereum.org/en/developers/docs/apis/json-rpc/) and [the Geth RPC docs](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug).

The exact set of API methods we intend to support will be published in a future [ZIP](https://github.com/zilliqa/zip).

See [endpoints](/endpoints.md) for details of which RPC endpoints are supported by each deployed version of Zilliqa 2.0 (TBD: this information will eventually be extracted here for convenience).
3 changes: 1 addition & 2 deletions products/developer-portal-zq2/docs/js/versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ function fillInVersionNumbers() {
for (let i = 0; i < ids.length; i++) {
elem = ids[i];
url = elem.innerHTML.trim();
console.log("ZZ - " + elem.attributes["id"].value);
var data = {
id: "1",
jsonrpc: "2.0",
method: "GetVersion",
params: [""],
};
fetch("http://" + url, {
fetch("https://" + url, {
method: "POST",
headers: {
"Content-Type": "application/json",
Expand Down
3 changes: 3 additions & 0 deletions products/developer-portal-zq2/mkdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ theme:
features:
- content.code.annotate
- navigation.indexes
- navigation.footer

markdown_extensions:
- attr_list
Expand Down Expand Up @@ -165,6 +166,7 @@ markdown_extensions:
- pymdownx.saneheaders:

extra:
version: !ENV VERSION
social:
- icon: fontawesome/brands/github
link: https://github.com/zilliqa
Expand All @@ -181,3 +183,4 @@ extra:

plugins:
- search
- markdownextradata: {}
12 changes: 12 additions & 0 deletions products/developer-portal-zq2/overrides/partials/copyright.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div class="md-copyright">
{% if not config.extra.generator == false %} Made with
<a
href="https://squidfunk.github.io/mkdocs-material/"
target="_blank"
rel="noopener"
>
Material for MkDocs
</a>
{% endif %}
<div class="md-copyright__highlight">Version {{ config.extra.version }}</div>
</div>
1 change: 1 addition & 0 deletions products/developer-portal-zq2/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ requests==2.31.0
six==1.16.0
urllib3==1.26.18
watchdog==2.1.9
mkdocs-markdownextradata-plugin==0.2.5

0 comments on commit 8287bb5

Please sign in to comment.