diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..c2179e1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +node/__debug_bin/ +client/__debug_bin/ +vendor/ +.mocha/node_modules/ +.vscode/ +.idea/ +target/ +build/ +release/ +bin/ + +*.swp diff --git a/graph-node/firehose-node.yaml b/graph-node/firehose-node.yaml index c9c1ca4..bd9fa96 100644 --- a/graph-node/firehose-node.yaml +++ b/graph-node/firehose-node.yaml @@ -54,7 +54,7 @@ spec: spec: initContainers: - name: wait-for-genesis - image: registry.digitalocean.com/nevermore/persistence:v6.1.0-fh + image: persistenceone/persistencecore:v7.0.0-fh imagePullPolicy: Always env: - name: GENESIS_NODE_DATA_RESOLUTION_METHOD @@ -86,7 +86,7 @@ spec: echo "Ready to start" exit 0 - name: init-firehose-node - image: registry.digitalocean.com/nevermore/persistence:v6.1.0-fh + image: persistenceone/persistencecore:v7.0.0-fh imagePullPolicy: Always env: - name: CHAIN_ID @@ -166,7 +166,7 @@ spec: name: scripts-graph containers: - name: firehose-node - image: registry.digitalocean.com/nevermore/persistence:v6.1.0-fh + image: persistenceone/persistencecore:v7.0.0-fh imagePullPolicy: Always env: - name: CHAIN_ID @@ -186,14 +186,14 @@ spec: mv firecosmos /usr/local/bin echo "starting firehose with persistence core" - # sleep infinity + #sleep infinity firecosmos start --config $HOME_DIR/config/firehose.yml --data-dir /fh-data resources: limits: cpu: "2" memory: "4G" requests: - cpu: "1" + cpu: "2" memory: "3G" volumeMounts: - mountPath: /persistencecore @@ -206,18 +206,21 @@ spec: - name: firehose-pv-storage persistentVolumeClaim: claimName: firehose-pv-claim + - name: node-pv-storage + persistentVolumeClaim: + claimName: node-pv-claim - name: config-graph configMap: name: config-graph - name: scripts-graph configMap: name: scripts-graph - volumeClaimTemplates: - - metadata: - name: node-pv-storage - spec: - storageClassName: do-block-storage - accessModes: [ "ReadWriteOnce" ] - resources: - requests: - storage: 30Gi + # volumeClaimTemplates: + # - metadata: + # name: node-pv-storage + # spec: + # storageClassName: do-block-storage + # accessModes: [ "ReadWriteOnce" ] + # resources: + # requests: + # storage: 30Gi diff --git a/graph-node/firehose-persistent-volume.yaml b/graph-node/firehose-persistent-volume.yaml index e3eaf58..d38bf26 100644 --- a/graph-node/firehose-persistent-volume.yaml +++ b/graph-node/firehose-persistent-volume.yaml @@ -8,4 +8,18 @@ spec: - ReadWriteOnce resources: requests: - storage: 10Gi \ No newline at end of file + storage: 10Gi +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: node-pv-claim +spec: + storageClassName: do-block-storage + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 30Gi + + \ No newline at end of file diff --git a/graph-node/scripts/init-firehose-node.sh b/graph-node/scripts/init-firehose-node.sh index c795cf8..1eb2d77 100644 --- a/graph-node/scripts/init-firehose-node.sh +++ b/graph-node/scripts/init-firehose-node.sh @@ -80,12 +80,32 @@ END # Restore snapshot if url is present if [ ! -z "$STATE_RESTORE_SNAPSHOT_URL" ]; then - echo "Downloading snapshot from $STATE_RESTORE_SNAPSHOT_URL" - wget -O $HOME_DIR/snapshot.tar.gz $STATE_RESTORE_SNAPSHOT_URL - - echo "Extracting snapshot" - tar -xvf $HOME_DIR/snapshot.tar.gz -C $HOME_DIR - rm -rf $HOME_DIR/snapshot.tar.gz + echo "=> Downloading snapshot from $STATE_RESTORE_SNAPSHOT_URL" + FILENAME=$(basename $STATE_RESTORE_SNAPSHOT_URL) + curl $STATE_RESTORE_SNAPSHOT_URL -o $HOME_DIR/$FILENAME + #only for validators + #cp $HOME_DIR/data/priv_validator_state.json $HOME/priv_validator_state_backup.json + + case "$FILENAME" in + *.tar.lz4) + if ! command -v lz4 &> /dev/null; then + apk add lz4 + fi + echo "=> Extracting snapshot..." + lz4 -c -d $HOME_DIR/$FILENAME | tar -x -C $HOME_DIR + rm -rf $HOME_DIR/wasm/wasm/cache/modules + rm -rf $HOME_DIR/$FILENAME + ;; + + *.tar.gz) + echo "=> Extracting snapshot..." + tar -xvf $HOME_DIR/$FILENAME -C $HOME_DIR + rm -rf $HOME_DIR/$FILENAME + ;; + esac + + #mv $HOME_DIR/priv_validator_state_backup.json $HOME/data/priv_validator_state.json + #rm $HOME_DIR/priv_validator_state_backup.json fi fi diff --git a/networks/mainnet/configmap.yaml b/networks/mainnet/configmap.yaml index 468ba00..56b9a7a 100644 --- a/networks/mainnet/configmap.yaml +++ b/networks/mainnet/configmap.yaml @@ -16,9 +16,9 @@ data: sync_node.exposer_port: '' sync_node.port_p2p: '26656' sync_node.genesis_json_fetch_url: 'https://raw.githubusercontent.com/persistenceOne/networks/master/core-1/final_genesis.json' - snapshot_restore_url: 'https://tools.highstakes.ch/files/persistence/data_2023-01-11.tar.gz' # block height 9597501 - seeds: 'fbf0aa94b512902a249b246ed5763b50df9c0543@seed.core.persistence.one:26656' - first_streamable_block: '9597600' + snapshot_restore_url: 'https://files.audit.one/persistence%2Fsnapshot%2Fdata_height_10522614.tar.lz4' + seeds: 'e726816f42831689eab9378d5d577f1d06d25716@persistence-seed-2.allnodes.me:26656,e1b058e5cfa2b836ddaa496b10911da62dcf182e@persistence-seed-1.allnodes.me:26656,fbf0aa94b512902a249b246ed5763b50df9c0543@seed.core.persistence.one:26656' + first_streamable_block: '10522800' force_init: 'false' --- diff --git a/networks/mainnet/ingress.yaml b/networks/mainnet/ingress.yaml new file mode 100644 index 0000000..c52070a --- /dev/null +++ b/networks/mainnet/ingress.yaml @@ -0,0 +1,23 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: ingress-graph-mainnet-persistence + annotations: + nginx.ingress.kubernetes.io/ssl-redirect: "false" +spec: + tls: + - secretName: cloudflare-tls + hosts: + - graph.mainnet.persistence.one + rules: + - host: graph.mainnet.persistence.one + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: persistencecore-graph-node + port: + number: 8000 + ingressClassName: nginx \ No newline at end of file diff --git a/networks/mainnet/kustomization.yaml b/networks/mainnet/kustomization.yaml index 71dae49..03429eb 100644 --- a/networks/mainnet/kustomization.yaml +++ b/networks/mainnet/kustomization.yaml @@ -1,6 +1,6 @@ namespace: graph-core-1 resources: - # - ingress.yaml + - ingress.yaml - configmap.yaml - ../../graph-node \ No newline at end of file diff --git a/networks/testnet/configmap.yaml b/networks/testnet/configmap.yaml index 1f76ed8..3c206f3 100644 --- a/networks/testnet/configmap.yaml +++ b/networks/testnet/configmap.yaml @@ -24,10 +24,10 @@ data: # - blockstore.db # - ... # - wasm - snapshot_restore_url: 'https://tendermint-snapshots.s3.ap-southeast-1.amazonaws.com/persistence/testnet/test.tar.gz' - seeds: 'b4237f8a7ca357d380ad119b76cbceec7e7e8a75@128.199.218.4:26656' + snapshot_restore_url: "https://files.audit.one/persistence%2Fsnapshot%2Ftestnet_10192378.tar.lz4" + seeds: 'b4237f8a7ca357d380ad119b76cbceec7e7e8a75@seed.testnet.persistence.one:26656' # For buffer time to sync the node - first_streamable_block: '9292200' + first_streamable_block: '10192450' force_init: 'false' --- @@ -36,7 +36,8 @@ kind: ConfigMap metadata: name: graph-node-config data: - firehose_node.host: 'persistencecore-firehose-node.testnet.svc.cluster.local' + #host name format: + firehose_node.host: 'persistencecore-firehose-node.graph-test-core-1.svc.cluster.local' firehose_node.port: '9030' - ipfs.host: 'ipfs-node.testnet.svc.cluster.local' + ipfs.host: 'ipfs-node.graph-test-core-1.svc.cluster.local' ipfs.port: '5001' \ No newline at end of file diff --git a/networks/testnet/ingress.yaml b/networks/testnet/ingress.yaml index c23b1d3..688b2e7 100644 --- a/networks/testnet/ingress.yaml +++ b/networks/testnet/ingress.yaml @@ -1,16 +1,16 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: - name: ingress-core-testnet-graph + name: ingress-graph-testnet-persistence annotations: nginx.ingress.kubernetes.io/ssl-redirect: "false" spec: tls: - - secretName: cloudflare-tls + - secretName: cloudflare-tls-graph-testnet hosts: - - graph.testnet.dexter.zone + - graph.testnet.persistence.one rules: - - host: graph.testnet.dexter.zone + - host: graph.testnet.persistence.one http: paths: - path: / diff --git a/networks/testnet/kustomization.yaml b/networks/testnet/kustomization.yaml index aaddbfa..fe8ddc4 100644 --- a/networks/testnet/kustomization.yaml +++ b/networks/testnet/kustomization.yaml @@ -1,4 +1,4 @@ -namespace: testnet +namespace: graph-test-core-1 resources: - ingress.yaml