Skip to content
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
26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,43 @@
# chainlog-ui
UI and API for MakerDAO’s chainlog contract

## Production environment

* [chainlog.sky.money](https://chainlog.sky.money)
* [chainlog.sky.money/api.html](https://chainlog.sky.money/api.html)
* chainlog.sky.money/checksum/\<address\>
UI and API for Sky’s chainlog contract.

## Staging environment
## Production environment

* [chainlog-staging.makerdao.com](https://chainlog-staging.makerdao.com)
* [chainlog-staging.makerdao.com/api.html](https://chainlog-staging.makerdao.com/api.html)
* chainlog-staging.makerdao.com/checksum/\<address\>
- [chainlog.skyeco.com](https://chainlog.skyeco.com)
- [chainlog.skyeco.com/api.html](https://chainlog.skyeco.com/api.html)
- chainlog.skyeco.com/checksum/\<address\>

## Deployment strategy

* Automatic deployment from `dev` branch to Staging environment
* Automatic deployment from `main` branch to Production environment
- Automatic deployment from `main` branch to Production environment

## Test locally with Docker

1. Make sure that older Docker images are removed, and containers are stopped, if you want to test new code:

```
docker rmi chainlog-ui
docker rmi chainlog-logger
docker rmi chainlog-checksum
```

2. Build the Docker images and start the 3 containers:

```
docker-compose up -d
```

3. Look at the logs:

```
docker logs -f chainlog-ui
docker logs -f chainlog-logger
docker logs -f chainlog-checksum
```

4. Stop the containers:

```
docker-compose down
```
Expand Down
26 changes: 13 additions & 13 deletions api.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Chainlog historical API - MakerDAO</title>
<title>Chainlog historical API - Sky</title>
<meta charset="UTF-8">
<meta name="referrer" content="origin">
<link rel="icon" href="data:;base64,iVBORw0KGgo=">
Expand All @@ -10,20 +10,20 @@
<h1>Chainlog historical API</h1>
<h2>Usage</h2>
<h3>Get a list of all available chains and versions</h3>
<pre>GET <a href="https://chainlog.sky.money/api/index.json">https://chainlog.sky.money/api/index.json</a></pre>
<pre>GET <a href="https://chainlog.skyeco.com/api/index.json">https://chainlog.skyeco.com/api/index.json</a></pre>
<h3>Get the active version on a given chain</h3>
<pre>GET https://chainlog.sky.money/api/{chain}/active.json</pre>
<pre>GET https://chainlog.skyeco.com/api/{chain}/active.json</pre>
<h3>Get a specific version on a given chain</h3>
<pre>GET https://chainlog.sky.money/api/{chain}/{version}.json</pre>
<pre>GET https://chainlog.skyeco.com/api/{chain}/{version}.json</pre>
<h2>Code examples</h2>
You can set your JavaScript app to use this API <a href="https://github.com/makerdao/chainlog-ui/blob/main/examples/api.js">in the following way</a>:
You can set your JavaScript app to use this API <a href="https://github.com/sky-ecosystem/chainlog-ui/blob/main/examples/api.js">in the following way</a>:
<pre>
const url = "https://chainlog.sky.money/api/mainnet/active.json";
const url = "https://chainlog.skyeco.com/api/mainnet/active.json";
const response = await fetch(url);
const chainlog = await response.json();
console.log(chainlog);
</pre>
If you care about decentralization, however, <b>do not use this API</b>. Instead <a href="https://github.com/makerdao/chainlog-ui/blob/main/examples/ethers.js">query the blockchain directly</a>:
If you care about decentralization, however, <b>do not use this API</b>. Instead <a href="https://github.com/sky-ecosystem/chainlog-ui/blob/main/examples/ethers.js">query the blockchain directly</a>:
<pre>
const address = "0xda0ab1e0017debcd72be8599041a2aa3ba7e740f";
const abi = [
Expand All @@ -42,9 +42,9 @@ <h2>Code examples</h2>
console.log(result);
</pre>
Please note that the above code will only retreive the latest data.<br/><br/>
You can also ditch web3 libraries and perform low-level JSON RPC calls. Here is an <a href="https://github.com/makerdao/chainlog-ui/blob/main/examples/python.py">example with Python</a>:
You can also ditch web3 libraries and perform low-level JSON RPC calls. Here is an <a href="https://github.com/sky-ecosystem/chainlog-ui/blob/main/examples/python.py">example with Python</a>:
<pre>
keys = requests.post("https://chain.techops.live/eth-mainnet", json={
keys = requests.post("https://chain.techops.services/eth-mainnet", json={
"jsonrpc": "2.0",
"method": "eth_call",
"params": [{
Expand All @@ -55,7 +55,7 @@ <h2>Code examples</h2>
}).json()["result"][130:]
result = {}
for i in range(0, len(keys), 64):
address = "0x" + requests.post("https://chain.techops.live/eth-mainnet", json={
address = "0x" + requests.post("https://chain.techops.services/eth-mainnet", json={
"jsonrpc": "2.0",
"method": "eth_call",
"params": [{
Expand All @@ -71,8 +71,8 @@ <h2>Code examples</h2>
The above code has the advantage that it will allow you to retreive historical data as long as you are using an archival node. In order to do that, replace <code>"latest"</code> with a specific block number.
<h2>Available resources in this API</h2>
<pre>
https://chainlog.sky.money/api
├── <a href="https://chainlog.sky.money/api/index.json">index.json</a>
https://chainlog.skyeco.com/api
├── <a href="https://chainlog.skyeco.com/api/index.json">index.json</a>
<div id="canvas"></div>
</pre>
<script>
Expand All @@ -89,7 +89,7 @@ <h2>Available resources in this API</h2>
else {
canvas.innerHTML += "├── " + chain + "<br/>";
}
const pipe1 = i === chains.length - 1 ? "    " : "│   ";
const pipe1 = i === chains.length - 1 ? " " : "│ ";
if (list[chain].active !== null) {
canvas.innerHTML += pipe1 + "├── " + '<a href="api/' + chain + '/active.json">active.json</a><br/>';
}
Expand Down
2 changes: 1 addition & 1 deletion deploy/prod/chainlog-logger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ autoscaling:
env:
CHAINLOG_REPO:
type: kv
value: "makerdao/chainlog-ui"
value: "sky-ecosystem/chainlog-ui"
PYTHONUNBUFFERED:
type: kv
value: "1"
Expand Down
2 changes: 1 addition & 1 deletion deploy/staging/chainlog-logger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ autoscaling:
env:
CHAINLOG_REPO:
type: kv
value: "makerdao/chainlog-ui"
value: "sky-ecosystem/chainlog-ui"
PYTHONUNBUFFERED:
type: kv
value: "1"
Expand Down
4 changes: 1 addition & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3'

services:
ui:
build:
Expand All @@ -21,7 +19,7 @@ services:
container_name: chainlog-logger
environment:
GITHUB_TOKEN: $GITHUB_TOKEN
CHAINLOG_REPO: "makerdao/chainlog-ui"
CHAINLOG_REPO: "sky-ecosystem/chainlog-ui"
PYTHONUNBUFFERED: 1
volumes:
- ./api:/usr/app/src/api
Expand Down
2 changes: 1 addition & 1 deletion examples/api.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fetch from "node-fetch";

const main = async () => {
const url = "https://chainlog.sky.money/api/mainnet/active.json";
const url = "https://chainlog.skyeco.com/api/mainnet/active.json";
const response = await fetch(url);
const chainlog = await response.json();
console.log(chainlog);
Expand Down
4 changes: 2 additions & 2 deletions examples/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import os, requests

keys = requests.post("https://chain.techops.live/eth-mainnet", json={
keys = requests.post("https://chain.techops.services/eth-mainnet", json={
"jsonrpc": "2.0",
"method": "eth_call",
"params": [{
Expand All @@ -13,7 +13,7 @@
}).json()["result"][130:]
result = {}
for i in range(0, len(keys), 64):
address = "0x" + requests.post("https://chain.techops.live/eth-mainnet", json={
address = "0x" + requests.post("https://chain.techops.services/eth-mainnet", json={
"jsonrpc": "2.0",
"method": "eth_call",
"params": [{
Expand Down
18 changes: 9 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Chainlog - MakerDAO</title>
<title>Chainlog - Sky</title>
<meta charset="UTF-8">
<meta name="referrer" content="origin">
<link rel="icon" href="data:;base64,iVBORw0KGgo=">
Expand Down Expand Up @@ -95,7 +95,7 @@
chainPrefix = chainPrefixes[conn.chainId];
chainApiPrefix = chainApiPrefixes[conn.chainId];
chainSuffix = chainSuffixes[conn.chainId];
endpoint = chainSuffix === "mainnet" ? "https://chain.techops.live/eth-mainnet" : "https://chain.techops.live/eth-" + chainSuffix;
endpoint = chainSuffix === "mainnet" ? "https://chain.techops.services/eth-mainnet" : "https://chain.techops.services/eth-" + chainSuffix;
notice = "change this in your Metamask plugin (you don’t need to unlock Metamask)";
setUp();
});
Expand All @@ -105,7 +105,7 @@
chainPrefix = chainPrefixes[chainId];
chainApiPrefix = chainApiPrefixes[chainId];
chainSuffix = chainSuffixes[chainId];
endpoint = chainSuffix === "mainnet" ? "https://chain.techops.live/eth-mainnet" : "https://chain.techops.live/eth-" + chainSuffix;
endpoint = chainSuffix === "mainnet" ? "https://chain.techops.services/eth-mainnet" : "https://chain.techops.services/eth-" + chainSuffix;
notice = "";
setUp();
});
Expand All @@ -127,21 +127,21 @@
}

const title = document.createElement("h1");
title.innerHTML = "MakerDAO Deployment Registry";
title.innerHTML = "Sky Deployment Registry";
document.body.append(title);

const linksDiv = document.createElement("div");
const sourceLink = document.createElement("a");
sourceLink.innerHTML = "source code";
sourceLink.setAttribute("href", "https://github.com/makerdao/chainlog-ui");
sourceLink.setAttribute("href", "https://github.com/sky-ecosystem/chainlog-ui");
sourceLink.setAttribute("target", "_blank");
linksDiv.append(sourceLink);
const separator = document.createElement("span");
separator.innerHTML = " · ";
linksDiv.append(separator);
const apiLink = document.createElement("a");
apiLink.innerHTML = "historical API";
apiLink.setAttribute("href", "https://chainlog.sky.money/api.html");
apiLink.setAttribute("href", "https://chainlog.skyeco.com/api.html");
apiLink.setAttribute("target", "_blank");
linksDiv.append(apiLink);
document.body.append(linksDiv);
Expand Down Expand Up @@ -177,7 +177,7 @@
chainSuffix = chainSelect.value;
chainPrefix = chainSuffix === "mainnet" ? "" : "sepolia.";
chainApiPrefix = chainSuffix === "mainnet" ? "" : "-sepolia";
endpoint = chainSuffix === "mainnet" ? "https://chain.techops.live/eth-mainnet" : "https://chain.techops.live/eth-" + chainSuffix;
endpoint = chainSuffix === "mainnet" ? "https://chain.techops.services/eth-mainnet" : "https://chain.techops.services/eth-" + chainSuffix;
setUp();
});
chainValue.append(chainSelect);
Expand All @@ -191,7 +191,7 @@
canvas.innerHTML = "loading…";
document.body.append(canvas);

let endpoint = 'https://chain.techops.live/eth-mainnet';
let endpoint = 'https://chain.techops.services/eth-mainnet';
const chainlog = "0xdA0Ab1e0017DEbCd72Be8599041a2aa3bA7e740F";

const hex2a = hexx => { // adapted from https://stackoverflow.com/a/3745677/15857007
Expand Down Expand Up @@ -251,7 +251,7 @@
}

const getChecksum = (address, callback) => {
fetch(`https://chainlog.makerdao.com/checksum/${address}`).then(response => {
fetch(`https://chainlog.skyeco.com/checksum/${address}`).then(response => {
if (response.ok) {
response.text().then(checksum => {
if (checksum.toLowerCase() === address) {
Expand Down
22 changes: 11 additions & 11 deletions index.ipfs.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Chainlog - MakerDAO</title>
<title>Chainlog - Sky</title>
<meta charset="UTF-8">
<meta name="referrer" content="origin">
<link rel="icon" href="data:;base64,iVBORw0KGgo=">
Expand Down Expand Up @@ -95,7 +95,7 @@
chainPrefix = chainPrefixes[conn.chainId];
chainApiPrefix = chainApiPrefixes[conn.chainId];
chainSuffix = chainSuffixes[conn.chainId];
endpoint = chainSuffix === "mainnet" ? "https://chain.techops.live/eth-mainnet" : "https://chain.techops.live/eth-" + chainSuffix;
endpoint = chainSuffix === "mainnet" ? "https://chain.techops.services/eth-mainnet" : "https://chain.techops.services/eth-" + chainSuffix;
notice = "change this in your Metamask plugin (you don’t need to unlock Metamask)";
setUp();
});
Expand All @@ -105,7 +105,7 @@
chainPrefix = chainPrefixes[chainId];
chainApiPrefix = chainApiPrefixes[chainId];
chainSuffix = chainSuffixes[chainId];
endpoint = chainSuffix === "mainnet" ? "https://chain.techops.live/eth-mainnet" : "https://chain.techops.live/eth-" + chainSuffix;
endpoint = chainSuffix === "mainnet" ? "https://chain.techops.services/eth-mainnet" : "https://chain.techops.services/eth-" + chainSuffix;
notice = "";
setUp();
});
Expand All @@ -127,21 +127,21 @@
}

const title = document.createElement("h1");
title.innerHTML = "MakerDAO Deployment Registry";
title.innerHTML = "Sky Deployment Registry";
document.body.append(title);

const linksDiv = document.createElement("div");
const sourceLink = document.createElement("a");
sourceLink.innerHTML = "source code";
sourceLink.setAttribute("href", "https://github.com/makerdao/chainlog-ui");
sourceLink.setAttribute("href", "https://github.com/sky-ecosystem/chainlog-ui");
sourceLink.setAttribute("target", "_blank");
linksDiv.append(sourceLink);
const separator = document.createElement("span");
separator.innerHTML = " · ";
linksDiv.append(separator);
const apiLink = document.createElement("a");
apiLink.innerHTML = "historical API";
apiLink.setAttribute("href", "https://chainlog.makerdao.com/api.html");
apiLink.setAttribute("href", "https://chainlog.skyeco.com/api.html");
apiLink.setAttribute("target", "_blank");
linksDiv.append(apiLink);
document.body.append(linksDiv);
Expand Down Expand Up @@ -177,7 +177,7 @@
chainSuffix = chainSelect.value;
chainPrefix = chainSuffix === "mainnet" ? "" : "sepolia.";
chainApiPrefix = chainSuffix === "mainnet" ? "" : "-sepolia";
endpoint = chainSuffix === "mainnet" ? "https://chain.techops.live/eth-mainnet" : "https://chain.techops.live/eth-" + chainSuffix;
endpoint = chainSuffix === "mainnet" ? "https://chain.techops.services/eth-mainnet" : "https://chain.techops.services/eth-" + chainSuffix;
setUp();
});
chainValue.append(chainSelect);
Expand All @@ -191,7 +191,7 @@
canvas.innerHTML = "loading…";
document.body.append(canvas);

let endpoint = 'https://chain.techops.live/eth-mainnet';
let endpoint = 'https://chain.techops.services/eth-mainnet';
const chainlog = "0xdA0Ab1e0017DEbCd72Be8599041a2aa3bA7e740F";

const hex2a = hexx => { // adapted from https://stackoverflow.com/a/3745677/15857007
Expand Down Expand Up @@ -251,7 +251,7 @@
}

const getChecksum = (address, callback) => {
fetch(`https://chainlog.makerdao.com/checksum/${address}`).then(response => {
fetch(`https://chainlog.skyeco.com/checksum/${address}`).then(response => {
if (response.ok) {
response.text().then(checksum => {
if (checksum.toLowerCase() === address) {
Expand Down Expand Up @@ -346,7 +346,7 @@
bash.setAttribute("disabled", true);
let text = "";
let length = 0;
for (let i = 0; i < data.length; i += 64) {
for (let i = 0; i < data.length; i += 64) {
const keyHex = data.substring(i, i + 64);
getAddress(keyHex, address => {
const key = hex2a(keyHex);
Expand Down Expand Up @@ -621,7 +621,7 @@

const showingAll = () => {
const trs = document.getElementsByName("tr-visible");
for (let i = 0; i < trs.length; i++) {
for (let i = 0; i < trs.length; i++) {
const tr = trs[i];
const view = tr.children[1];
if (view.innerHTML.includes("<")) {
Expand Down
8 changes: 3 additions & 5 deletions logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
def call(chain, calldata):
if chain == "mainnet":
endpoint = "https://chain.techops.services/eth-mainnet"
elif chain == "sepolia":
endpoint = "https://chain.techops.services/eth-sepolia"
else:
endpoint = "https://chain.techops.live/eth-{}".format(chain)
endpoint = "https://chain.techops.services/eth-sepolia"
response = requests.post(endpoint, json={
"jsonrpc": "2.0",
"method": "eth_call",
Expand Down Expand Up @@ -92,7 +90,7 @@ def update(chain):
active_file = open(active_path, "w")
active_file.write(contents)
active_file.close()
message = "feat: update active file for {} v{}".format(chain, version)
message = "feat: update active file for {} v{}".format(chain, version)
push(active_path, contents, message)
if version not in index[chain]["all"]:
index[chain]["all"].insert(0, version)
Expand All @@ -102,7 +100,7 @@ def update(chain):
index_contents = json.dumps(index, indent=2)
index_file.write(index_contents)
index_file.close()
message = "feat: update index file for {} v{}".format(chain, version)
message = "feat: update index file for {} v{}".format(chain, version)
push(index_path, index_contents, message)
else:
print("{} - no changes on {}".format(datetime.now(), chain))
Expand Down