Browse Source

infra: Remove useless information

prometheus-integration
Alexis Hernandez 7 years ago
parent
commit
b650c39192
  1. 4
      infra/deployment/deploy-rpc.md
  2. 22
      infra/misc/queries.sql
  3. 5
      infra/misc/script.sh
  4. 11
      infra/misc/setup-aws.md
  5. 1
      infra/misc/xsn.conf

4
infra/deployment/deploy-rpc.md

@ -7,7 +7,6 @@ The following steps are for setting up the rpc server that runs on system startu
## Set up a new user
- create the user: `sudo adduser --system rpc`
- switch to the new user: `sudo su -s /bin/bash - rpc`
- set aws credentials: `aws configure`
- create the folder for xsn data: `mkdir /home/rpc/.xsncore`
- set the xsn config (see [xsn.conf](/infra/misc/xsn.conf)): `vim /home/rpc/.xsncore/xsn.conf`
@ -17,9 +16,6 @@ The following steps are for setting up the rpc server that runs on system startu
- unpack the file: `tar -zxvf xsn.tar.gz`
- create a folder for the executables: `mkdir /home/rpc/xsn`
- move the executables: `mv xsncore-1.0.9/bin/xsn* xsn/`
- add the script for new blocks: `vim xsn/script.sh`
- set the script as executable (see [script.sh](/infra/misc/script.sh)): `chmod +x xsn/script.sh`
- test the script: `./xsn/script.sh working`
## Add the systemd service (as super user)
- create the service file (see [xsn-rpc.service](/infra/systemd-services/xsn-rpc.service)): `sudo cp xsn-rpc.service /etc/systemd/system/xsn-rpc.service`

22
infra/misc/queries.sql

@ -7,28 +7,6 @@ FROM (SELECT height, time FROM blocks) a JOIN
(SELECT height, time FROM blocks) b ON (a.height + 1 = b.height);
-- find blocks with corrupted next_blockhash
SELECT height, blockhash, next_blockhash
FROM blocks b
WHERE 0 = (SELECT COUNT(*) FROM blocks WHERE blockhash = b.next_blockhash) AND
height < (SELECT MAX(height) FROM blocks);
-- find blocks with corrupted previous_blockhash
SELECT height, blockhash, previous_blockhash
FROM blocks b
WHERE 0 = (SELECT COUNT(*) FROM blocks WHERE blockhash = b.previous_blockhash) AND
height > (SELECT MIN(height) FROM blocks);
-- find missing blocks in the chain
SELECT height - 1 AS missing
FROM blocks b
WHERE height > 1 AND
height - 1 NOT IN (
SELECT height
FROM blocks
WHERE height = b.height - 1
);
-- find corrupted balances
SELECT address, one.available AS one, (two.received - two.spent) AS two
FROM (

5
infra/misc/script.sh

@ -1,5 +0,0 @@
#!/bin/bash
BLOCK=$1
QUEUE="https://sqs.us-east-2.amazonaws.com/984148963792/blocks.fifo"
DID=$(head /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
aws sqs send-message --message-body $BLOCK --queue-url $QUEUE --message-group-id none --message-deduplication-id $DID

11
infra/misc/setup-aws.md

@ -1,11 +0,0 @@
# Setup AWS
## set up the locale
- `export LC_ALL="en_US.UTF-8"`
- `export LC_CTYPE="en_US.UTF-8"`
- `sudo dpkg-reconfigure locales`
## install aws cli
- `sudo apt update && sudo apt install -y python-pip python-setuptools`
- `sudo pip install --upgrade pip`
- `sudo pip install awscli`

1
infra/misc/xsn.conf

@ -4,4 +4,3 @@ rpcport=51473
txindex=1
addressindex=1
spentindex=1
blocknotify=/home/rpc/xsn/script.sh %s

Loading…
Cancel
Save