axelarnetwork / axelar-examples Goto Github PK
View Code? Open in Web Editor NEWSample cross-chain dapps & contracts using the Axelar protocol.
Sample cross-chain dapps & contracts using the Axelar protocol.
Need to also update axelar-cgp-solidity
to support node > 16
Running npm install
returns vulnerabilities issues:
23 vulnerabilities (15 moderate, 5 high, 3 critical)
To address issues that do not require attention, run:
npm audit fix
To address all issues possible (including breaking changes), run:
npm audit fix --force
Right now, most folks want our EVM examples, but everything is configured to run on every chain stack. This means that to use our simplest EVM example, you have to have python, and the system will run our Aptos code samples too.
To simplify, I propose we add a .env file configuration for chain stacks. Users can specify which chain stacks they want to build with (defaulting to EVM-only), which controls which chains will be executed/deployed/tested.
We could potentially add a prompt as well to help users choose and configure.
The command didn’t execute completely; it got stuck for some reason.
> [email protected] execute
> node scripts/runExecute evm/nft-linker local Avalanche Fantom
--- Initially ---
Token that was originally minted at Avalanche is at Avalanche.
Token that was originally minted at Fantom is at Fantom.
After retrying, it returned:
> [email protected] execute
> node scripts/runExecute evm/nft-linker local Avalanche Fantom
--- Initially ---
Token that was originally minted at Avalanche is at .
Token that was originally minted at Fantom is at Fantom.
/Users/mac/Desktop/GIT/axelar/axelar-examples/scripts/libs/utils.js:125
CHAINS.TESTNET[source.name.toUpperCase()],
^
TypeError: Cannot read properties of undefined (reading 'name')
at calculateBridgeFee (/Users/mac/Desktop/GIT/axelar/axelar-examples/scripts/libs/utils.js:125:31)
at Object.execute (/Users/mac/Desktop/GIT/axelar/axelar-examples/examples/evm/nft-linker/index.js:83:23)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async executeEVMExample (/Users/mac/Desktop/GIT/axelar/axelar-examples/scripts/libs/execute.js:65:5)
Node.js v18.13.0
I'm encountering an error while trying to install the Axelar Example on my Windows machine. I have attempted to use bash to resolve the issue, but it still persists. I'm wondering if there's a way to run the required command on Windows 11.
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c C:\Users\rambo\AppData\Local\Temp\postinstall-6c4eb99e.cmd
npm ERR! > @axelar-network/[email protected] build
npm ERR! > run-s build-aptos
npm ERR!
npm ERR!
npm ERR! > @axelar-network/[email protected] build-aptos
npm ERR! > ./aptos/build.sh
npm ERR! '.' is not recognized as an internal or external command,
npm ERR! operable program or batch file.
npm ERR! ERROR: "build-aptos" exited with 1.
npm ERR! ERROR: "build" exited with 1.
Currently, testnet examples are not working correctly.
D:\BlockChainProjects\axelar-local-gmp-examples> node scripts/createLocal
D:\BlockChainProjects\axelar-local-gmp-examples\node_modules@ethersproject\bytes\lib\index.js:9
return !!(value.toHexString);
^
TypeError: Cannot read properties of undefined (reading 'toHexString')
at isHexable (D:\BlockChainProjects\axelar-local-gmp-examples\node_modules@ethersproject\bytes\lib\index.js:9:21)
at hexlify (D:\BlockChainProjects\axelar-local-gmp-examples\node_modules@ethersproject\bytes\lib\index.js:175:9)
at new SigningKey (D:\BlockChainProjects\axelar-local-gmp-examples\node_modules@ethersproject\signing-key\lib\index.js:20:82)
at new Wallet (D:\BlockChainProjects\axelar-local-gmp-examples\node_modules@ethersproject\wallet\lib\index.js:120:36)
at Object. (D:\BlockChainProjects\axelar-local-gmp-examples\scripts\createLocal.js:26:30)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
at Module.load (node:internal/modules/cjs/loader:1004:32)
at Function.Module._load (node:internal/modules/cjs/loader:839:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
GET http://localhost:3000/assets/Ethereum.gif 404 (Not Found)
GET http://localhost:3000/assets/Avalanche.gif 404 (Not Found)
Hello 👋
I'm setting up an axelar test environment and using this repo as orientation. However, when I try to run npm run build
on my environment, it returns sh: 1: waffle: not found
.
I have an identical package.json
and waffle.json
at root
I tried substituting waffle with ethereum-waffle
and running rm -rf bulid && waffle waffle.json
but to no avail.
Am I overlooking something? I'd appreciate any feedback.
➜ axelar-local-gmp-examples git:(main) ✗ npm test
> [email protected] test
> hardhat test
An unexpected error occurred:
Error: Cannot find module '../artifacts/@axelar-network/axelar-cgp-solidity/contracts/TokenDeployer.sol/TokenDeployer.json'
Require stack:
- /home/ubuntu/ron/axelar-local-gmp-examples/node_modules/@axelar-network/axelar-local-dev/dist/Network.js
- /home/ubuntu/ron/axelar-local-gmp-examples/node_modules/@axelar-network/axelar-local-dev/dist/relay.js
- /home/ubuntu/ron/axelar-local-gmp-examples/node_modules/@axelar-network/axelar-local-dev/dist/exportUtils.js
- /home/ubuntu/ron/axelar-local-gmp-examples/node_modules/@axelar-network/axelar-local-dev/dist/index.js
- /home/ubuntu/ron/axelar-local-gmp-examples/scripts/createLocal.js
- /home/ubuntu/ron/axelar-local-gmp-examples/test/test.js
- /home/ubuntu/ron/axelar-local-gmp-examples/node_modules/mocha/lib/mocha.js
- /home/ubuntu/ron/axelar-local-gmp-examples/node_modules/mocha/index.js
- /home/ubuntu/ron/axelar-local-gmp-examples/node_modules/hardhat/builtin-tasks/test.js
- /home/ubuntu/ron/axelar-local-gmp-examples/node_modules/hardhat/internal/core/tasks/builtin-tasks.js
- /home/ubuntu/ron/axelar-local-gmp-examples/node_modules/hardhat/internal/core/config/config-loading.js
- /home/ubuntu/ron/axelar-local-gmp-examples/node_modules/hardhat/internal/cli/cli.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/home/ubuntu/ron/axelar-local-gmp-examples/node_modules/@axelar-network/axelar-local-dev/src/Network.ts:9:23)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/ubuntu/ron/axelar-local-gmp-examples/node_modules/@axelar-network/axelar-local-dev/dist/Network.js',
seems axelar-local-gmp-examples
still depends on these deprecated versions
hope we can:
npm run send-token
> [email protected] send-token
> node src/send-token.js
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module '@axelar-network/axelarjs-sdk'
Require stack:
- /Users/gus/Documents/axelar/git-repos/axelar-local-dev-sample/src/send-token.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/Users/gus/Documents/axelar/git-repos/axelar-local-dev-sample/src/send-token.js:4:27)
at Module._compile (node:internal/modules/cjs/loader:1099:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/gus/Documents/axelar/git-repos/axelar-local-dev-sample/src/send-token.js'
]
}
Node.js v17.8.0
I thought the local-dev-sample no longer has a dependency on axelarjs-sdk.
Please update the examples and Axelar packages so that they work with ethers 6.
See Migrating from v5
E.g. node run setup
or node run start
to do the following tasks:
Examples:
https://discord.com/channels/770814806105128977/955655587260170272/1091860815570804806
https://discord.com/channels/770814806105128977/955655587260170272/1091870353707507713
Also getting
$ npm run deploy
> [email protected] deploy
> run-s contracts:build contracts:generate contracts:deploy
> [email protected] contracts:build
> hardhat compile
Error HH404: File @axelar-network/axelar-gmp-sdk-solidity/contracts/upgradable/BaseProxy.sol, imported from contracts/nft-linker/Proxy.sol, not found.
For more info go to https://hardhat.org/HH404 or run Hardhat with --show-stack-traces
ERROR: "contracts:build" exited with 1.
Improve the README file for the project by providing precise and concise instructions on what to do next after installation. Include actionable examples and details to help users get started quickly and easily.
call-contract
project readme says, “relay message from source-chain to destination-chain.” while send-arc
says, “Send a message from source-chain to destination-chain.”
When running npm run start on our CLI, the default chains are launched. However, I would like to add options to allow users to specify which chains to launch at startup.
I propose adding options to specify the desired chains using a comma-separated list. For example:
npm run start --chains evm:avalanche,moonbeam --chains move:aptos,sui
This command would start the EVM chains on Avalanche and Moonbeam, and the Move chains on Aptos and SUI.
I believe that this feature would greatly enhance the flexibility and customization options to running our examples, and would be a valuable addition for our users.
Here's an example script to parse the example command above:
const { program } = require("commander");
function collect(value, previous) {
return previous.concat([value]);
}
program
.option(
"--chains <chains>",
"comma-separated list of chains to start",
collect,
[]
)
.parse();
const options = program.opts();
const chains = options.chains.reduce((acc, chain) => {
const [protocol, names] = chain.split(":");
const chainNames = names.split(",");
return {
...acc,
[protocol]: chainNames,
};
}, {});
console.log(chains);
Output
{ evm: [ 'avalanche', 'moonbeam' ], move: [ 'aptos', 'sui' ] }
call-contract-with-token
example is broken as of #6 .
Click on "send" and the NFT disappears from the source chain, but doesn't appear on the destination chain.
For example, require('../../../')
, it would be much easier to read and maintain by always using the relative path from the root directory.
I believe we should default to local
when no parameter is supplied. This will simplify the most common usage patterns.
I got the examples running, but when I click on "deposit address" from the "send token" example, nothing happens. It's unclear what is supposed to happen.
Right now developers have to run npm run setup
to get examples-web to work.
Could we use a symlink instead from examples-web/.env -> ../.env ?
Thoughts @npty? This might break windows though, I'm not 100% sure.
Hi! I tried to use this repository, but as it turned out, the network configuration for the testnet is outdated. There is still rinkebay which is not used and manually changing the config to goerli does not work. Also, moonbeam should be called moonbase and change the rpc endpoint for it since this one does not work. Also, the website shows the new gateway contract addresses but the configuration is the same as before. Can you fix this?
Refactor and cleanup files in /scripts
folders
Change the name to indicate this is "send tokens to many addresses on another chain" example, with any references to custom logic being secondary.
Re-order the page to better match user expectations and our other examples (like sendToken):
On a fresh install after running setup npm run build
I try node scripts/checkBalances
and get
node scripts/checkBalances.js
/Users/gus/Documents/axelar/git-repos/axelar-local-gmp-examples/node_modules/@ethersproject/logger/lib/index.js:233
var error = new Error(message);
^
Error: could not detect network (event="noNetwork", code=NETWORK_ERROR, version=providers/5.6.8)
at Logger.makeError (/Users/gus/Documents/axelar/git-repos/axelar-local-gmp-examples/node_modules/@ethersproject/logger/lib/index.js:233:21)
at Logger.throwError (/Users/gus/Documents/axelar/git-repos/axelar-local-gmp-examples/node_modules/@ethersproject/logger/lib/index.js:242:20)
at JsonRpcProvider.<anonymous> (/Users/gus/Documents/axelar/git-repos/axelar-local-gmp-examples/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:561:54)
at step (/Users/gus/Documents/axelar/git-repos/axelar-local-gmp-examples/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:48:23)
at Object.throw (/Users/gus/Documents/axelar/git-repos/axelar-local-gmp-examples/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:29:53)
at rejected (/Users/gus/Documents/axelar/git-repos/axelar-local-gmp-examples/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:21:65)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
reason: 'could not detect network',
code: 'NETWORK_ERROR',
event: 'noNetwork'
}
Node.js v17.8.0
Right now when cloning and installing dependencies for this repo, we require all of the dependnecies of every chain stack we support (near, aptos, and more in the future).
This means that our repo is harder to install and maintain (windows support for example). We should design a new architecture that makes some of these optional dependencies, or not included at all, and then automatically add the additional dependencies based on the chain stacks a user wants to develop for.
Also, create an index page that shows them.
Add required steps to request and get aUSDC from Axelar discord
Add a contribution guideline for this project when creating issues and pull requests.
Since the #76 PR is quite big, I think it is more appropriate to address them later to make it easier to review.
I have some minor comments and more improvements for later, but this PR can be merged as is. Looks great!
why don't we have a shared sleep method? (we seem to redefine it in many places
why did you refactor to use arrow functions?
Some typos in untouched code I'll fix once this PR lands
(later) Looks like a bunch of format / whitespace changes, can you make sure the whitespace settings are in prettier in our global package.json (or appropriate prettier config file) so we all autoformat the same?
Is it possible to run both nodes and project simultaneously with a single command instead of opening two separate terminals?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.