Steps to run Substrate Sidecar
- 3.Sidecar must be aware of which node to connect to through websocket and which types to use. For that, 2 variables need to be set.
SAS_SUBSTRATE_WS_URLto specify where is the node. If using our hosted mainnet node, set it to wss://mainnet-node.dock.io, otherwise set it to point to the websocket endpoint of your node. If running a local node with websockets at port 9944, you don't need to set it.
SAS_SUBSTRATE_TYPES_BUNDLEto specify our custom types from the above types package. This needs to point to the file system path of the
index.jsfile of the above package, eg if the types package was downloaded at the location
/home/Downloads/node-typesthen this variable should be set to
- 4.Go to the sidecar directory now.
- 5.You can either above 2 variables in the env file for Sidecar or you can run sidecar as
SAS_SUBSTRATE_TYPES_BUNDLE=<path to index.js> SAS_SUBSTRATE_WS_URL=<websocket endpoint> yarn dev