# What is AdMeta?

AdMeta is a privacy-preserving advertising platform tailored for Web3 and Metaverse. We offer customized advertising services without compromising user privacy.

To get started, you can follow our guides to run the AdMeta node locally or connect to our testnet to test our features like ad proposal, ad management, ad reward claiming, etc.&#x20;

{% content-ref url="/pages/oURyYLzWKYJJsE3ykq0K" %}
[How to run an AdMeta node](/guides/how-to-run-an-admeta-node)
{% endcontent-ref %}

{% content-ref url="/pages/bzTNc6QGyTMlaiGXLcvJ" %}
[How to use AdMeta WebApp](/guides/how-to-use-admeta-webapp)
{% endcontent-ref %}


# How to run an AdMeta node

AdMeta node is built with Substrate as a solo Blockchain. To run an AdMeta node on your local machine, just follow the steps below.

### Getting Started

#### Rust Setup

First, complete the [basic Rust setup instructions](https://github.com/AdMetaNetwork/admeta/blob/main/docs/rust-setup.md).

#### Clone Source Code

Clone the latest source code from <https://github.com/AdMetaNetwork/admeta>

#### Run

Use Rust's native `cargo` command to build and launch the AdMeta node:

```
cargo run --release -- --dev
```

#### Build

The `cargo run` command will perform an initial build. Use the following command to build the node without launching it:

```
cargo build --release
```

#### Embedded Docs

Once the project has been built, the following command can be used to explore all parameters and subcommands:

```
./target/release/admeta -h
```

### Run

The provided `cargo run` command will launch a temporary node and its state will be discarded after you terminate the process. After the project has been built, there are other ways to launch the node.

#### Single-Node Development Chain

This command will start the single-node development chain with a non-persistent state:

```bash
./target/release/admeta --dev
```

Purge the development chain's state:

```bash
./target/release/admeta purge-chain --dev
```

Start the development chain with detailed logging:

```bash
RUST_BACKTRACE=1 ./target/release/admeta -ldebug --dev
```

> Development chain means that the state of our chain will be in a tmp folder while the nodes are running. Also, **alice** account will be authority and sudo account as declared in the [genesis state](https://github.com/AdMetaNetwork/admeta/blob/main/node/src/chain_spec.rs#L52). At the same time the following accounts will be pre-funded:
>
> * Alice
> * Bob
> * Alice//stash
> * Bob//stash

In case of being interested in maintaining the chain' state between runs a base path must be added so the db can be stored in the provided folder instead of a temporal one. We could use this folder to store different chain databases, as a different folder will be created per different chain that is ran. The following commands shows how to use a newly created folder as our db base path.

```bash
// Create a folder to use as the db base path
$ mkdir my-chain-state

// Use of that folder to store the chain state
$ ./target/release/admeta --dev --base-path ./my-chain-state/

// Check the folder structure created inside the base path after running the chain
$ ls ./my-chain-state
chains
$ ls ./my-chain-state/chains/
dev
$ ls ./my-chain-state/chains/dev
db keystore network
```

#### Connect with Polkadot-JS Apps Front-end

Once the AdMeta node is running locally, you can connect it with **Polkadot-JS Apps** front-end to interact with your chain. [Click here](https://polkadot.js.org/apps/#/explorer?rpc=ws://localhost:9944) connecting the Apps to your local AdMeta node.

#### Run in Docker

First, install [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/).

Then run the following command to start a single node development chain.

```bash
./scripts/docker_run.sh
```

This command will compile your code, followed by the whole unit test run, and then start a local development network.


# How to use AdMeta WebApp

AdMeta WebApp is built for users to better interact with AdMeta Blockchains. Now it supports AdMeta Testnet by default. Below are a few steps to introduce the basic functionalities.

### Connect to Polkadot.js Wallet

1. Go to <https://app.testnet.admeta.network/> to launch the WebApp.
2. Click the button "Connect to Polkadot.js" on the top right to authorize this web app with your Polkadot.js wallet extension and select the account you want to sign in to AdMeta.

   <figure><img src="https://4160119306-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHq6u2QwCUD9OefEJJsqo%2Fuploads%2FOGCwkt4TeG8Rud9M33Ar%2Fimage.png?alt=media&amp;token=ee09c581-b6ef-42c8-acdd-c4ed3f184951" alt=""><figcaption><p>Select an account from the Polkadot.js wallet for AdMeta WebApp</p></figcaption></figure>
3. After successfully singed in, you will see a dashboard indicating a summary of your ad related data. This dashboard is still under construction.

   <figure><img src="https://4160119306-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHq6u2QwCUD9OefEJJsqo%2Fuploads%2F3hNNZvRLsg4lBsTgPKvn%2Fimage.png?alt=media&amp;token=2f3f30f3-7b95-47ad-baed-2c3c5150eb91" alt=""><figcaption><p>A brief overview of the user account (WIP)</p></figcaption></figure>
4. Before doing any further operations, you need first to have a sufficient balance in your account. Please join [our Telegram group](https://t.me/admetanetwork) to ask for some testnet tokens.

### Create Ad Proposals

In the AdMeta network, anyone can be an advertiser, to promote their own products, their on-sale NFTs, or even to promote themselves for jobs, etc. You can create an ad proposal easily with AdMeta WebApp.

1. Switch to the tab "Ad Management" on the left sidebar, and you will see the ad proposals created by you if you have already done any. If not you can simply click "Publish new ad" to create one.

   <figure><img src="https://4160119306-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHq6u2QwCUD9OefEJJsqo%2Fuploads%2FeQlDCpZBaVh56fpvkBNq%2Fimage.png?alt=media&amp;token=d39174a0-fb2e-43e3-ba1e-da60df4dae9a" alt=""><figcaption><p>Ad Management</p></figcaption></figure>
2. Follow the steps of ad proposal creation. First, you need to upload an image of your ad design. This image will be uploaded to IPFS. Also, you need to specify the related parameters of your proposal, for an explanation of these parameters please refer to <https://admetanetwork.github.io/admeta/pallet_ad/pallet/enum.Call.html#variant.propose_ad>. After this, you can preview this ad, and submit it if everything is correct.

   <figure><img src="https://4160119306-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHq6u2QwCUD9OefEJJsqo%2Fuploads%2F1n5cieG39G7u1IyF0onE%2Fimage.png?alt=media&amp;token=ed5f7bb6-8f86-476a-af10-1b5622959583" alt=""><figcaption></figcaption></figure>
3. A sign request is prompted at this time to send an ad proposal transaction, and after signing and sending this transaction, you will see the ad proposal appear on your ad lists with the status "Pending". This means it is not approved yet.  You have done it successfully now!&#x20;

   <figure><img src="https://4160119306-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHq6u2QwCUD9OefEJJsqo%2Fuploads%2F6RctK24AyEJgC7PGOFBA%2Fimage.png?alt=media&amp;token=0fd2a13d-a56c-4fac-b01d-67fc53af39b3" alt=""><figcaption></figcaption></figure>

### Ad Approval

Ad Approval can be only done by AdMeta council, with a manual review of ad contents. You can ask for the approval of your ad in our Telegram and we will help you to approve your ads. After approval, the "Pending" status will become "Approved", and your ad will be published for everyone on AdMeta Network!

<figure><img src="https://4160119306-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHq6u2QwCUD9OefEJJsqo%2Fuploads%2FH68KhvWuVXb0mlVHOWtD%2Fimage.png?alt=media&amp;token=64e9b254-de76-4559-8a73-44b64a410051" alt=""><figcaption></figcaption></figure>

### Create User Profile

Creating AdMeta user profile allows you to match ads that suit your preferences and earn rewards. Switch to the tab "Profile" to create your own user profile.&#x20;

![](https://4160119306-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHq6u2QwCUD9OefEJJsqo%2Fuploads%2FMP4L68ipHFv1PtRg6h8h%2Fimage.png?alt=media\&token=c207448d-86b8-4906-912a-f3b1e93c9411)

Fill out your information and click "Submit", and after signing this transaction, your profile is created on AdMeta Network.

### Check Matched Ads and Claim Rewards

Ad matching happens during the idle and less busy time of AdMeta Blockchain, and it's done automatically without any inputs from either users or advertisers. Switch to the tab "Ad Display" to check if you have any matched ads now.&#x20;

If you have matched ads, you will see it like this:

<figure><img src="https://4160119306-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHq6u2QwCUD9OefEJJsqo%2Fuploads%2F2WW1OWmEsyJMx9c8fQ7c%2Fimage.png?alt=media&amp;token=e6eae5d9-219e-402c-9f47-c1ef6ad8de1a" alt=""><figcaption></figcaption></figure>

Click the button under the ad display, and you will be navigated to an advertiser-customized page, to complete a series of challenges.

<figure><img src="https://4160119306-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHq6u2QwCUD9OefEJJsqo%2Fuploads%2FS0NaC4RbKc4Yg1FFa6sX%2Fimage.png?alt=media&amp;token=2ec77b74-c9e4-436b-8464-14420c44b0c5" alt=""><figcaption></figcaption></figure>

The challenges can be defined and built by advertisers with AdMeta SDK. Possible challenges are wallet connecting of new products, product intro video watching, joining the project telegram group, buying an NFT of certain collections on OpenSea, etc.

After completing all required tasks, you are eligible to claim your reward. Click "Claim rewards" and you will be navigated back to your AdMeta WebApp page. And now your rewards have been claimed to your own wallet.

<figure><img src="https://4160119306-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHq6u2QwCUD9OefEJJsqo%2Fuploads%2Fsk3yK0kQQF54xbMRFlSv%2Fimage.png?alt=media&amp;token=c2659a6f-9d40-4203-b552-65c7ceccba0e" alt=""><figcaption></figcaption></figure>


