dapp_indexer/README.md

96 lines
2.0 KiB
Markdown
Raw Normal View History

## Dapp Indexer
2024-01-17 02:58:50 +00:00
** The Dapp Indexer is a simple smart contract which stores an IPFS CID from a dapp based on a key name**
2024-01-17 02:58:50 +00:00
The goal is to use this as an alternative for ssl to web3 to verify its the correct content/version/asset.
2024-01-17 02:58:50 +00:00
## The Dapp Indexer has the following features:
2024-01-17 02:58:50 +00:00
- [x] Roll management so that it can be integrated into a Dapp or Roles.
- [x] Low Gas Consumption
- [x] Keep it as simple as posible.
## ToDo and wanted features:
- [ ] Integrate CIDStorage library to the Dapp Indexer smart contract
- [ ] Create an event for metadata information about the CID.
- [ ] Support of the [CID Specification](https://github.com/multiformats/cid?tab=readme-ov-file)
2024-01-17 02:58:50 +00:00
## Usage
### Build
```shell
$ forge build
```
### Test
```shell
$ forge test
```
### Gas Snapshots
```shell
$ forge snapshot
```
### Anvil
```shell
$ anvil
```
### Enviorment Variables
2024-01-17 02:58:50 +00:00
### Deploy
#### Option1: Deployment script (recommended)
```shell
$ ./deploy.sh
```
> IMPORTANT: verify .env information before executing the deployment script
**verify by attaching the deployed contract test:**
Once you deployed the contract with the previous script execution you can test
the correct smartcontract operations by running the `DeployedDappIndexer.s.sol`
script
should set after deploying the smart contract in the .env named after
DAPPINDEXERADDRS, once you update the address you can run the following
script to verify it was deployed correctly.
2024-01-17 02:58:50 +00:00
```shell
$source .env
$forge script script/DeployedDappIndexer.s.sol:DappIndexerScript --fork-url $PROVIDER_URL --private-key $PK0 --broadcast
2024-01-17 02:58:50 +00:00
```
#### Option2: Script deployment and test
using the script follows diferent verifications first before deploying the
contract, more about it here.
```shell
$source .env
$forge script script/DappIndexer.s.sol:DappIndexerScript --fork-url $PROVIDER_URL --private-key $PK0 --broadcast
```
> where:
> PROVIDER_URL can be either the anvil fork or a blockchain RPC
> $PK0
2024-01-17 02:58:50 +00:00
### Cast
```shell
$ cast <subcommand>
```
### Help
```shell
$ forge --help
$ anvil --help
$ cast --help
```