Node server for Reflector, decentralized Stellar price feed oracle
Check architecture and general concepts overview to learn what's inside and how it works.
- Build and deploy Reflector Oracle contract.
- Create a multisig account to protect the contract. Ensure that each signer corresponds to a distinct Reflector cluster node and master weight is set to 0.
Prepare app.config.json
file and save it to the home
directory which will be utilized by Reflector node.
{
"secret": "S...G",
"dataSources": {
"pubnet": {
"name": "pubnet",
"type": "db",
"dbConnection": "postgres://stellar:@{server_ip_address}:{server_port}/stellar-core",
"sorobanRpc": ["https://localhost:8003/", "https://soroban-rpc.mainnet.stellar.gateway.fm/"],
},
"exchanges": {
"name": "exchanges",
"type": "api"
}
},
"dbSyncDelay": 15,
"port": 30447
}
Where:
secret
- the secret key of the nodedataSources
- price data sources cofigurationsdataSources.exchanges.proxy
- [optional] proxy configuration for the data source (connectionString
- array of socks5 proxy URLs).dbSyncDelay
- [optional] delay in seconds for database synchronization (should be identical for all nodes in the cluster)port
- [optional] custom TCP port for inbound connections
If you are joining the existing cluster, ask other node operators to share their basic config params, then override secret
and data sources configuration parameters.
Docker configurations to run Reflector node Docker image.
Prerequisites:
- Docker
Example startup script:
docker run -it -d \
-p 30347:30347 \
-v "REFLECTOR_WORKDIR:/reflector-node/app/home" \
--name=reflector-node \
reflectornet/reflector-node:latest
REFLECTOR_WORKDIR
- path to the working directory where Reflector will store config and logs
If you want to use Stellar Docker image as DB source, you can use the following command:
docker run -it -d \
-e POSTGRES_PASSWORD=123456 \
-p 5432:5432 \
-v "STELLAR_WORKDIR:/opt/stellar" \
--name stellar \
stellar/quickstart:soroban-dev \
--testnet
POSTGRES_PASSWORD
- password for the PostgreSQL databaseSTELLAR_WORKDIR
- path to the working directory where Stellar will store data5432
- port of the local PostgreSQL database
Note: You need to set dbConnection
in app.config.json
to postgres://stellar:[email protected]:5432/stellar-core
where 123456
is the
password for the PostgreSQL database.
30347
: WebSocket port for inter-cluster communication
- Reflector working directory, e.g.
REFLECTOR_WORKDIR:/reflector-node/app/home
- Pull the latest docker image from Docker Hub
docker pull reflectornet/reflector-node:latest
- Stop current node container
docker stop {container_id_or_name}
- Remove current container
docker rm {container_id_or_name}
- Start new container
Use the same startup command for the updated container (general startup command format is described above)
Prerequisites:
- NodeJS 18+
- Checkout this repository
git checkout [email protected]:reflector-network/reflector-node.git
- Install dependencies
npm i
- Start Reflector node
npm run start
Admin Dashboard is a GUI that simplifies common administrative tasks, monitoring, and management of Reflector nodes.
Check admin guide for a short 101 course on node administration.