Skip to content

Commit

Permalink
calculate testnet times
Browse files Browse the repository at this point in the history
  • Loading branch information
pedromtcosta committed Nov 24, 2022
1 parent 3a4d878 commit 9d749ed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
14 changes: 7 additions & 7 deletions config/default.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export default {
db: {
user: process.env.POSTGRES_USER || "hasura",
host: process.env.POSTGRES_HOST || "/tmp/",
database: process.env.POSTGRES_DB || "cexplorer",
password: process.env.POSTGRES_PASSWORD || "",
port: process.env.POSTGRES_PORT || 5432
user: process.env.POSTGRES_USER || "cardano_usr",
host: process.env.POSTGRES_HOST || "sgp-06.emurgo-rnd.com",
database: process.env.POSTGRES_DB || "cardano_db",
password: process.env.POSTGRES_PASSWORD || "cafr9dLH6gOzot7tu0TE",
port: process.env.POSTGRES_PORT || 30000
},
server: {
addressRequestLimit: 50,
Expand Down Expand Up @@ -42,8 +42,8 @@ export default {
},
network: process.env.NETWORK || "mainnet",
neo4j: {
url: process.env.NEO4J_URL || "neo4j://dus-01.emurgo-rnd.com:7687",
url: process.env.NEO4J_URL || "neo4j://eu-04.emurgo-rnd.com:7687",
username: process.env.NEO4J_USERNAME || "neo4j",
password: process.env.NEO4J_PASSWORD || "neo4j"
password: process.env.NEO4J_PASSWORD || "AcAfdm54Afji3acdnCydwnjC"
}
};
8 changes: 5 additions & 3 deletions src/neo4j/txs/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ import {
} from "@emurgo/cardano-serialization-lib-nodejs";
import { mapNeo4jAssets } from "../utils";

const network = config.get("network");

const GENESIS_UNIX_TIMESTAMP = 1506243091;
const SHELLEY_UNIX_TIMESTAMP = 1596491091;
const SHELLEY_INITIAL_SLOT = 4924800;

const GENESIS_UNIX_TIMESTAMP = network === "mainnet" ? 1506243091 : 1654048800;
const SHELLEY_UNIX_TIMESTAMP = network === "mainnet" ? 1596491091 : 1655776800;
const SHELLEY_INITIAL_SLOT = network === "mainnet" ? 4924800 : 86400;
const BYRON_SLOT_DURATION_IN_SECONDS = 20;

export const neo4jCast = <T>(r: any) => {
Expand Down

0 comments on commit 9d749ed

Please sign in to comment.