Whitepaper
  • Whitepaper
  • Terminology
  • Abstract
  • Introduction
  • Vision
  • Overview
    • Current Problems of Existing Blockchain Networks
      • Trilemma
      • Transaction Speed
      • User Experience
      • Software Development
      • Decentralization
    • Metatime Solution
  • MetaChain
    • An Overview for MetaChain
    • MetaAnthill
    • EVM to MVM
    • MetaChain Consensus Mechanism: PoM
    • Transaction Check Per Second (TCPS)
  • Proof of Meta Consensus Mechanism
    • MetaMiner (MPoS & MetaAnthill)
      • Fees and Rewards
    • MacroMiner (MPoH & MetaAnthill)
      • Archive Node
      • Full Node
      • Light Node
    • MicroMiner (MPoSW & MetaAnthill)
  • Scalability
    • Blockchain Network Structure
    • Energy Consumption
  • Smart Contract
    • Smart Contract Compatibility
    • Smart Contract Fees
  • Transaction
    • Transaction Fees
  • Attack Vectors & Security
    • Transaction Denial
    • Eclipse Attack
    • Double Spending
  • Native Token
    • Metatime Coin (MTC)
    • Token Burning
      • Transaction Fee Burning
      • Constant Burning
  • Experimental Results
  • Information
  • Audit
  • Solution and Conclusion
    • Focused on 'Human'
  • References
  • Disclaimer
Powered by GitBook
On this page

Transaction

PreviousSmart Contract FeesNextTransaction Fees

Last updated 1 year ago

require("dotenv").config();
const {ethers, Wallet} = require("ethers");

const network = {
    name:"Eleanor Testnet",
    endpoint:"https://eleanor.metatime.com/rpc",
};

const provider = new ethers.providers.JsonRpcProvider(network.endpoint);
const wallet = new Wallet(process.env.PRIVATE_KEY);

const getTxnInstance = async () => {
    const nonce = await wallet.getTransactionCount();
    const gasPrice = await provider.getGasPrice();
    const gasLimit = 21_000;
    const chainID = await provider.getChainID();
    
    const tx = {
        from: wallet.address,
        to: ethers.constants.AddressZero,
        value: ethers.utils.parseEther(1),
        gasLimit,
        gasPrice,
        nonce,
        chainId,
        data: "0x",
        type: null,
    };
    
    return tx;
};

(async() => {
    const txInstance = await.getTxnInstance();
    await wallet.sendTransaction(txnInstance);
})();

In the MetaChain network, developers can develop on the network using libraries such as Web 3.0 and Ethers.