Skip to content

Commit

Permalink
feat: fix webpack v5 options
Browse files Browse the repository at this point in the history
  • Loading branch information
AbigailDeng authored and AbigailDeng committed Jul 4, 2024
1 parent a195d31 commit 857060d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/node/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* eslint-env node */
const AElf = require('../../dist/aelf.cjs');

const Wallet = AElf.wallet;
const { sha256 } = AElf.utils;

Expand All @@ -10,7 +9,7 @@ const defaultPrivateKey = 'bdb3b39ef4cd18c2697a920eb6d9e8c3cf1a930570beb37d04fb5
// const walletCreatedByMethod = Wallet.createNewWallet();
const wallet = Wallet.getWalletByPrivateKey(defaultPrivateKey);
// link to Blockchain
const aelf = new AElf(new AElf.providers.HttpProvider('http://18.162.41.20:8000'));
const aelf = new AElf(new AElf.providers.HttpProvider('https://tdvw-test-node.aelf.io/'));

if (!aelf.isConnected()) {
console.log('Blockchain Node is not running.');
Expand All @@ -21,8 +20,9 @@ const tokenContractName = 'AElf.ContractNames.Token';
const {
// directly accessible information
GenesisContractAddress
} = aelf.chain.getChainStatus({sync: true});
aelf.chain.contractAt(GenesisContractAddress, wallet)
} = aelf.chain.getChainStatus({ sync: true });
aelf.chain
.contractAt(GenesisContractAddress, wallet)
.then(zeroC => {
// return contract's address which you query by contract's name
return zeroC.GetContractAddressByName.call(sha256(tokenContractName));
Expand Down

0 comments on commit 857060d

Please sign in to comment.