Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions session-keys/app/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Magicblock Pte. Ltd.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
54 changes: 54 additions & 0 deletions session-keys/app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Ephemeral Counter UI

This is a React-based UI for the Ephemeral Counter program, which is part of the documentation for integrating with the Ephemeral Rollups.

## Overview

The UI demonstrates the use of Solana's ephemeral rollups with a simple counter program. It showcases an `increment` instruction that can run both on the main network and ephemeral rollup.

## Documentation

For more information, visit: [Ephemeral Rollups Documentation](https://docs.magicblock.gg/Accelerate/ephemeral_rollups).

## Getting Started

### Prerequisites

- Node.js
- npm

### Installation

1. Navigate to the `app` directory
2. Install the dependencies:


npm install


### Running the Application

To start the application, run:


npm run dev


### Configure RPC endpoints

This UI talks to two RPC endpoints:
- REACT_APP_PROVIDER_ENDPOINT: the Solana RPC used by the wallet and on-chain counter (e.g., your local validator or a public RPC).
- REACT_APP_EPHEMERAL_PROVIDER_ENDPOINT: the Ephemeral Rollup RPC used for the ephemeral counter.

You can set them via environment variables when starting the app.

Examples
- Using localhost (same machine):
REACT_APP_PROVIDER_ENDPOINT=http://localhost:8899 \
REACT_APP_EPHEMERAL_PROVIDER_ENDPOINT=http://localhost:7799 \
npm run start

If these variables are not provided, the app will default to MagicBlock’s public endpoints:
- REACT_APP_PROVIDER_ENDPOINT → https://rpc.magicblock.app/devnet
- REACT_APP_EPHEMERAL_PROVIDER_ENDPOINT → https://devnet.magicblock.app

21 changes: 21 additions & 0 deletions session-keys/app/app/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Magicblock Pte. Ltd.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
25 changes: 25 additions & 0 deletions session-keys/app/app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## 🚀 Getting Started

### Npm

```bash
npm run install
```

```bash
npm run start
```

### Yarn

```bash
yarn install
```

```bash
yarn start
```

## 💚 Open Source

Open Source is at the heart of what we do at MagicBlock. We believe building software in the open, with thriving communities, helps leave the world a little better than we found it.
46 changes: 46 additions & 0 deletions session-keys/app/app/craco.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// craco.config.js
const webpack = require('webpack');

module.exports = {
webpack: {
configure: (webpackConfig) => {
// Specify fallbacks for Node.js modules that are not available in the browser
webpackConfig.resolve.fallback = {
http: require.resolve('stream-http'),
https: require.resolve('https-browserify'),
crypto: require.resolve('crypto-browserify'),
stream: require.resolve('stream-browserify'),
buffer: require.resolve('buffer-browserify'),
zlib: false,
url: false,
vm: false,
};

webpackConfig.output = {
...webpackConfig.output,
publicPath: '/',
};

// Add Buffer global if it's missing
webpackConfig.plugins = (webpackConfig.plugins || []).concat(
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
})
);

// Ignore specific warnings (adjust the regex as needed)
const ignoredWarnings = [/Failed to parse source map/];

// Webpack 5 approach to use the 'ignoreWarnings' option
webpackConfig.ignoreWarnings = webpackConfig.ignoreWarnings || [];
webpackConfig.ignoreWarnings = [
...webpackConfig.ignoreWarnings,
...ignoredWarnings.map((pattern) => ({
message: pattern,
})),
];

return webpackConfig;
},
},
};
Loading
Loading