Skip to content

Commit

Permalink
fix ports and add description of flags
Browse files Browse the repository at this point in the history
  • Loading branch information
zkokelj committed Aug 21, 2024
1 parent 0520dee commit fcf97a6
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
32 changes: 29 additions & 3 deletions tools/walletextension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ For a comprehensive overview, refer to the [official documentation](https://docs

### Backend

To run the backend locally, first build it using the `go build` command. Navigate to the `tools/walletextension/main` folder and use the following commands to build for your respective operating system:
To run the backend locally, it is recommended to use **port 1443** to avoid conflicts with the frontend service, which typically runs on port 3000. First, build the backend using the `go build` command. Navigate to the `tools/walletextension/main` folder and use the following commands to build for your respective operating system:

```bash
# macOS AMD64
Expand All @@ -23,7 +23,33 @@ env GOOS=windows GOARCH=amd64 go build -o ../bin/wallet_extension_win_amd64.exe
env GOOS=linux GOARCH=amd64 go build -o ../bin/wallet_extension_linux_amd64 .
```

The binaries will be available in the `tools/walletextension/bin` directory. Run the compiled binary to start the backend.
The binaries will be available in the `tools/walletextension/bin` directory.
Run the compiled binary and specify the desired port.
Example:

```bash
./wallet_extension_macos_arm64 --port 1443
```

### Additional Backend Configuration Options

- **`--host`**: The host where the wallet extension should open the port. Default: `127.0.0.1`.
- **`--port`**: The port on which to serve the wallet extension. Default: `3000`.
- **`--portWS`**: The port on which to serve websocket JSON RPC requests. Default: `3001`.
- **`--nodeHost`**: The host on which to connect to the Obscuro node. Default: `erpc.sepolia-testnet.ten.xyz`.
- **`--nodePortHTTP`**: The port on which to connect to the Obscuro node via RPC over HTTP. Default: `80`.
- **`--nodePortWS`**: The port on which to connect to the Obscuro node via RPC over websockets. Default: `81`.
- **`--logPath`**: The path to use for the wallet extension's log file. Default: `sys_out`.
- **`--databasePath`**: The path for the wallet extension's database file. Default: `.obscuro/gateway_database.db`.
- **`--verbose`**: Flag to enable verbose logging of wallet extension traffic. Default: `false`.
- **`--dbType`**: Define the database type (`sqlite` or `mariaDB`). Default: `sqlite`.
- **`--dbConnectionURL`**: If `dbType` is set to `mariaDB`, this must be set.
- **`--tenChainID`**: ChainID of the Ten network that the gateway is communicating with. Default: `443`.
- **`--storeIncomingTxs`**: Flag to enable storing incoming transactions in the database for debugging purposes. Default: `true`.
- **`--rateLimitUserComputeTime`**: Represents how much compute time a user is allowed to use within the `rateLimitWindow` time. Set to `0` to disable rate limiting. Default: `10s`.
- **`--rateLimitWindow`**: Time window in which a user is allowed to use the defined compute time. Default: `1m`.
- **`--maxConcurrentRequestsPerUser`**: Number of concurrent requests allowed per user. Default: `3`.


### Frontend

Expand All @@ -34,7 +60,7 @@ npm install
npm run dev
```

The frontend will be accessible on `http://localhost:80`.
The frontend will be accessible on `http://localhost:3000`.

## HTTP Endpoints

Expand Down
2 changes: 1 addition & 1 deletion tools/walletextension/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev -p 80",
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
Expand Down
2 changes: 1 addition & 1 deletion tools/walletextension/frontend/src/lib/constants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const tenGatewayAddress =
process.env.NEXT_PUBLIC_API_GATEWAY_URL || "http://127.0.0.1:3000";
process.env.NEXT_PUBLIC_API_GATEWAY_URL || "http://127.0.0.1:1443";

export const tenscanLink = "https://testnet.tenscan.io";

Expand Down

0 comments on commit fcf97a6

Please sign in to comment.