Skip to content

Commit

Permalink
Proxy RPC requests (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotBraem authored Apr 29, 2024
1 parent cba9a00 commit 2e0fc5d
Show file tree
Hide file tree
Showing 103 changed files with 1,785 additions and 236 deletions.
43 changes: 38 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<center>
<div align="center">

# bos-workspace

🚧 **Warning: This library has recently undergone a major refactor.** 🚧

**If this is not your first time using bos-workspace, read the [migration guide](./MIGRATION_GUIDE.md). The legacy documentation for v0.0.1-alpha.6 can be found [here](https://github.com/NEARBuilders/bos-workspace/tree/version/0.0.1-alpha.6).**

</center>
</div>

`bos-workspace` is a comprehensive toolset designed to simplify the development and deployment of [NEAR components](https://docs.near.org/bos/tutorial/quickstart) and applications. With support for hot reload, TypeScript, and multiple app management, it caters to developers looking for an efficient and scalable developer environment.

Expand All @@ -26,7 +26,7 @@ yarn run bos-workspace clone [accountId] [dest]

Or ensure the proper workspace [structure and usage](#usage).

### Usage
## Usage

`bos-workspace` supports both multi and single app development because of `Apps` and `Workspaces`:

Expand Down Expand Up @@ -72,8 +72,7 @@ where the content of `bos.workspace.json` is:

**Note:** The "app name" is not required to end in `.near`, and apps don't necessarily have to be stored in a directory named `/apps`. What's important is that the `bos.config.json` is located at the same level as directories such as `/widget`, and that `bos.workspace.json` specifies the directory it resides in.


### Commands
## Commands

You can run `bw` or `bos-workspace` to see the list of commands.

Expand All @@ -100,3 +99,37 @@ Commands:

> If the gateway can't fetch local components, try disabling brave shields or your adblock.
> If the commands don't work, try again using Node >=16
## API Endpoints

A running `bos-workspace` server exposes several endpoints for interacting with local data:

### Gateway Frontend

**URL:** `http://127.0.0.1:8080/`

-> Provides a frontend interface for viewing and interacting with widgets.

### Loader API

**URL:** `http://127.0.0.1:8080/api/loader`

**Method:** `POST`

-> Receive all built and served data.

### WebSocket

**URL:** `ws://127.0.0.1:8080/`

-> WebSocket for hot reload, delivers most updated data.

### Proxy RPC

**URL:** `http://127.0.0.1:8080/api/proxy-rpc`

-> Proxies RPC requests, use as rpcUrl in [near-api-js](https://github.com/near/near-api-js).

## Contributing

Read [CONTRIBUTING](./CONTRIBUTING.md)
2 changes: 1 addition & 1 deletion examples/single/data.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"quickstart.testnet": {}
"quickstart.near": {}
}
4 changes: 1 addition & 3 deletions gateway/config/flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,4 @@ export const flags = {
process.env.ENABLE_HOT_RELOAD ?? config.enableHotReload ?? true,
network:
process.env.NETWORK || config.network || "mainnet",
};

console.log("flags", flags);
};
1 change: 1 addition & 0 deletions gateway/dist/1234.45819a346281db80fbd9.bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions gateway/dist/1330.b3527ff21b477fd9d743.bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions gateway/dist/1355.5da6953679170f874a61.bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions gateway/dist/1452.b0471f4475fc6e0622af.bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions gateway/dist/1538.41b23ed9cc4362bbb783.bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions gateway/dist/1837.1a25b8a749e0f19f2ae4.bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2e0fc5d

Please sign in to comment.