LogoLogo
Blockchain ExplorerGitHubCertikWebsite
  • ๐Ÿš€Metacces is coming !!!
  • ๐ŸŽฏMission & Vision
  • ๐Ÿ“ˆMarket Analysis
  • ๐ŸคPartnerships
  • METACCES: GENERAL
    • ๐ŸŽฎMetacces: AR/VR Game
      • ๐Ÿ‘‰Introduction
      • ๐Ÿ”‘Key features
      • ๐Ÿ“ˆEarning mechanics
      • ๐Ÿ‘ฝUnique Oli AI
      • ๐ŸงฌBlacxes
        • What is Blacxes
        • Utilites
        • Unique DNA
        • DAO Governance
        • Technology
        • Distribution
        • Swap
      • โ›“๏ธBridging Web2 Simplicity with Web3 Power
      • ๐Ÿš€How Does Metacces Outperform the Competition?
      • ๐ŸŽฎGame Structure
        • Origin Story: Oli & the Blacxes
        • Game theme (Access Journey)
          • Overview
          • Basic level
          • Intermediate level
          • Final level
        • Activities and Gameplay
        • Game seasons
          • Introduction
          • Season Concept
          • What Does Each Season Include?
          • Importance of Seasons in Metacces
        • Skins & Tools
          • Introduction
          • Core Principles
          • Core Uses of Tools
          • Main Categories of Tools
          • Rarity and Value
          • Symbolism of Tools
          • Verification and Security Mechanisms
        • Clans
          • Introduction
          • Core Pillars of the Clan System
          • Clan Activities
          • Ownership and Economy Within the Clan
          • The Reputation System
          • The Future of Clans in Metacces
          • How to Create a Clan in Metacces
    • ๐Ÿช™Acces Coin
      • Coin Utility
      • Smart-Contracts
      • Tokenomecs
      • Metacces Listings Roadmap
    • โ›“๏ธBlockchain Layer 1
      • Developers
        • Public Endpoints
        • MetaMask
        • Node Setup
        • JSON RPC Server
        • Connect to RPC
        • API Methods
        • Client Libraries
        • Smart Contracts
          • Deploy
          • Interact
          • Transfer
          • Fixed Cap Asset
          • Variable Cap Asset
  • DEVELOPMENT
  • ๐Ÿ“…Roadmap
    • Main Roadmap
      • โœ”๏ธ2022
      • โœ”๏ธ2023
      • ๐Ÿ”›2024
      • 2025
    • Coin Roadmap
      • 2022
      • 2023
      • 2024
  • TEAM
    • 7๏ธโƒฃCore 7 values
    • ๐Ÿ‘จโ€๐Ÿš€Meet The Team
  • SECURITY
    • ๐Ÿซ‚ Team KYC Gold Verified by CERTIK (2024)
    • ๐Ÿช™Coin Audit by CERTIK
    • ๐Ÿ—“๏ธSmart Contract Vesting Audit by CERTIK
    • ๐Ÿช™Coin Audit by SOLIDPROOF
    • ๐Ÿช™Coin Audit by HACKEN
  • OTHER INFO
    • Contact Us
    • Community
      • Website
      • Telegram
      • X.Twitter
      • Discord
      • Youtube
      • Instagram
      • Facebook
Powered by GitBook
On this page

Was this helpful?

  1. METACCES: GENERAL
  2. Blockchain Layer 1
  3. Developers

Client Libraries

PreviousAPI MethodsNextSmart Contracts

Last updated 9 months ago

Was this helpful?

Metacces uses Geth which supports common smart contract and dapp development, deployment, and operational use cases, using tools such as Hardhat, web3.js and web3js-quorum. The client supports common JSON-RPC API methods, for example eth, net, web3, debug, and miner.

Prerequisitesโ€‹

  • Node.js version 15 or later.

  • The web3 library must be installed in your project.

web3

The web3.js library is the most widely used for developing applications.

Install web3 in your project

npm install web3

Initialize the web3 client

Initialize your client where:

  • https://oli.accesscan.io is the JSON-RPC HTTP endpoint of your Metacces node.

  • HTTP example

Example connection

const Web3 = require("web3");

const web3 = new Web3("http://oli.accesscan.io");

WS example

Example connection

const Web3 = require("web3");

const web3 = new Web3("http://ws.accesscan.io");

To deploy a private contract, you need the contract binary. You can use Solidity to get the contract binary.

Copy

myContract.deploy({
   data: '0x12345...',
   arguments: [123, 'My String']
})
.send({
   from: '0x1234567890123456789012345678901234567891',
   gas: 1500000,
   gasPrice: '30000000000000'
}, function(error, transactionHash){ ... })
.on('error', function(error){ ... })
.on('transactionHash', function(transactionHash){ ... })
.on('receipt', function(receipt){
 console.log(receipt.contractAddress) // contains the new contract address
})
.on('confirmation', function(confirmationNumber, receipt){ ... })
.then(function(newContractInstance){
   console.log(newContractInstance.options.address) // instance with the new contract address
});

Alternatively, you can also deploy a contract using eth.sendSignedTransaction

Copy

const rawTxOptions = {
 nonce: "0x00",
 from: account.address,
 to: null, //public tx
 value: "0x00",
 data: "0x" + contractBin + contractConstructorInit,
 gasPrice: "0x0", //ETH per unit of gas
 gasLimit: "0x24A22", //max number of gas units the tx is allowed to use
};
console.log("Creating transaction...");
const tx = new Tx(rawTxOptions);
console.log("Signing transaction...");
tx.sign(Buffer.from(account.privateKey.substring(2), "hex"));
console.log("Sending transaction...");
var serializedTx = tx.serialize();
const pTx = await web3.eth.sendSignedTransaction(
 "0x" + serializedTx.toString("hex").toString("hex"),
);
console.log("tx transactionHash: " + pTx.transactionHash);
console.log("tx contractAddress: " + pTx.contractAddress);
return pTx;

For more information about the web3 methods, see the web3 reference documentation.

Deploying a contract

web3 methods

โ›“๏ธ
โ€‹
โ€‹
โ€‹
โ€‹
โ€‹