Developer Hub
Relation ProtocolRelation ONE APIRelation Graph API
English
English
  • Overview
  • QUICK START
    • Deploy a Semantic SBT contract leveraging Relation Protocol
    • Deploying query services using Graph Indexer
  • KEY CONCEPTS
    • RDF
    • Semantic SBTs
    • Social Graph
  • Architecture
  • Schema Standard
    • Overview
    • How schemas limit smart contracts
    • Store schema
    • List of schemas
  • Contract Open Standard
    • Overview
    • Identity
      • Name Service
    • Relationship
      • Follow
      • Dao
    • Publication
      • Content
      • Privacy Content
  • Open Standard API
    • Introduction
    • EIP-6239
    • Business Interface
      • Identity
      • Relationship
      • Publication
  • Graph Indexer
    • Definition and usage
    • Listen to events
    • To parse RDF data
    • To build a social graph
  • Integrations
    • Quick start
    • Construct a social graph with Relation Protocol
    • List of resources
    • NameService contract guide
    • Follow contract guide
    • Dao contract guide
    • Content contract guide
    • PrivacyContent contract guide
  • Relation Name Service
    • Name Service Api
  • Use Case
  • APPENDIX
    • Deploy a contract using Hardhat
    • SemanticSBT Deployment tool
Powered by GitBook
On this page
  1. QUICK START

Deploy a Semantic SBT contract leveraging Relation Protocol

Last updated 1 year ago

We can use the provided by Relation protocol to deploy our own Semantic SBT contracts.

Hardhat is used as the deployment tool. You can refer to:

  1. Download the contract

git clone git@github.com:relationlabs/semanticSBT.git
  1. Install dependencies

cd semanticSBT
npm install
  1. Modify the configuration file

vi hardhat.config.js

Comment the following code segment so that it will not be executed.( For now we only use a local network to demonstrate contract deployment. We don't need to configure other networks.)

rinkeby: {
  url: `https://rinkeby.infura.io/v3/${INFURA_PROJECT_ID}`,
  accounts: [`${PRIVATE_KEY}`]
}
  1. Compile the code

npx hardhat node &
npx hardhat compile
  1. Modify the parameters for contract initialization

Use an editor to open the deployment script.

vi scripts/template/deployFollow.js

Modify the parameters

const name = "Bob's Connection Template";
const symbol = 'SBT';
const baseURI = 'https://api.example.com/v1/';
  • name: The name of the contract

  • symbol: The symbol of the contract

  • baseURI: The root directory of the tokenURI of the contract

  1. Execute the deployment script

npx hardhat run scripts/template/deployFollow.js

A successful deployment will show the below message in the console:

SemanticSBTLogic deployed ,contract address: 0x84323b27A2Ee0DecFe417695F5718BdeC23320E5
Follow deployed ,contract address: 0x89235270C230F8A9d16D49D18fC38cf9343B5F9A
Follow initialized successfully!
0xc1155B6aE7031fE0B9365Bec744aa8E8a298c78b following 0x7ed9cdb704052a9ba93e9df3f604436655680f86 successfully!
The rdf of the first token is: 
            :Soul_0xc1155b6ae7031fe0b9365bec744aa8e8a298c78b p:following :Soul_0x7ed9cdb704052a9ba93e9df3f604436655680f86.

The last line of output is an RDF data representing the relationship of one address following another:

:Soul_0xc1155b6ae7031fe0b9365bec744aa8e8a298c78b p:following :Soul_0x7ed9cdb704052a9ba93e9df3f604436655680f86.
contract template
Use Hardhat to deploy contracts